From 546354758b9a532912651b047fab6a23f0cb0a3c Mon Sep 17 00:00:00 2001 From: rhatto Date: Mon, 31 Jul 2006 20:54:39 +0000 Subject: initial import git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@1 04377dda-e619-0410-9926-eae83683ac58 --- templatepkg | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100755 templatepkg (limited to 'templatepkg') diff --git a/templatepkg b/templatepkg new file mode 100755 index 0000000..9c1f8bc --- /dev/null +++ b/templatepkg @@ -0,0 +1,90 @@ +#!/bin/bash +# +# templatepkg v0.2: create a simplepkg package list from +# a legacy slackware /var/log/packages +# +# feedback: rhatto at riseup.net | gpl +# +# Templatepkg is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or any later version. +# +# Templatepkg is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place - Suite 330, Boston, MA 02111-1307, USA +# + +COMMON="/usr/libexec/simplepkg/common.sh" + +if [ -f "$COMMON" ]; then + source $COMMON + eval_config `basename $0` +else + echo "error: file $COMMON found, check your `basename $0` installation" + exit 1 +fi + +APPEND="0" +if [[ ! -z "$3" && "$1" == "-a" ]]; then + ROOT="$3" + TEMPLATE="$BASE_CONF/$2.template" + APPEND="1" +elif [[ ! -z "$2" && "$1" == "-a" ]]; then + ROOT="/" + TEMPLATE="$BASE_CONF/$2.template" + APPEND="1" +elif [[ ! -z "$2" ]]; then + ROOT="$2" + TEMPLATE="$BASE_CONF/$1.template" +elif [[ ! -z "$1" ]]; then + TEMPLATE="$BASE_CONF/$1.template" + ROOT="/" +else + echo "usage: `basename $0` [-a]