Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/scripts/makepkg.sh.in
diff options
context:
space:
mode:
authorXavier Chantry <shiningxc@gmail.com>2009-08-18 20:30:04 +0200
committerDan McGee <dan@archlinux.org>2009-09-06 15:57:30 -0500
commitb53aa87ea9489f15c42c5213569be0b73789b77f (patch)
tree9b04ef289f06ee245edb8c9f4b386476a8436b44 /scripts/makepkg.sh.in
parentcb07265851898ae352ef801ef99c98f26e28b03e (diff)
makepkg : check for invalid backup entry
This implements FS#13551 Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'scripts/makepkg.sh.in')
-rw-r--r--scripts/makepkg.sh.in22
1 files changed, 22 insertions, 0 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index fc30caea..558f0938 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -949,6 +949,18 @@ write_pkginfo() {
fi
}
+check_package() {
+ cd "$pkgdir"
+
+ # check existence of backup files
+ local file
+ for file in "${backup[@]}"; do
+ if [ ! -f "$file" ]; then
+ warning "$(gettext "Invalid backup entry : %s")" "$file"
+ fi
+ done
+}
+
create_package() {
if [ ! -d "$pkgdir" ]; then
error "$(gettext "Missing pkg/ directory.")"
@@ -956,6 +968,8 @@ create_package() {
exit 1 # $E_MISSING_PKGDIR
fi
+ check_package
+
cd "$pkgdir"
msg "$(gettext "Creating package...")"
@@ -1158,6 +1172,14 @@ check_sanity() {
fi
done
+ local file
+ for file in "${backup[@]}"; do
+ if [ "${file:0:1}" = "/" ]; then
+ error "$(gettext "Invalid backup entry : %s")" "$file"
+ return 1
+ fi
+ done
+
if [ "$install" -a ! -f "$install" ]; then
error "$(gettext "Install scriptlet (%s) does not exist.")" "$install"
return 1