[pacman-dev] [PATCH] makepkg: Fix non-writable SRCPKGDEST error message

Allan McRae allan at archlinux.org
Tue Jan 31 08:28:44 EST 2012


Provide a helpful error message for when creating a source tarball
and SRCPKGDEST is not writable.

Fixes FS#28197.

Signed-off-by: Allan McRae <allan at archlinux.org>
---
 scripts/makepkg.sh.in |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index e51f9ed..f407e67 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -2048,6 +2048,11 @@ fi
 
 SRCPKGDEST=${_SRCPKGDEST:-$SRCPKGDEST}
 SRCPKGDEST=${SRCPKGDEST:-$startdir} #default to $startdir if undefined
+if (( SOURCEONLY )) && [[ ! -w $SRCPKGDEST ]]; then
+	error "$(gettext "You do not have write permission to store source tarballs in %s.")" "$SRCPKGDEST"
+	plain "$(gettext "Aborting...")"
+	exit 1
+fi
 
 PKGEXT=${_PKGEXT:-$PKGEXT}
 SRCEXT=${_SRCEXT:-$SRCEXT}
-- 
1.7.9



More information about the pacman-dev mailing list