Package: gforge-db-postgresql
Version: 4.5.14-22
When using a password (typed in through debconf prompt) that contains a
"/" character, following error appears:
Bareword found where operator expected at -e line 1, near
"s/^admin_password=.*/admin_password=testing/password"
syntax error at -e line 1, near
"s/^admin_password=.*/admin_password=testing/password"
Execution of -e aborted due to compilation errors.
dpkg: error processing gforge-db-postgresql (--configure):
subprocess post-installation script returned error exit status 255
The error message comes from line 129 in gforge-db-postgresql.config file:
124 update_onevar_mainconffile () {
125 key=$1
126 val=$2
127 if grep -q "^$key=" $mainconffile ; then
128 newval=$(echo $val | sed -e 's/@/\\@/g' -e 's/\$/\\$/g')
129 perl -pi -e "s/^$key=.*/$key=$newval/" $mainconffile
130 else
131 echo "$key=$val" >> $mainconffile
132 fi
133 }
I think a possible fix is to replace the line 128 with:
newval=$(echo $val | sed -e 's/@/\\@/g' -e 's/\$/\\$/g' -e 's/\//\\\//g' )
A patch with this change is attached.
Regards,
Balazs Kutil
--- gforge-db-postgresql.config 2007-04-22 20:50:13.000000000 +0200
+++ gforge-db-postgresql.config.new 2007-04-22 21:17:25.000000000 +0200
@@ -125,7 +125,7 @@
key=$1
val=$2
if grep -q "^$key=" $mainconffile ; then
- newval=$(echo $val | sed -e 's/@/\\@/g' -e 's/\$/\\$/g')
+ newval=$(echo $val | sed -e 's/@/\\@/g' -e 's/\$/\\$/g' -e 's/\//\\\//g')
perl -pi -e "s/^$key=.*/$key=$newval/" $mainconffile
else
echo "$key=$val" >> $mainconffile