aboutsummaryrefslogtreecommitdiff
path: root/trunk/src/templatepkg
diff options
context:
space:
mode:
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2007-04-06 01:00:12 +0000
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2007-04-06 01:00:12 +0000
commitd2209645ba26fc154b91c22def5d64519abf2c5a (patch)
tree392dadd7d52cc0bd8eef828e7e1a2bffe5e3dd8f /trunk/src/templatepkg
parentebd8d771f28310be1f4e77ce02dd657017e9b337 (diff)
downloadsimplepkg-d2209645ba26fc154b91c22def5d64519abf2c5a.tar.gz
simplepkg-d2209645ba26fc154b91c22def5d64519abf2c5a.tar.bz2
templatepkg: --list improved
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@274 04377dda-e619-0410-9926-eae83683ac58
Diffstat (limited to 'trunk/src/templatepkg')
-rwxr-xr-xtrunk/src/templatepkg44
1 files changed, 33 insertions, 11 deletions
diff --git a/trunk/src/templatepkg b/trunk/src/templatepkg
index 3b5c283..4521fef 100755
--- a/trunk/src/templatepkg
+++ b/trunk/src/templatepkg
@@ -526,20 +526,42 @@ function template_list {
# list templates
# usage: template_list [template_name]
- local list
+ local list basedir template
- # TODO: checar se ha /
+ if echo $1 | grep -q "/"; then
- list="`ls $BASE_CONF/defaults/templates/$1 2> /dev/null`"
- if [ "$?" == "0" ]; then
- list="`echo $list | xargs`"
- echo "Default templates: $list"
- fi
+ template="`echo $1 | cut -d "/" -f 1`"
+
+ if [ -e "$BASE_CONF/defaults/templates/$1" ]; then
+ list="`ls $BASE_CONF/defaults/templates/$1 2> /dev/null`"
+ if [ "$?" == "0" ]; then
+ list="`echo $list | xargs`"
+ echo "In the default template $template: $list"
+ fi
+ fi
+
+ if [ -e "$BASE_CONF/templates/$1" ]; then
+ list="`ls $BASE_CONF/templates/$1 2> /dev/null`"
+ if [ "$?" == "0" ]; then
+ list="`echo $list | xargs`"
+ echo "In the custom template $template: $list"
+ fi
+ fi
+
+ else
+
+ list="`ls $BASE_CONF/defaults/templates/$1 2> /dev/null`"
+ if [ "$?" == "0" ]; then
+ list="`echo $list | xargs`"
+ echo "Default templates: $list"
+ fi
+
+ list="`ls $BASE_CONF/templates/$1 2> /dev/null`"
+ if [ "$?" == "0" ]; then
+ list="`echo $list | xargs`"
+ echo "Custom templates: $list"
+ fi
- list="`ls $BASE_CONF/templates/$1 2> /dev/null`"
- if [ "$?" == "0" ]; then
- list="`echo $list | xargs`"
- echo "Custom templates: $list"
fi
}