]> TLD Linux GIT Repositories - tld-builder.git/blobdiff - client/make-request.sh
- merged PLD changes, now it works with python 3.x
[tld-builder.git] / client / make-request.sh
index aebc5dd2736e13127ae0181e3f49ca075b4e8980..d83e7aca6c8a784652e00c2c8387c81380c5cfd2 100755 (executable)
@@ -118,7 +118,7 @@ try:
         req = urllib2.Request(url, data)
         f = urllib2.urlopen(req)
         f.close()
-except Exception, e:
+except Exception as e:
         print >> sys.stderr, "Problem while sending request via HTTP: %s: %s" % (url, e)
         sys.exit(1)
 print >> sys.stdout, "Request queued via HTTP."
@@ -130,7 +130,7 @@ print >> sys.stdout, "Request queued via HTTP."
 # htmlspecialchars: escape <, > and &
 hsc() {
        local input=$1
-       echo -E "$input" | sed -e 's,&,\&amp;,g;s,<,\&lt;,g;s,>,\&gt;,g'
+       printf "%s\n" "$input" | sed -e 's,&,\&amp;,g;s,<,\&lt;,g;s,>,\&gt;,g'
 }
 
 # simple df_fetcher, based on packages/fetchsrc_request
@@ -720,7 +720,7 @@ gen_req() {
 
        if [ "$command" ]; then
                bid=$(uuidgen)
-               echo -E >&2 "* Command: $command"
+               printf "%s\n" "* Command: $command" >&2
                echo "  <batch id='$bid' depends-on=''>"
                echo "           <command flags='$command_flags'>"
                hsc "$command"
@@ -787,7 +787,7 @@ gen_req() {
                if [ "$no_depend" = yes ]; then
                        depend=
                fi
-               echo -E >&2 "* Post-Command: $post_command"
+               printf "%s\n" "* Post-Command: $post_command" >&2
                echo "  <batch id='$bid' depends-on='$depend'>"
                echo "           <command flags='$command_flags'>"
                hsc "$post_command"