From b53aa87ea9489f15c42c5213569be0b73789b77f Mon Sep 17 00:00:00 2001 From: Xavier Chantry Date: Tue, 18 Aug 2009 20:30:04 +0200 Subject: makepkg : check for invalid backup entry This implements FS#13551 Signed-off-by: Xavier Chantry Signed-off-by: Allan McRae Signed-off-by: Dan McGee --- scripts/makepkg.sh.in | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'scripts') 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 -- cgit v1.2.3-70-g09d2