summaryrefslogtreecommitdiffstats
path: root/scripts/makepkg.sh.in
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-03-09 01:08:15 +0100
committerDan McGee <dan@archlinux.org>2012-03-09 01:08:15 +0100
commit8de0631edbd1fd7681f6a924f5e166621328c13f (patch)
tree228db78143b109eeafdcd386354a2e09f561c854 /scripts/makepkg.sh.in
parentf34864cc9e4e755f2add7581419f4ec1c2525fe0 (diff)
parent1a8c3e52d70bfa21ba108aa77179adf90401949d (diff)
downloadpacman-8de0631edbd1fd7681f6a924f5e166621328c13f.tar.gz
pacman-8de0631edbd1fd7681f6a924f5e166621328c13f.tar.xz
Merge branch 'maint'
Conflicts: lib/libalpm/be_package.c
Diffstat (limited to 'scripts/makepkg.sh.in')
-rw-r--r--scripts/makepkg.sh.in18
1 files changed, 12 insertions, 6 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 04ca2a5b..89cd118d 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" "$$"
}
@@ -1071,7 +1076,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
@@ -1189,7 +1194,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
@@ -1983,10 +1989,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