Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/contrib/rankmirrors.sh.in
diff options
context:
space:
mode:
authorAaron Lindsay <aaron@aclindsay.com>2013-09-05 14:46:29 -0400
committerAllan McRae <allan@archlinux.org>2013-09-18 14:28:03 +1000
commit3f99cfba1b6ef1c5665488b651a3d6409730fa98 (patch)
tree453c75070ae7b3b2a4b095bdc50c340819084aa6 /contrib/rankmirrors.sh.in
parent93888089643b017390538d1f6f3a2d2aa9918851 (diff)
contrib: Unify quoting in error messages
This fixes error messages to display the contents of variables rather than the variable name by replacing backticks with single quotes (m4 eats backticks). It also removes $"" localization from error messages to eliminate security holes. For instance, `rankmirrors nonexistent_file' will now display: 'nonexistent_file' does not exist. rather than: $1 does not exist. Signed-off-by: Aaron Lindsay <aaron@aclindsay.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'contrib/rankmirrors.sh.in')
-rw-r--r--contrib/rankmirrors.sh.in10
1 files changed, 5 insertions, 5 deletions
diff --git a/contrib/rankmirrors.sh.in b/contrib/rankmirrors.sh.in
index 875a1439..5555edf9 100644
--- a/contrib/rankmirrors.sh.in
+++ b/contrib/rankmirrors.sh.in
@@ -127,7 +127,7 @@ while [[ $1 ]]; do
verbose) VERBOSE=1 ; shift ;;
url) CHECKURL=1; [[ $2 ]] || err "Must specify url."; URL="$2"; shift 2;;
repo) [[ $2 ]] || err "Must specify repo name."; TARGETREPO="$2"; shift 2;;
- *) err "\`$1' is an invalid argument."
+ *) err "'$1' is an invalid argument."
esac
elif [[ ${1:0:1} = - ]]; then
@@ -146,7 +146,7 @@ while [[ $1 ]]; do
u) CHECKURL=1; [[ $2 ]] || err "Must specify url."; URL="$2"; snum=2;;
r) [[ $2 ]] || err "Must specify repo name."; TARGETREPO="$2"; snum=2;;
n) [[ $2 ]] || err "Must specify number." ; NUM="$2" ; snum=2;;
- *) err "\`-$1' is an invald argument." ;;
+ *) err "'$1' is an invalid argument." ;;
esac
done
shift $snum
@@ -157,7 +157,7 @@ while [[ $1 ]]; do
[[ $linearray ]] || err "File is empty."
shift
else
- err "\`$1' does not exist."
+ err "'$1' does not exist."
fi
done
@@ -169,7 +169,7 @@ done
# Single url handling
if [[ $CHECKURL ]]; then
url="$(getfetchurl "$URL")"
- [[ $url = fail ]] && err "url \`$URL' is malformed."
+ [[ $url = fail ]] && err "url '$URL' is malformed."
[[ $VERBOSE ]] && echo "Testing $url..."
time=$(gettime "$url")
echo "$URL : $time"
@@ -193,7 +193,7 @@ for line in "${linearray[@]}"; do
server="${line#*= }"
server="${server%%#*}"
url="$(getfetchurl "$server")"
- [[ $url = fail ]] && err "url \`$URL' is malformed."
+ [[ $url = fail ]] && err "url '$URL' is malformed."
time=$(gettime "$url")
timesarray+=("$time $server")