- Be more verbose in error messages Signed-off-by: Matt Darfeuille <matd...@gmail.com> --- build/release | 39 ++++++++++++++++++++++++++++----------- build/upload | 6 +++--- web/publish | 2 +- 3 files changed, 32 insertions(+), 15 deletions(-)
diff --git a/build/release b/build/release index a8aa76f3..7c24bfeb 100755 --- a/build/release +++ b/build/release @@ -112,10 +112,10 @@ check_working_tree() # $1 = path of repository if git --git-dir=${1}/.git --work-tree=${1} diff --quiet --cached; then return 0 else - fatal_error "Staging area not clean." + fatal_error "Staging area of \"$1/.git\" not clean." fi else - fatal_error "Working tree not clean." + fatal_error "Working tree of \"$1/.git\" not clean." fi } @@ -354,17 +354,34 @@ done cd $BUILD_DIR/$BASEVERSION -case $VERSION in - *[bB]ase*) - [ -f "$TOOLSDIR/build/upload" ] && $TOOLSDIR/build/upload $BASEVERSION - ;; - *) - [ -f "$TOOLSDIR/build/upload" ] && $TOOLSDIR/build/upload $VERSION - ;; -esac +if [ -f "$TOOLSDIR/build/upload" ]; then + case $VERSION in + *[bB]ase*) + echo "Uploading $BASEVERSION from ${PWD}..." + + $TOOLSDIR/build/upload $BASEVERSION + [ $? -ne 0 ] && fatal_error "Failed to upload $BASEVERSION from ${PWD}." + ;; + *) + echo "Uploading $VERSION from ${PWD}..." + + $TOOLSDIR/build/upload $VERSION + [ $? -ne 0 ] && fatal_error "Failed to upload $VERSION from ${PWD}." + ;; + esac +else + fatal_error "File \"$TOOLSDIR/build/upload\" does not exist." +fi cd $WEBDIR -[ -f "$WEBDIR/index.html" -a -f "$TOOLSDIR/web/publish" ] && $TOOLSDIR/web/publish index.html +if [ -f "$WEBDIR/index.html" -a -f "$TOOLSDIR/web/publish" ]; then + echo "Publishing index.html from ${PWD}..." + + $TOOLSDIR/web/publish index.html + [ $? -ne 0 ] && fatal_error "Failed to publish index.html from ${PWD}." +else + fatal_error "File \"$WEBDIR/index.html\" or \"$TOOLSDIR/web/publish\" does not exist." +fi cd $BUILD_DIR/$BASEVERSION diff --git a/build/upload b/build/upload index 22aecb8f..8786a2c5 100755 --- a/build/upload +++ b/build/upload @@ -248,7 +248,7 @@ for f in *-${1}.tar.bz2 *-${1}.tgz; do done if [ -n "$UPLOADCORE" -a -n "$corerpm" ]; then - base="shorewall-core-${1}.tar.*" && files="$files shorewall-core-${1}.* $corerpm $coresrpm" + base="shorewall-core-${1}.tar.*" && files="$files shorewall-core-${1}.* $corerpm $coresrpm" fi [ -n "$UPLOAD6" ] && base="$base shorewall6-${1}.tar.*" && files="$files shorewall6-${1}.* $rpm6 $srpm6" @@ -284,9 +284,9 @@ for f in ${1}.*sums; do /usr/bin/gpg -ab --batch --comment 'To verify this, you can download our public key at https://lists.shorewall.net/shorewall.gpg.key' $f done -[ -n "$BASE" ] && $COMMAND $base $DEST/base +[ -n "$BASE" ] && $COMMAND $base $DEST/base || exit $? -$COMMAND -r $files $DEST +$COMMAND -r $files $DEST || exit $? #if [ -n "$BASE" ]; then # do_manpages $shorewall-docs-html-${1}/manpages diff --git a/web/publish b/web/publish index 509d82f8..a10c97c9 100755 --- a/web/publish +++ b/web/publish @@ -185,7 +185,7 @@ if [ -n "$filestocopy" ]; then chmod 664 $filestocopy echo "$filestoreport -> $DEST" - scp -qp4 $filestocopy $DEST + scp -qp4 $filestocopy $DEST || exit $? # ssh ${DESTUSER}@${DESTHOST} chmod 744 $DESTDIR/*.htm* fi -- 2.17.0 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Shorewall-devel mailing list Shorewall-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/shorewall-devel