X-Git-Url: https://git.tld-linux.org/?p=tld-builder.git;a=blobdiff_plain;f=client%2Fmake-request.sh;fp=client%2Fmake-request.sh;h=d83e7aca6c8a784652e00c2c8387c81380c5cfd2;hp=aebc5dd2736e13127ae0181e3f49ca075b4e8980;hb=92949e17161a53bfb4a60099e22b58ad63abce4c;hpb=31722b4deb579cd93f6b41fee18980a715b275c2 diff --git a/client/make-request.sh b/client/make-request.sh index aebc5dd..d83e7ac 100755 --- a/client/make-request.sh +++ b/client/make-request.sh @@ -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,&,\&,g;s,<,\<,g;s,>,\>,g' + printf "%s\n" "$input" | sed -e 's,&,\&,g;s,<,\<,g;s,>,\>,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 " " echo " " 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 " " echo " " hsc "$post_command"