Codebase list debian-goodies / 1a761c9
Use the same code (for loop) introduced in commit d6dcb0fc15f340b581c2cf138a1cb02055410090 to solve #861522 Javier Fernandez-Sanguino 6 years ago
1 changed file(s) with 17 addition(s) and 14 deletion(s). Raw diff Collapse all Expand all
+17
-14
dman less more
110110 trap "rm -rf $mandir" EXIT HUP INT QUIT TERM
111111 man="$mandir/$PAGE"
112112
113 # Try first with user's locale
114 URL="$BASE_URL/$DISTRIB_CODENAME/$PAGE$LOCDOT.gz"
113 TESTED_URLS=""
114 # be careful not to add too many entries in this loop, as each hit can
115 # take some time for the rountrip
116 for URL in "$BASE_URL/$DISTRIB_CODENAME/$PAGE$LOCDOT.gz" \
117 "$BASE_URL/$DISTRIB_CODENAME/$PAGE.en.gz" \
118 "$BASE_URL/$DISTRIB_CODENAME/$PAGE.gz" \
119 "$BASE_URL/$PAGE$LOCDOT.gz" \
120 "$BASE_URL/$PAGE.en.gz" \
121 "$BASE_URL/$PAGE.gz" \
115122
116 if download_man $URL $man; then
117 man $MAN_ARGS -l "$man" || true
118 exit 0
119 fi
120
121 TESTED_URLS="$URL" # Continue in case of failure, take note of tested URL
122
123 if [ ! -z "$LOCALE" ]; then
124 # Try now the English version
125 URL="$BASE_URL/$DISTRIB_CODENAME/$PAGE.en.gz"
123 do
126124 if download_man $URL $man; then
127125 man $MAN_ARGS -l "$man" || true
128126 exit 0
129127 fi
130 TESTED_URLS="$TESTED_URLS, $URL"
131 fi
128 # Continue in case of failure, take note of tested URL
129 if [ -z "$TESTED_URLS" ] ; then
130 TESTED_URLS="$URL"
131 else
132 TESTED_URLS="$TESTED_URLS, $URL"
133 fi
134 done
132135
133136 echo "$0: not found. Tried: $TESTED_URLS" 1>&1
134137 exit 1