From fbfcd8665086f71b65370e919105194111b4b5f1 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sun, 4 Mar 2012 19:17:21 +0100 Subject: makepkg: fix extraction of soname in find_libdepends libperl.so results in soname="libperl.so.so" which is wrong. This returns the correct string: "libperl.so" Fix-by: Dave Reisner Signed-off-by: Florian Pritz --- scripts/makepkg.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/makepkg.sh.in') diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 805c31a9..21cbfab8 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -1067,7 +1067,7 @@ find_libdepends() { for sofile in $(LC_ALL=C readelf -d "$filename" 2>/dev/null | sed -nr 's/.*Shared library: \[(.*)\].*/\1/p') do # extract the library name: libfoo.so - soname="${sofile%%\.so\.*}.so" + soname="${sofile%.so?(+(.+([0-9])))}".so # extract the major version: 1 soversion="${sofile##*\.so\.}" if in_array "${soname}" ${depends[@]}; then -- cgit v1.2.3-24-g4f1b From ea7fc8962a819a04237876995140363a818202d4 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sun, 4 Mar 2012 19:23:25 +0100 Subject: makepkg: fix false error with multiple libdeps With multiple items in $libdepends this check only worked for the first one, everything after this returned an error. This was probably an issue with \s being treated wrong. Fix-by: Dave Reisner Signed-off-by: Florian Pritz --- scripts/makepkg.sh.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts/makepkg.sh.in') diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 21cbfab8..7c86b77f 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -1152,7 +1152,8 @@ write_pkginfo() { if [[ $it = *.so ]]; then # check if the entry has been found by find_libdepends # if not, it's unneeded; tell the user so he can remove it - if [[ ! $libdepends =~ (^|\s)${it}=.* ]]; then + printf -v re '(^|\s)%s=.*' "$it" + if [[ ! $libdepends =~ $re ]]; then error "$(gettext "Cannot find library listed in %s: %s")" "'depends'" "$it" return 1 fi -- cgit v1.2.3-24-g4f1b From 1a8c3e52d70bfa21ba108aa77179adf90401949d Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Fri, 2 Mar 2012 19:25:15 -0500 Subject: makepkg: exit via default signal handler in trap_exit Similar to how we manage receipt of SIGINT in pacman's internal downloader, catch the signal and invoke our own trap handler before unsetting it and calling the default. This requires a slight modification to the arguments passed to trap_exit so we can pass the raised signal to trap_exit (note that we substitue USR1 for ERR since the latter is unique to bash). Fixes FS#28491. Signed-off-by: Dave Reisner Signed-off-by: Dan McGee --- scripts/makepkg.sh.in | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'scripts/makepkg.sh.in') diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 7c86b77f..4656ab03 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -118,12 +118,17 @@ error() { # the fakeroot call, the error message will be printed by the main call. ## trap_exit() { + local signal=$1; shift + if (( ! INFAKEROOT )); then echo error "$@" fi [[ -n $srclinks ]] && rm -rf "$srclinks" - exit 1 + + # unset the trap for this signal, and then call the default handler + trap -- "$signal" + kill "-$signal" "$$" } @@ -1964,10 +1969,10 @@ done # setup signal traps trap 'clean_up' 0 for signal in TERM HUP QUIT; do - trap "trap_exit \"$(gettext "%s signal caught. Exiting...")\" \"$signal\"" "$signal" + trap "trap_exit $signal \"$(gettext "%s signal caught. Exiting...")\" \"$signal\"" "$signal" done -trap 'trap_exit "$(gettext "Aborted by user! Exiting...")"' INT -trap 'trap_exit "$(gettext "An unknown error has occurred. Exiting...")"' ERR +trap 'trap_exit INT "$(gettext "Aborted by user! Exiting...")"' INT +trap 'trap_exit USR1 "$(gettext "An unknown error has occurred. Exiting...")"' ERR set -E # preserve environment variables and canonicalize path -- cgit v1.2.3-24-g4f1b