aboutsummaryrefslogtreecommitdiff
path: root/trunk/src/templatepkg
diff options
context:
space:
mode:
Diffstat (limited to 'trunk/src/templatepkg')
-rwxr-xr-xtrunk/src/templatepkg6
1 files changed, 3 insertions, 3 deletions
diff --git a/trunk/src/templatepkg b/trunk/src/templatepkg
index c9771b7..8faab89 100755
--- a/trunk/src/templatepkg
+++ b/trunk/src/templatepkg
@@ -147,7 +147,7 @@ function template_update {
for package in `ls -1 $ROOT/var/log/packages/`; do
pack=`package_name $package`
if [ -f $TEMPLATE ]; then
- if ! `grep -v -e "^#" $TEMPLATE | cut -d : -f 1 | grep -q -e "^$pack\$"`; then
+ if ! `grep -v -e "^#" $TEMPLATE | cut -d : -f 1 | awk '{ print $1 }' | grep -q -e "^$pack\$"`; then
echo $pack >> $TEMPLATE
echo Added $pack on $TEMPLATE
fi
@@ -158,7 +158,7 @@ function template_update {
done
# check if each package from the template is installed
- grep -v -e "^#" $TEMPLATE | cut -d : -f 1 | while read pack; do
+ grep -v -e "^#" $TEMPLATE | cut -d : -f 1 | awk '{ print $1 }' | while read pack; do
if [ ! -z "$pack" ]; then
unset found
@@ -171,7 +171,7 @@ function template_update {
done
if [ "$found" != "1" ]; then
# remove a non-installed package from the template
- sed "/^$pack$/d" $TEMPLATE | sed "/^$pack $/d" | sed "/^$pack:*/d" > $TEMPLATE.tmp
+ sed "/^$pack$/d" $TEMPLATE | sed "/^$pack $/d" | sed "/^$pack:*/d" | sed "/^$pack */d" > $TEMPLATE.tmp
cat $TEMPLATE.tmp > $TEMPLATE
rm -f $TEMPLATE.tmp
echo Removed $pack from $TEMPLATE