0

My svn propset command works when it is called from the prompt but does not work properly when called inside a while loop in a bash script.

my command looks like below,

svn propset -r945 --revprop svn:log '[Release ] [story]' blahReport.sh

and my script is below,

[[ ! -n $1 ]] && echo "Please enter the release number" && exit 1

[[ ! -e $AC_SYSTEM/releases/filesforrelease.$1.txt ]] && rm $AC_SYSTEM/releases/filesforrelease.$1.txt

cat $AC_SYSTEM/releases/release_$1.txt >> $AC_SYSTEM/releases/filesforrelease.$1.txt

sed "s/^/#/g" $AC_SYSTEM/releases/filesforrelease.$1.txt >> /tmp/filesforrelease.$1.txt

mv /tmp/filesforrelease.$1.txt $AC_SYSTEM/releases/filesforrelease.$1.txt

svnlink="http://sublime-ssi/blah/blah/trunk"

while read -r story

do

if [[ ! -e $story.file ]];

then

while read -r storyline

 do

        revNum=`echo $storyline | cut -d"|" -f1`

        fileName=`echo $storyline | cut -d"|" -f2`

        echo "$revNum ~ac/$fileName" >> $AC_SYSTEM/releases/filesforrelease.$1.txt

svn propset -r"$revNum" --revprop svn:log "[$1] [$story]" "$svnlink"/"$fileName"

        done<$AC_SYSTEM/stories/$story.file

else

echo "story file for $story does not exist..please check the story directory"

exit 1

fi

done</export/home/acdba/ac/releases/release_$1.txt

I've done a set -x on the script but it looks fine to me.

Not sure what am missing.. It might be something glaringly obvious to others, any suggestions?

ks1322
  • 33,961
  • 14
  • 109
  • 164
BVAD
  • 75
  • 2
  • 6
  • 1
    What error do you get? Can you run with set -vx and write the actual command that fails? – Eran Ben-Natan May 21 '12 at 12:00
  • the errir I get is authorization failed: Could not authenticate to server: rejected Basic challenge (http://sublime-ssi). this error occurs only when I run it in the script but not on the prompt. it fails at the propset. it ask for a password but on typing the password, it just fails and gives the authentication error – BVAD May 21 '12 at 13:20
  • 1
    I finally got this fixed by supplying username and password as parameters in the svn command. svn propset --username $USER --password $PASSWORD --revision "$OLD_VERSION" --revprop svn:log "$NEW_COMMENT" "$svnlink"/"$FILE" – BVAD Jul 02 '12 at 13:19

1 Answers1

0

Since feature requests to mark a comment as an answer remain declined, I copy the above solution here.

I finally got this fixed by supplying username and password as parameters in the svn command. svn propset --username $USER --password $PASSWORD --revision "$OLD_VERSION" --revprop svn:log "$NEW_COMMENT" "$svnlink"/"$FILE" – BratVaddi

Community
  • 1
  • 1
Armali
  • 18,255
  • 14
  • 57
  • 171