From 71bfb3bccc518c2ce0205713d14eb64cdd043033 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Sat, 3 Dec 2016 12:47:18 +0000 Subject: [PATCH] pkg.sh: Add support for -B upload_basurl and -A upload_file_attribs Signed-off-by: Jan Lindemann --- scripts/pkg.sh | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/scripts/pkg.sh b/scripts/pkg.sh index 90039afb..85f94bb5 100644 --- a/scripts/pkg.sh +++ b/scripts/pkg.sh @@ -488,25 +488,24 @@ build_pkg() upload_file() { - local f=$1 - local t=$2 - local upload_spec=644:755:`id -un`.207 - if [ ! -f $DIST_PCKG_DIR/$f ]; then - echo "+ $DIST_PCKG_DIR/$f doesn't exit, skipping" >&2 - return 1 - fi + local f="$1" + local t="$2" + [ -f $DIST_PCKG_DIR/$f ] || fatal "+ $DIST_PCKG_DIR/$f doesn't exit, can't upload" local os_name=`os | sed 's/-.*//'` local os_version=`os | sed 's/[^-]\+-//'` + local target_base=rsync_ssh://root@ftp.jannet.de:/srv/ftp/pub/packages/linux/$os_name/$os_version/inst-source + [ "$upload_urlbase" ] && target_base="$upload_urlbase" + local upload_attrib=644:755:`id -un`.207 + [ "$upload_file_attrib" ] && upload_attrib="$upload_file_attrib" - local target_base=rsync_ssh://root@ftp.jannet.de:/srv/ftp/pub/packages/linux/$os_name/$os_version - local target + local target if [ "$t" = tgz ]; then - target=$target_base/inst-source/$t/$f:$upload_spec + target=$target_base/$t/$f:$upload_attrib else - target=$target_base/inst-source/rpm/$t/$f:$upload_spec + target=$target_base/rpm/$t/$f:$upload_attrib fi echo "+ uploading $target" - sh $MOD_SCRIPT_DIR/upload.sh $DIST_PCKG_DIR/$f $target + /bin/bash $MOD_SCRIPT_DIR/upload.sh $DIST_PCKG_DIR/$f $target } upload_pkg() @@ -873,6 +872,7 @@ MOD_SCRIPT_DIR=`dirname $0` CHECK_CVS_SYNC_BEFORE_RPM_RELEASE=false #LAST_RPM_VERSION=`read_map $TOPDIR/LAST_RPM_VERSION` myname=`basename $0` +cmdline="$0 $@" tmp_mkdef_sh="" PROJECT_DESCR_FILE=$TOPDIR/make/project.conf DIST_SRC_DIR=dist/src @@ -891,7 +891,7 @@ SCM=cvs [ -d .git ] && SCM=git -opts='ht:p:m:N:R:D:P:a:F:' +opts='ht:p:m:N:R:D:P:a:F:B:A:' args=("$@") while [ "$1" ]; do [ ${#1} = 2 -a ${1:0:1} = - ] && echo $opts | grep -q "${1:1}" && { @@ -946,6 +946,14 @@ while [ "$1" != -- ] ; do eval PKG_FORMAT=\"$2\" shift ;; + -B) + eval upload_urlbase=\"$2\" + shift + ;; + -A) + eval upload_file_attrib=\"$2\" + shift + ;; esac shift done