aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2007-04-04 15:15:34 +0000
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2007-04-04 15:15:34 +0000
commit553614ea8a645029c61c80451d0def53bcf0a339 (patch)
treeb28bc0d14eb16bb1f2d8ce811a3709eaf0cba6a0
parentd5936c8ff0c14aa8d45dec8914be9ce19dd41ee3 (diff)
downloadsimplepkg-553614ea8a645029c61c80451d0def53bcf0a339.tar.gz
simplepkg-553614ea8a645029c61c80451d0def53bcf0a339.tar.bz2
templatepkg: added function slash
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@228 04377dda-e619-0410-9926-eae83683ac58
-rwxr-xr-xtrunk/src/templatepkg25
1 files changed, 16 insertions, 9 deletions
diff --git a/trunk/src/templatepkg b/trunk/src/templatepkg
index 0451dde..b1a7611 100755
--- a/trunk/src/templatepkg
+++ b/trunk/src/templatepkg
@@ -287,7 +287,7 @@ function template_add {
if [ -a "$TEMPLATE_BASE.d/$file" ]; then
if [ -d "$TEMPLATE_BASE.d/$file" ]; then
- echo $BASENAME: folder $file already on $TEMPLATE_BASE.d, checking for contents
+ echo $BASENAME: folder `slash $file` already on $TEMPLATE_BASE.d, checking for contents
cd $jail
for candidate in `find $file`; do
@@ -299,22 +299,22 @@ function template_add {
cd $TEMPLATE_BASE.d
svn add ./$candidate
if [ "$?" != "0" ]; then
- echo $BASENAME: error adding `echo $candidate | sed -e 's/\/\+/\//g'` into the revision system
+ echo $BASENAME: error adding `slash $candidate` into the revision system
fi
cd $cwd
info_commit="yes"
else
- echo Added `echo $jail/$candidate | sed -e 's/\/\+/\//g'` on $TEMPLATE_BASE.d/$candidate
+ echo Added `slash $jail/$candidate` on $TEMPLATE_BASE.d/$candidate
fi
fi
done
if [ "$info_commit" == "yes" ]; then
- echo $BASENAME: please run jail-commit to add files under `echo $file | sed -e 's/\/\+/\//g'` into the svn repository
+ echo $BASENAME: please run jail-commit to add files under `slash $file` into the svn repository
fi
else
- echo $BASENAME: file `echo $file | sed -e 's/\/\+/\//g'` already on $TEMPLATE_BASE.d
+ echo $BASENAME: file `slash $file` already on $TEMPLATE_BASE.d
exit 1
fi
else
@@ -328,17 +328,17 @@ function template_add {
cd $TEMPLATE_BASE.d
svn add ./$file
if [ "$?" != "0" ]; then
- echo $BASENAME: error adding `echo $candidate | sed -e 's/\/\+/\//g'` into the revision system
+ echo $BASENAME: error adding `slash $candidate` into the revision system
fi
cd $cwd
- echo $BASENAME: please run jail-commit to add `echo $file | sed -e 's/\/\+*/\//g'` into the svn repository
+ echo $BASENAME: please run jail-commit to add `slash $file` into the svn repository
true
else
- echo Added `echo $jail/$file | sed -e 's/\/\+*/\//g'` on $destination
+ echo Added `slash $jail/$file` on $destination
fi
else
- echo $BASENAME: `echo $jail/$file | sed -e 's/\/\+/\//g'`: file not found
+ echo $BASENAME: `slash $jail/$file`: file not found
exit 1
fi
fi
@@ -358,6 +358,13 @@ function setroot {
}
+function slash {
+
+ # remove additional slashes
+ echo $1 | sed -e 's/\/\+/\//g'
+
+}
+
# command line parsing
if [ -z "$2" ]; then