FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 07-01-2008, 07:43 PM
"Dan McGee"
 
Default Make strip paths configurable

On Tue, Jul 1, 2008 at 2:27 PM, Thomas Bächler <thomas@archlinux.org> wrote:
> Dan McGee schrieb:
>>>
>>> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
>>> index c809498..4a6f9b2 100644
>>> --- a/scripts/makepkg.sh.in
>>> +++ b/scripts/makepkg.sh.in
>>> @@ -737,9 +737,11 @@ 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
>>> + 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
>>
>> This breaks what was fixed here; you'll need to resubmit with that in
>> mind:
>>
>> http://projects.archlinux.org/?p=pacman.git;a=commitdiff;h=27943a04d6dd135628c23 13525ebffbcd76cc514

The bash {} expansion was causing some problems I believe, otherwise
I'm not completely sure why I would have changed that. The referenced
patch definitely made that change, I wish I would have documented
better why...

-Dan
_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 07-01-2008, 07:59 PM
Thomas Bächler
 
Default Make strip paths configurable

Dan McGee schrieb:

This breaks what was fixed here; you'll need to resubmit with that in
mind:

http://projects.archlinux.org/?p=pacman.git;a=commitdiff;h=27943a04d6dd135628c23 13525ebffbcd76cc514


The bash {} expansion was causing some problems I believe, otherwise
I'm not completely sure why I would have changed that. The referenced
patch definitely made that change, I wish I would have documented
better why...


I thought the problem was 'for i in $(find ....)' vs. 'find .... | while
read line'. find will display one file per line. The 'for' loop will
iterate over the words, not the lines, thus whitespace in filenames will
break. The 'read' will always read a line and treat it as one word,
ignoring whitespace.


The bash expansion on the find commandline will quote everything
properly, so the find command will have all the paths.


Thus, I think the patch is correct.

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 07-15-2008, 06:30 AM
Allan McRae
 
Default Make strip paths configurable

Thomas Bächler wrote:
> This patch introduces a new STRIP_DIRS makepkg.conf option
> to change makepkg's search path when stripping binaries.

Again, I am happy for this to be included once documentation has been
added (makepkg.conf.5.txt).

Allan



_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 07-20-2008, 06:01 AM
Allan McRae
 
Default 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


_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 07-20-2008, 06:05 AM
Allan McRae
 
Default Make strip paths configurable

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";;
>




_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 07-20-2008, 09:23 AM
"Roman Kyrylych"
 
Default Make strip paths configurable

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 (Ð*оман Кирилич)
_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 07-20-2008, 11:46 AM
Xavier
 
Default Make strip paths configurable

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.

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 07-28-2008, 08:22 PM
Xavier
 
Default Make strip paths configurable

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).

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 07-28-2008, 08:45 PM
"Aaron Griffin"
 
Default Make strip paths configurable

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:~$
_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 07-28-2008, 08:51 PM
Xavier
 
Default Make strip paths configurable

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

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 

Thread Tools




All times are GMT. The time now is 05:58 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org