aboutsummaryrefslogtreecommitdiff
path: root/src/templatepkg
diff options
context:
space:
mode:
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2007-02-08 23:58:09 +0000
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2007-02-08 23:58:09 +0000
commitf7595585fae0e0844877ad111388837aaf74028b (patch)
treec8d1d2804b91b31afcc8a7df68396da3561dbdd3 /src/templatepkg
parent3a77360e6a7f41db20c126a6a91d46591b0390d0 (diff)
downloadsimplepkg-f7595585fae0e0844877ad111388837aaf74028b.tar.gz
simplepkg-f7595585fae0e0844877ad111388837aaf74028b.tar.bz2
changing template location procedures
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@163 04377dda-e619-0410-9926-eae83683ac58
Diffstat (limited to 'src/templatepkg')
-rwxr-xr-xsrc/templatepkg15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/templatepkg b/src/templatepkg
index 9c1f8bc..dc0323c 100755
--- a/src/templatepkg
+++ b/src/templatepkg
@@ -19,6 +19,7 @@
#
COMMON="/usr/libexec/simplepkg/common.sh"
+BASENAME="`basename $0`"
if [ -f "$COMMON" ]; then
source $COMMON
@@ -31,24 +32,26 @@ fi
APPEND="0"
if [[ ! -z "$3" && "$1" == "-a" ]]; then
ROOT="$3"
- TEMPLATE="$BASE_CONF/$2.template"
+ search_template $2 --new
APPEND="1"
elif [[ ! -z "$2" && "$1" == "-a" ]]; then
ROOT="/"
- TEMPLATE="$BASE_CONF/$2.template"
+ search_template $2 --new
APPEND="1"
elif [[ ! -z "$2" ]]; then
ROOT="$2"
- TEMPLATE="$BASE_CONF/$1.template"
+ search_template $1 --new
elif [[ ! -z "$1" ]]; then
- TEMPLATE="$BASE_CONF/$1.template"
+ search_template $1 --new
ROOT="/"
else
- echo "usage: `basename $0` [-a] <template> [root-dir]"
- echo -e "\t-a: append packages into <$BASE_CONF/template.template>"
+ echo "usage: $BASENAME [-a] <template> [root-dir]"
+ echo -e "\t-a: append packages into a template"
exit 1
fi
+TEMPLATE="$BASE_TEMPLATE.template"
+
if [ ! -d "$ROOT/var/log/packages" ]; then
echo $ROOT/var/log/packages: directory not found
exit 1