From 3aae9488ab11c87b483cb5df58bb364f55fefb7d Mon Sep 17 00:00:00 2001 From: "Tom G. Christensen" Date: Sun, 27 May 2012 11:10:07 +0200 Subject: [PATCH] Automatically create stagedir if it is missing Also don't treat a missing stagedir as an error when calling clean. --- buildpkg.functions | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/buildpkg.functions b/buildpkg.functions index 8437fbb..1706b4d 100644 --- a/buildpkg.functions +++ b/buildpkg.functions @@ -448,8 +448,6 @@ clean() echo "Emptying $stagedir" ${__rm} -rf $stagedir # This is very dangerous! ${__mkdir} $stagedir - else - error $E_BAD_DIR clean fi # Solaris only - We can't add this to meta since compver is usually created # during install @@ -867,14 +865,17 @@ generic_install() local dest="$stagedir" local destvar=DESTDIR local arg1=${1-'x'} + if [ "$arg1" != "x" ]; then destvar=$arg1 # $1 was defined fi if [ "$custom_install" -eq 0 ]; then clean stage - if [ "$shortroot" -eq 1 ]; then - dest="${stagedir}${prefix}" - ${__mkdir} -p "$dest" + [ "$shortroot" -eq 1 ] && dest="${stagedir}${prefix}" + # Create $dest if it is missing + if [ ! -d $dest ]; then + echo "Creating $dest" + ${__mkdir} -p $dest fi setdir ${srcdir}/${topsrcdir}/$2 ${__make} $destvar=$dest install