From c6d3868b8b4c2e8b15aac98bd9fd8b2de4756065 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Mon, 12 Oct 2009 22:30:56 +0200 Subject: [PATCH] shutils: remove tmpl_func.sh, moved to the xbps-templates repo. xbps-src: added XBPS_COMMONVARSDIR that sources all .sh files in setup_tmpl(), this replaces tmpl_funcs.sh. --HG-- extra : convert_revision : xtraeme%40gmail.com-20091012203056-rtay2drhrwak4ldk --- bin/xbps-src/main.sh | 7 ++++--- shutils/tmpl_funcs.sh | 8 +++++++- shutils/tmpl_vars.sh | 12 ------------ 3 files changed, 11 insertions(+), 16 deletions(-) delete mode 100644 shutils/tmpl_vars.sh diff --git a/bin/xbps-src/main.sh b/bin/xbps-src/main.sh index b7c629a6..bae4d28e 100755 --- a/bin/xbps-src/main.sh +++ b/bin/xbps-src/main.sh @@ -94,14 +94,15 @@ set_defvars() : ${XBPS_TEMPLATESDIR:=$XBPS_DISTRIBUTIONDIR/templates} : ${XBPS_TRIGGERSDIR:=$XBPS_DISTRIBUTIONDIR/triggers} - : ${XBPS_HELPERSDIR:=$XBPS_TEMPLATESDIR/helpers} + : ${XBPS_HELPERSDIR:=$XBPS_DISTRIBUTIONDIR/helpers} + : ${XBPS_COMMONVARSDIR:=$XBPS_DISTRIBUTIONDIR/common} : ${XBPS_DBDIR:=$XBPS_MASTERDIR/var/db/xbps} : ${XBPS_META_PATH:=$XBPS_DBDIR/} : ${XBPS_PKGMETADIR:=$XBPS_DBDIR/metadata} : ${XBPS_SHUTILSDIR:=@@XBPS_INSTALL_SHAREDIR@@} - DDIRS="XBPS_TEMPLATESDIR XBPS_TRIGGERSDIR" - DDIRS="$DDIRS XBPS_HELPERSDIR XBPS_SHUTILSDIR" + DDIRS="XBPS_TEMPLATESDIR XBPS_TRIGGERSDIR XBPS_HELPERSDIR" + DDIRS="$DDIRS XBPS_COMMONVARSDIR XBPS_SHUTILSDIR" for i in ${DDIRS}; do eval val="\$$i" [ ! -d "$val" ] && msg_error "cannot find $i, aborting." diff --git a/shutils/tmpl_funcs.sh b/shutils/tmpl_funcs.sh index b8f4dd01..d83a3c92 100644 --- a/shutils/tmpl_funcs.sh +++ b/shutils/tmpl_funcs.sh @@ -30,6 +30,10 @@ info_tmpl() { local i= + for f in $(echo $XBPS_COMMONVARSDIR/*.sh); do + [ -r ${f} ] && . ${f} + done + echo "pkgname: $pkgname" echo "version: $version" [ -n "$revision" ] && echo "revision: $revision" @@ -95,7 +99,9 @@ setup_tmpl() [ -z "$pkg" ] && msg_error "missing package name after target." - . $XBPS_SHUTILSDIR/tmpl_vars.sh + for f in $(echo $XBPS_COMMONVARSDIR/*.sh); do + [ -r ${f} ] && . ${f} + done if [ -f "$XBPS_TEMPLATESDIR/$pkg/template" ]; then if [ "$pkgname" != "$pkg" ]; then diff --git a/shutils/tmpl_vars.sh b/shutils/tmpl_vars.sh deleted file mode 100644 index 3c51751a..00000000 --- a/shutils/tmpl_vars.sh +++ /dev/null @@ -1,12 +0,0 @@ -# -# Common vars that can be used by templates. -# - -SOURCEFORGE_SITE="http://downloads.sourceforge.net/sourceforge" -NONGNU_SITE="http://download.savannah.nongnu.org/releases" -UBUNTU_SITE="http://archive.ubuntu.com/ubuntu/pool" -XORG_SITE="http://xorg.freedesktop.org/releases/individual" -DEBIAN_SITE="http://ftp.debian.org/debian/pool" -GNOME_SITE="http://ftp.gnome.org/pub/GNOME/sources" -KERNEL_SITE="http://www.kernel.org/pub/linux" -CPAN_SITE="http://cpan.perl.org/modules/by-module"