[pacman-dev] [PATCH] Make strip paths configurable
This patch introduces a new STRIP_DIRS makepkg.conf option to change makepkg's search path when stripping binaries. Original work by: Thomas Bächler <thomas@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org> --- doc/makepkg.conf.5.txt | 7 +++++++ etc/makepkg.conf.in | 2 ++ scripts/makepkg.sh.in | 9 ++++++--- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/doc/makepkg.conf.5.txt b/doc/makepkg.conf.5.txt index b5a49ba..8b39c46 100644 --- a/doc/makepkg.conf.5.txt +++ b/doc/makepkg.conf.5.txt @@ -134,6 +134,13 @@ Options that are located in opt/, you may need to add the directory to this array. *NOTE:* Do not add the leading slash to the directory name. +**STRIP_DIRS=(**bin lib sbin usr/{bin,lib} ...**)**:: + If "strip" is specified in the OPTIONS array, this variable will + instruct makepkg where to look to for files to strip. If you build + packages that are located in opt/, you may need to add the directory + to this array. *NOTE:* Do not add the leading slash to the directory + name. + **PKGDEST=**"/path/to/folder":: If this value is not set, packages will by default be placed in the current directory (location of the linkman:PKGBUILD[5]). Many people diff --git a/etc/makepkg.conf.in b/etc/makepkg.conf.in index bb2018f..0241a8e 100644 --- a/etc/makepkg.conf.in +++ b/etc/makepkg.conf.in @@ -73,6 +73,8 @@ OPTIONS=(strip docs libtool emptydirs zipman) INTEGRITY_CHECK=(md5) #-- Info and doc directories to remove (if option set correctly above) DOC_DIRS=(usr/{,share/}{info,doc,gtk-doc} opt/*/{info,doc,gtk-doc}) +#-- Directories to be searched for the strip option (if option set correctly above) +STRIP_DIRS=(bin lib sbin usr/{bin,lib,sbin,local/{bin,lib,sbin}} opt/*/{bin,lib,sbin}) ######################################################################### # PACKAGE OUTPUT diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 2777102..ae19983 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -731,9 +731,12 @@ tidy_install() { if [ "$(check_option strip)" = "y" ]; then msg2 "$(gettext "Stripping debugging symbols from binaries and libraries...")" - local binary bindirs - bindirs="bin lib sbin usr/bin usr/lib usr/sbin usr/local/bin usr/local/lib usr/local/sbin opt/*/bin opt/*/lib opt/*/sbin" - find ${bindirs} -type f 2>/dev/null | while read binary ; do + local binary + if [ -z "${STRIP_DIRS[@]}" ]; then + # fall back to default value + STRIP_DIRS=(bin lib sbin usr/{bin,lib,sbin,local/{bin,lib,sbin}} opt/*/{bin,lib,sbin}) + fi + find ${STRIP_DIRS[@]} -type f 2>/dev/null | while read binary ; do case "$(file -biz "$binary")" in *application/x-sharedlib*) # Libraries (.so) /usr/bin/strip --strip-debug "$binary";; -- 1.5.6.3
Hi, This is the patch from Thomas with the documentation added. I'm not sure whether when STRIP_DIRS is not defined in makepkg.conf that we should use the default path or just output a warning message saying that it is not defined and no stripping is being done. Allan Allan McRae wrote:
This patch introduces a new STRIP_DIRS makepkg.conf option to change makepkg's search path when stripping binaries.
Original work by: Thomas Bächler <thomas@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org> --- doc/makepkg.conf.5.txt | 7 +++++++ etc/makepkg.conf.in | 2 ++ scripts/makepkg.sh.in | 9 ++++++--- 3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/doc/makepkg.conf.5.txt b/doc/makepkg.conf.5.txt index b5a49ba..8b39c46 100644 --- a/doc/makepkg.conf.5.txt +++ b/doc/makepkg.conf.5.txt @@ -134,6 +134,13 @@ Options that are located in opt/, you may need to add the directory to this array. *NOTE:* Do not add the leading slash to the directory name.
+**STRIP_DIRS=(**bin lib sbin usr/{bin,lib} ...**)**:: + If "strip" is specified in the OPTIONS array, this variable will + instruct makepkg where to look to for files to strip. If you build + packages that are located in opt/, you may need to add the directory + to this array. *NOTE:* Do not add the leading slash to the directory + name. + **PKGDEST=**"/path/to/folder":: If this value is not set, packages will by default be placed in the current directory (location of the linkman:PKGBUILD[5]). Many people diff --git a/etc/makepkg.conf.in b/etc/makepkg.conf.in index bb2018f..0241a8e 100644 --- a/etc/makepkg.conf.in +++ b/etc/makepkg.conf.in @@ -73,6 +73,8 @@ OPTIONS=(strip docs libtool emptydirs zipman) INTEGRITY_CHECK=(md5) #-- Info and doc directories to remove (if option set correctly above) DOC_DIRS=(usr/{,share/}{info,doc,gtk-doc} opt/*/{info,doc,gtk-doc}) +#-- Directories to be searched for the strip option (if option set correctly above) +STRIP_DIRS=(bin lib sbin usr/{bin,lib,sbin,local/{bin,lib,sbin}} opt/*/{bin,lib,sbin})
######################################################################### # PACKAGE OUTPUT diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 2777102..ae19983 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -731,9 +731,12 @@ tidy_install() {
if [ "$(check_option strip)" = "y" ]; then msg2 "$(gettext "Stripping debugging symbols from binaries and libraries...")" - local binary bindirs - bindirs="bin lib sbin usr/bin usr/lib usr/sbin usr/local/bin usr/local/lib usr/local/sbin opt/*/bin opt/*/lib opt/*/sbin" - find ${bindirs} -type f 2>/dev/null | while read binary ; do + local binary + if [ -z "${STRIP_DIRS[@]}" ]; then + # fall back to default value + STRIP_DIRS=(bin lib sbin usr/{bin,lib,sbin,local/{bin,lib,sbin}} opt/*/{bin,lib,sbin}) + fi + find ${STRIP_DIRS[@]} -type f 2>/dev/null | while read binary ; do case "$(file -biz "$binary")" in *application/x-sharedlib*) # Libraries (.so) /usr/bin/strip --strip-debug "$binary";;
2008/7/20 Allan McRae <allan@archlinux.org>:
Hi,
This is the patch from Thomas with the documentation added. I'm not sure whether when STRIP_DIRS is not defined in makepkg.conf that we should use the default path or just output a warning message saying that it is not defined and no stripping is being done.
If both will be done - that will lessen the amount of unstripped packages made by people because of unmodified makepkg.conf. On the other hand - people should keep their makepkg.conf up to date. -- Roman Kyrylych (Роман Кирилич)
Allan McRae wrote:
Hi,
This is the patch from Thomas with the documentation added. I'm not sure whether when STRIP_DIRS is not defined in makepkg.conf that we should use the default path or just output a warning message saying that it is not defined and no stripping is being done.
In my opinion, what you did is perfectly fine : using the default path when the strip option is enabled but STRIP_DIRS is not defined If you want to disable stripping, you just disable the strip option. And that way, it stays backward compatible with previous makepkg.conf.
On Sun, Jul 20, 2008 at 8:01 AM, Allan McRae <allan@archlinux.org> wrote:
This patch introduces a new STRIP_DIRS makepkg.conf option to change makepkg's search path when stripping binaries.
Original work by: Thomas Bächler <thomas@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org> --- doc/makepkg.conf.5.txt | 7 +++++++ etc/makepkg.conf.in | 2 ++ scripts/makepkg.sh.in | 9 ++++++--- 3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/doc/makepkg.conf.5.txt b/doc/makepkg.conf.5.txt index b5a49ba..8b39c46 100644 --- a/doc/makepkg.conf.5.txt +++ b/doc/makepkg.conf.5.txt @@ -134,6 +134,13 @@ Options that are located in opt/, you may need to add the directory to this array. *NOTE:* Do not add the leading slash to the directory name.
+**STRIP_DIRS=(**bin lib sbin usr/{bin,lib} ...**)**:: + If "strip" is specified in the OPTIONS array, this variable will + instruct makepkg where to look to for files to strip. If you build + packages that are located in opt/, you may need to add the directory + to this array. *NOTE:* Do not add the leading slash to the directory + name. + **PKGDEST=**"/path/to/folder":: If this value is not set, packages will by default be placed in the current directory (location of the linkman:PKGBUILD[5]). Many people diff --git a/etc/makepkg.conf.in b/etc/makepkg.conf.in index bb2018f..0241a8e 100644 --- a/etc/makepkg.conf.in +++ b/etc/makepkg.conf.in @@ -73,6 +73,8 @@ OPTIONS=(strip docs libtool emptydirs zipman) INTEGRITY_CHECK=(md5) #-- Info and doc directories to remove (if option set correctly above) DOC_DIRS=(usr/{,share/}{info,doc,gtk-doc} opt/*/{info,doc,gtk-doc}) +#-- Directories to be searched for the strip option (if option set correctly above) +STRIP_DIRS=(bin lib sbin usr/{bin,lib,sbin,local/{bin,lib,sbin}} opt/*/{bin,lib,sbin})
######################################################################### # PACKAGE OUTPUT diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 2777102..ae19983 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -731,9 +731,12 @@ tidy_install() {
if [ "$(check_option strip)" = "y" ]; then msg2 "$(gettext "Stripping debugging symbols from binaries and libraries...")" - local binary bindirs - bindirs="bin lib sbin usr/bin usr/lib usr/sbin usr/local/bin usr/local/lib usr/local/sbin opt/*/bin opt/*/lib opt/*/sbin" - find ${bindirs} -type f 2>/dev/null | while read binary ; do + local binary + if [ -z "${STRIP_DIRS[@]}" ]; then + # fall back to default value + STRIP_DIRS=(bin lib sbin usr/{bin,lib,sbin,local/{bin,lib,sbin}} opt/*/{bin,lib,sbin}) + fi + find ${STRIP_DIRS[@]} -type f 2>/dev/null | while read binary ; do case "$(file -biz "$binary")" in *application/x-sharedlib*) # Libraries (.so) /usr/bin/strip --strip-debug "$binary";;
That line seems to break for me here :
+ if [ -z "${STRIP_DIRS[@]}" ]; then
==> Tidying install... -> Compressing man pages... -> Stripping debugging symbols from binaries and libraries... /usr/bin/makepkg: line 735: [: too many arguments Can anyone reproduce this? (just run makepkg from git on any packages).
On Mon, Jul 28, 2008 at 3:22 PM, Xavier <shiningxc@gmail.com> wrote:
On Sun, Jul 20, 2008 at 8:01 AM, Allan McRae <allan@archlinux.org> wrote:
This patch introduces a new STRIP_DIRS makepkg.conf option to change makepkg's search path when stripping binaries.
Original work by: Thomas Bächler <thomas@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org> --- doc/makepkg.conf.5.txt | 7 +++++++ etc/makepkg.conf.in | 2 ++ scripts/makepkg.sh.in | 9 ++++++--- 3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/doc/makepkg.conf.5.txt b/doc/makepkg.conf.5.txt index b5a49ba..8b39c46 100644 --- a/doc/makepkg.conf.5.txt +++ b/doc/makepkg.conf.5.txt @@ -134,6 +134,13 @@ Options that are located in opt/, you may need to add the directory to this array. *NOTE:* Do not add the leading slash to the directory name.
+**STRIP_DIRS=(**bin lib sbin usr/{bin,lib} ...**)**:: + If "strip" is specified in the OPTIONS array, this variable will + instruct makepkg where to look to for files to strip. If you build + packages that are located in opt/, you may need to add the directory + to this array. *NOTE:* Do not add the leading slash to the directory + name. + **PKGDEST=**"/path/to/folder":: If this value is not set, packages will by default be placed in the current directory (location of the linkman:PKGBUILD[5]). Many people diff --git a/etc/makepkg.conf.in b/etc/makepkg.conf.in index bb2018f..0241a8e 100644 --- a/etc/makepkg.conf.in +++ b/etc/makepkg.conf.in @@ -73,6 +73,8 @@ OPTIONS=(strip docs libtool emptydirs zipman) INTEGRITY_CHECK=(md5) #-- Info and doc directories to remove (if option set correctly above) DOC_DIRS=(usr/{,share/}{info,doc,gtk-doc} opt/*/{info,doc,gtk-doc}) +#-- Directories to be searched for the strip option (if option set correctly above) +STRIP_DIRS=(bin lib sbin usr/{bin,lib,sbin,local/{bin,lib,sbin}} opt/*/{bin,lib,sbin})
######################################################################### # PACKAGE OUTPUT diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 2777102..ae19983 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -731,9 +731,12 @@ tidy_install() {
if [ "$(check_option strip)" = "y" ]; then msg2 "$(gettext "Stripping debugging symbols from binaries and libraries...")" - local binary bindirs - bindirs="bin lib sbin usr/bin usr/lib usr/sbin usr/local/bin usr/local/lib usr/local/sbin opt/*/bin opt/*/lib opt/*/sbin" - find ${bindirs} -type f 2>/dev/null | while read binary ; do + local binary + if [ -z "${STRIP_DIRS[@]}" ]; then + # fall back to default value + STRIP_DIRS=(bin lib sbin usr/{bin,lib,sbin,local/{bin,lib,sbin}} opt/*/{bin,lib,sbin}) + fi + find ${STRIP_DIRS[@]} -type f 2>/dev/null | while read binary ; do case "$(file -biz "$binary")" in *application/x-sharedlib*) # Libraries (.so) /usr/bin/strip --strip-debug "$binary";;
That line seems to break for me here :
+ if [ -z "${STRIP_DIRS[@]}" ]; then
==> Tidying install... -> Compressing man pages... -> Stripping debugging symbols from binaries and libraries... /usr/bin/makepkg: line 735: [: too many arguments
Can anyone reproduce this? (just run makepkg from git on any packages).
Weird. "Too many arguments" should only happen if that was unquoted... aaron@gerolde:~$ [ -z foo bar baz ] -bash: [: too many arguments aaron@gerolde:~$ [ -z "foo bar baz" ] aaron@gerolde:~$
On Mon, Jul 28, 2008 at 10:45 PM, Aaron Griffin <aaronmgriffin@gmail.com> wrote:
aaron@gerolde:~$ [ -z foo bar baz ] -bash: [: too many arguments aaron@gerolde:~$ [ -z "foo bar baz" ] aaron@gerolde:~$
Well don't ask me to explain, but here is a closer test case I think : [xavier@nx7400 ~]$ array=({foo,bar,baz}) [xavier@nx7400 ~]$ [ -z "${array[@]}" ] bash: [: too many arguments
On Mon, Jul 28, 2008 at 3:51 PM, Xavier <shiningxc@gmail.com> wrote:
On Mon, Jul 28, 2008 at 10:45 PM, Aaron Griffin <aaronmgriffin@gmail.com> wrote:
aaron@gerolde:~$ [ -z foo bar baz ] -bash: [: too many arguments aaron@gerolde:~$ [ -z "foo bar baz" ] aaron@gerolde:~$
Well don't ask me to explain, but here is a closer test case I think :
[xavier@nx7400 ~]$ array=({foo,bar,baz}) [xavier@nx7400 ~]$ [ -z "${array[@]}" ] bash: [: too many arguments
Weird. I'd guess this is something to do with globbing taking priority. Seeing as this is just testing for some value, using single quotes fixes the issue.
On Mon, Jul 28, 2008 at 11:05 PM, Aaron Griffin <aaronmgriffin@gmail.com> wrote:
On Mon, Jul 28, 2008 at 3:51 PM, Xavier <shiningxc@gmail.com> wrote:
On Mon, Jul 28, 2008 at 10:45 PM, Aaron Griffin <aaronmgriffin@gmail.com> wrote:
aaron@gerolde:~$ [ -z foo bar baz ] -bash: [: too many arguments aaron@gerolde:~$ [ -z "foo bar baz" ] aaron@gerolde:~$
Well don't ask me to explain, but here is a closer test case I think :
[xavier@nx7400 ~]$ array=({foo,bar,baz}) [xavier@nx7400 ~]$ [ -z "${array[@]}" ] bash: [: too many arguments
Weird. I'd guess this is something to do with globbing taking priority. Seeing as this is just testing for some value, using single quotes fixes the issue.
_______________________________________________ pacman-dev mailing list pacman-dev@archlinux.org http://archlinux.org/mailman/listinfo/pacman-dev
With single quotes, I am not sure it still works correctly. [xavier@nx7400 ~]$ unset array [xavier@nx7400 ~]$ [ -z '${array[@]}' ] || echo array not empty array not empty [xavier@nx7400 ~]$ echo '${array[@]}' ${array[@]} What about handling it just like a normal variable ? [xavier@nx7400 ~]$ array=({foo,bar,baz}) [xavier@nx7400 ~]$ [ -z "$array" ] || echo array not empty array not empty [xavier@nx7400 ~]$ unset array [xavier@nx7400 ~]$ [ -z "$array" ] || echo array not empty [xavier@nx7400 ~]$
On Mon, Jul 28, 2008 at 4:12 PM, Xavier <shiningxc@gmail.com> wrote:
On Mon, Jul 28, 2008 at 11:05 PM, Aaron Griffin <aaronmgriffin@gmail.com> wrote:
On Mon, Jul 28, 2008 at 3:51 PM, Xavier <shiningxc@gmail.com> wrote:
On Mon, Jul 28, 2008 at 10:45 PM, Aaron Griffin <aaronmgriffin@gmail.com> wrote:
aaron@gerolde:~$ [ -z foo bar baz ] -bash: [: too many arguments aaron@gerolde:~$ [ -z "foo bar baz" ] aaron@gerolde:~$
Well don't ask me to explain, but here is a closer test case I think :
[xavier@nx7400 ~]$ array=({foo,bar,baz}) [xavier@nx7400 ~]$ [ -z "${array[@]}" ] bash: [: too many arguments
Weird. I'd guess this is something to do with globbing taking priority. Seeing as this is just testing for some value, using single quotes fixes the issue.
With single quotes, I am not sure it still works correctly.
Touché! I gave it very little thought... of course it works, it never does any variable expansion!
What about handling it just like a normal variable ? [xavier@nx7400 ~]$ array=({foo,bar,baz}) [xavier@nx7400 ~]$ [ -z "$array" ] || echo array not empty array not empty [xavier@nx7400 ~]$ unset array [xavier@nx7400 ~]$ [ -z "$array" ] || echo array not empty [xavier@nx7400 ~]$
That'd work, except for cases of idiocy, like... array=('' {foo,bar,baz})
On Mon, Jul 28, 2008 at 11:22 PM, Aaron Griffin <aaronmgriffin@gmail.com> wrote:
That'd work, except for cases of idiocy, like... array=('' {foo,bar,baz}
Arf. And guess what, that is like the 1000000000th thing that works like I want with zsh and not with bash... zsh : echo $array -> foo bar baz bash : echo $array -> nothing, because it displays the first element which is an empty string. Anyway, I have something else, look : [xavier@nx7400 ~]$ array=('' {foo,bar,baz}) [xavier@nx7400 ~]$ [ -z "${array[@]}" ] || echo array not empty bash: [: too many arguments array not empty [xavier@nx7400 ~]$ [ -z "${array[*]}" ] || echo array not empty array not empty I never understood what the differences between @ and * were though... Another thing, I just realized that the current code already seems to work like we want, so this is a small issue. We only get that "too many arguments" message which look very odd and let us think that something probably broke.
On Mon, 28 Jul 2008 23:44:13 +0200 Xavier <shiningxc@gmail.com> wrote:
Anyway, I have something else, look : [xavier@nx7400 ~]$ array=('' {foo,bar,baz}) [xavier@nx7400 ~]$ [ -z "${array[@]}" ] || echo array not empty bash: [: too many arguments array not empty [xavier@nx7400 ~]$ [ -z "${array[*]}" ] || echo array not empty array not empty
I never understood what the differences between @ and * were though...
The way I understand it "${array[@]}" is expanded to "foo" "bar" "baz", while "${array[*]}" is expanded to "foo%bar%baz" where % is the first character of $IFS (meaning ' ' if not set otherwise). So with @ you get several words for the test, which would explain the observed behaviour. Interestingly enough [[ -z "${array[@]}" ]] seems to work as well...
On Tue, Jul 29, 2008 at 2:06 AM, Henning Garus <henning.garus@googlemail.com> wrote:
On Mon, 28 Jul 2008 23:44:13 +0200 Xavier <shiningxc@gmail.com> wrote:
Anyway, I have something else, look : [xavier@nx7400 ~]$ array=('' {foo,bar,baz}) [xavier@nx7400 ~]$ [ -z "${array[@]}" ] || echo array not empty bash: [: too many arguments array not empty [xavier@nx7400 ~]$ [ -z "${array[*]}" ] || echo array not empty array not empty
I never understood what the differences between @ and * were though...
The way I understand it "${array[@]}" is expanded to "foo" "bar" "baz", while "${array[*]}" is expanded to "foo%bar%baz" where % is the first character of $IFS (meaning ' ' if not set otherwise).
So with @ you get several words for the test, which would explain the observed behaviour.
Interestingly enough [[ -z "${array[@]}" ]] seems to work as well...
Hmm now we have too many solutions and I don't know which one to choose. 1) [ -z "$array" ] 2) [ -z "${array[*]}" ] 3) [[ -z "${array[@]}" ]] (the current problematic one is [ -z "${array[@]}" ] ). So you can vote now :)
On Tue, Jul 29, 2008 at 1:00 AM, Xavier <shiningxc@gmail.com> wrote:
On Tue, Jul 29, 2008 at 2:06 AM, Henning Garus <henning.garus@googlemail.com> wrote:
On Mon, 28 Jul 2008 23:44:13 +0200 Xavier <shiningxc@gmail.com> wrote:
Anyway, I have something else, look : [xavier@nx7400 ~]$ array=('' {foo,bar,baz}) [xavier@nx7400 ~]$ [ -z "${array[@]}" ] || echo array not empty bash: [: too many arguments array not empty [xavier@nx7400 ~]$ [ -z "${array[*]}" ] || echo array not empty array not empty
I never understood what the differences between @ and * were though...
The way I understand it "${array[@]}" is expanded to "foo" "bar" "baz", while "${array[*]}" is expanded to "foo%bar%baz" where % is the first character of $IFS (meaning ' ' if not set otherwise).
So with @ you get several words for the test, which would explain the observed behaviour.
Interestingly enough [[ -z "${array[@]}" ]] seems to work as well...
Hmm now we have too many solutions and I don't know which one to choose. 1) [ -z "$array" ] 2) [ -z "${array[*]}" ] 3) [[ -z "${array[@]}" ]]
(the current problematic one is [ -z "${array[@]}" ] ). So you can vote now :)
I think (2) is what we are looking for. "If the array (as a whole) contains anything, then..." -Dan
On Tue, Jul 29, 2008 at 1:45 PM, Dan McGee <dpmcgee@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[*]}" ]
Aaron Griffin wrote:
On Mon, Jul 28, 2008 at 4:12 PM, Xavier <shiningxc@gmail.com> wrote:
What about handling it just like a normal variable ? [xavier@nx7400 ~]$ array=({foo,bar,baz}) [xavier@nx7400 ~]$ [ -z "$array" ] || echo array not empty array not empty [xavier@nx7400 ~]$ unset array [xavier@nx7400 ~]$ [ -z "$array" ] || echo array not empty [xavier@nx7400 ~]$
That'd work, except for cases of idiocy, like... array=('' {foo,bar,baz})
That would be telling makepkg to strip files in / so that is multiple-idiocy to me - firstly for putting files in / and secondly for realizing it and thinking it would be a good idea to strip them. I am happy to go with that fix and will point and say idiot to any person who strikes this... Allan
participants (6)
-
Aaron Griffin
-
Allan McRae
-
Dan McGee
-
Henning Garus
-
Roman Kyrylych
-
Xavier