diff --git a/scripts/pkg.sh b/scripts/pkg.sh index 9cecfd0c..e76cfd01 100644 --- a/scripts/pkg.sh +++ b/scripts/pkg.sh @@ -39,9 +39,10 @@ distro_info() /usr/bin/python3 $JWB_SCRIPT_DIR/jw-pkg.py distro info --format "$1" } -os() +get_os() { - /bin/bash $JWB_SCRIPT_DIR/get-os.sh + [ "$__get_os" ] || __get_os=`distro_info '%{id}-%{codename}'` + echo $__get_os } cfg_section() @@ -71,7 +72,7 @@ scm_commit() platform() { - echo `os`/$RPM_ARCH + echo `get_os`/$RPM_ARCH } abspath() @@ -440,7 +441,7 @@ build_pkg() local src_tree=$DIST_SRC_DIR/$src_base local tar_archive=$src_base.tar.bz2 local tar_archive_orig=$src_base.orig.tar.bz2 - local distribution=`os` + local distribution=`get_os` expand_version_macros() { echo $@ | sed "s/__NEXT_VERSION__/$version/g; s/VERSION-REVISION/$version/g; s/VERSION/$version/g" @@ -559,8 +560,8 @@ upload_file() "+ $DIST_PCKG_DIR/$f doesn't exist, can't upload" return 1 } - local os_name=`os | sed 's/-.*//'` - local os_version=`os | sed 's/[^-]\+-//'` + local os_name=`get_os | sed 's/-.*//'` + local os_version=`get_os | sed 's/[^-]\+-//'` local target_base=rsync_ssh://root@pkg.janware.com:/srv/dav/pub/packages/linux/$os_name/$os_version [ "$upload_urlbase" ] && target_base="$upload_urlbase" local upload_attrib=644:755:`id -un`.207 @@ -628,7 +629,7 @@ upload_pkg() hash = sha allow_unsigned_uploads = yes distributions = debian-8 - allowed_distributions = `os` + allowed_distributions = `get_os` delayed = run_lintian = no run_dinstall = no @@ -1139,6 +1140,8 @@ RPM_ARCH=$HOSTTYPE PKG_FORMAT=rpm SSH=ssh SCM=cvs +__get_os="" + [ "$RSYNC_RSH" ] && SSH=$RSYNC_RSH [ "$CVS_RSH" ] && SSH=$CVS_RSH [ -d .git ] && SCM=git