[pacman-dev] [PATCH] Make strip paths configurable

Xavier shiningxc at gmail.com
Tue Jul 29 08:30:27 EDT 2008


On Tue, Jul 29, 2008 at 1:45 PM, Dan McGee <dpmcgee at gmail.com> wrote:
>
> I think (2) is what we are looking for. "If the array (as a whole)
> contains anything, then..."
>

(2) and (3) should say the same thing, but it is the opposite : "If
the array (as a whole) does not contain anything, then..."
(1) says (if I understood correctly) : if the first element of the
array is empty, then..."
But in the general/normal case where there are no empty strings, it
should be equivalent to the rest.

However, it is not really what I was looking for in the beginning, I
would prefer a behavior like this :
when the strip option is enabled :
* if STRIP_DIRS is not defined, switch back to default value (here we
get the backward compatibility)
* if STRIP_DIRS is empty, don't strip anything

But the second situation is stupid anyway.
So we can just handle undefined and empty the same way, and fallback
to default value in both cases, which seems easier to do.

Short answer :
I made a commit on my working branch for the first option yesterday :
1) [ -z "$array" ]
I will change it this evening for picking the second option : 2) [ -z
"${array[*]}" ]




More information about the pacman-dev mailing list