In a continuations of sorts from this thread which I consider to be solved; http://justlinux.com/forum/showthread.php?t=154079, like any script it must be tinkered with.
So I added a couple of more variables to be changed. Here is the most relevant part;
Code:
FILE_LIST=`ls -1 *.bz2`
SHA1SUM=`sha1sum -b $FILE_LIST | cut -d* -f1| cut -d" " -f1`
MODULE_NAME=`ls -1 *.bz2 | sed -e "s:-${OLD_VER}.tar.bz2::"`
DATE=`date -u +%Y%m%d`
for i in $MODULE_NAME
do
MODULE_LOCATION=`lvu where $i`
MODULE_PATH="/home/dveatch/moonbase.git/$MODULE_LOCATION"
sed -i "s:${OLD_VER}:${NEW_VER}:" $MODULE_PATH/$i/DETAILS
sed -i "s/UPDATED=[^=]*$/UPDATED=${DATE}/" $MODULE_PATH/$i/DETAILS
sed -i "s|SOURCE_VFY=sha1:[^:]*$|SOURCE_VFY=sha1:${SHA1SUM}|" $MODULE_PATH/$i/DETAILS
cd $L10N
MODULE_LOCATION=`lvu where $i`
MODULE_PATH="/home/dveatch/moonbase.git/$MODULE_LOCATION"
sed -i "s:${OLD_VER}:${NEW_VER}:" $MODULE_PATH/$i/DETAILS
sed -i "s/UPDATED=[^=]*$/UPDATED=${DATE}/" $MODULE_PATH/$i/DETAILS
sed -i "s/SOURCE_VFY=sha1:[^:]*$/SOURCE_VFY=sha1:${SHA1SUM}/" $MODULE_PATH/$i/DETAILS
done
The problem is with the SOURCE_VFY sed line. It works in that the correct sha1 sums get stuffed in the correct DETAILS file and all that. But after each sed of the SOURCE_VFY it throws this non-fatal error;
Code:
sed: -e expression #1, char 81: unterminated `s' command
For the life of me I cannot see the problem. It does the exact same thing as the UPDATED sed line (no errors shown) in that I'm using the same method to sed out after a certain character.
At first I thought it might be the SHA1SUM variable. It initially looked like this;
Code:
SHA1SUM=`sha1sum -b $FILE_LIST | cut -d* -f1`
When generating a sha1 it outputs like this;
Code:
78b25e93a8c70ccc1e0f117cce960fe4e1deb8d8 */var/spool/lunar/kdelibs-4.7.4.tar.bz2
Note there is a space between the last sha1 character and the asterisk. So I thought that space might be causing it but changing it to;
Code:
SHA1SUM=`sha1sum -b $FILE_LIST | cut -d* -f1| cut -d" " -f1`
had no effect. It seems odd if there really was an unterminated s command that it did not blow up.