pkg.sh: Add support for -B upload_basurl and -A upload_file_attribs

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2016-12-03 12:47:18 +00:00
commit 71bfb3bccc

View file

@ -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