pkg.sh: Replace get-os.sh by pkg.py distro info

Remove get-os.sh from pkg.sh to reduce redunancy.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-03-02 09:41:05 +01:00
commit 2f157db18d

View file

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