3 # --- T2-COPYRIGHT-NOTE-BEGIN ---
4 # T2 SDE: scripts/Download
5 # Copyright (C) 2004 - 2024 The T2 SDE Project
6 # Copyright (C) 1998 - 2003 ROCK Linux Project
8 # This Copyright note is generated by scripts/Create-CopyPatch,
9 # more information can be found in the files COPYING and README.
11 # This program is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License version 2.
13 # --- T2-COPYRIGHT-NOTE-END ---
15 # Run this command from the T2 directory as scripts/Download [ options ]
17 # It enables you to download source files as described in the package
18 # definitions (optionally using a mirroring 'cache' server).
20 # This script also allows for checksum display/validation.
24 .
scripts
/functions.
in
25 . misc
/output
/parse-config
27 eval "$(egrep '^(sdever)=' scripts/parse-config)"
30 if [ "$1" = '--help' ]; then
34 echo " scripts/Download [options] [ Package(s) ]"
35 echo " scripts/Download [options] [ Desc file(s) ]"
36 echo " scripts/Download [options] -repository Repositories"
37 echo " scripts/Download [options] { -all | -required }"
39 echo " Where [options] is an alias for:"
40 echo " [ -cfg <config> ] [ -nock ] [ -alt-dir <AlternativeDirectory> ]"
41 echo " [ -mirror <URL> | -check ] [ -try-questionable ] [ -notimeout ]"
42 echo " [ -longtimeout ] [ -curl-opt <curl-option>[:<curl-option>[:..]] ]"
43 echo " [ -proxy <server>[:<port>] ] [ -proxy-auth <username>[:<password>] ]"
44 echo " [ -copy ] [ -move ]"
46 echo " On default, this script auto-detects the best T2 SDE mirror."
48 echo " Mirrors can also be a local directories in the form of: 'file:///<dir>'"
50 echo " scripts/Download -mk-cksum Filename(s)"
51 echo " scripts/Download [ -list | -list-unknown | -list-missing | -list-cksums ]"
56 # -mk-cksum mode (display T2 type package checksum): it
57 # displays the checksum T2 validates against.
59 # Commonly known compressed tarballs unpacked.
61 if [ "$1" = -mk-cksum ]; then
68 if ! type -p $cksum > /dev
/null
; then
69 cksum=${cksum#sha} cksum=${cksum%sum}
70 cksum="shasum -a $cksum"
73 compressor
="$(get_compressor "$x")"
74 if [ ! -f "$x" ]; then
76 elif [ "$compressor" ]; then
77 $compressor < "$x" |
$cksum | cut
-f1 -d' '
79 $cksum < "$x" | cut
-f1 -d' '
85 # Handle options passed on the command line
87 mkdir
-p src
/ download
/; config
=default
89 mirror
='' checkonly
=0 altdir
=''
90 tryques
=0 nocheck
=0 options
='-this_is_the_2nd_run '
91 notimeout
=0 curl_options
='-A T2-downloader --disable-epsv --location -f'
92 altcopy
=link verbose
=1 quietmirror
=0
95 # load options from the enviroment T2DOWNOPT
96 # and then clean it to avoid duplication on children processes
98 set -- $T2DOWNOPT "$@"
102 while [ $# -gt 0 ]; do
104 -this_is_the_2nd_run)
105 this_is_the_2nd_run
=1
109 options
="$options -cfg $2"
110 config
="$2"; shift ;;
113 options
="$options -q"
117 # -nock skips checksum checking (don't use lightly)
118 options
="$options -nock"
122 # -mirror uses a mirror for finding source files
123 if [ "$2" = auto
]; then
124 rm -f download
/Mirror-Cache
127 echo "$2 $sdever" > download
/Mirror-Cache
128 options
="$options -mirror $2"
137 # -check just validates the file using the checksum
138 options
="$options -check"
142 # don't add timeout curl options
143 options
="$options -notimeout"
147 # don't add timeout curl options
148 options
="$options -longtimeout"
152 # additional curl options
153 options
="$options -curl-opt $2"
154 curl_options
="$curl_options `echo $2 | tr : ' '`"
158 # proxy option for curl
160 echo -n "$2" > download
/Proxy
161 options
="$options -proxy $2"
165 # proxy authentication for curl - can be seen with ps!
167 echo -n "$2" > download
/Proxy-auth
168 chmod 600 download
/Proxy-auth
169 options
="$options -proxy-auth $2"
173 # check for an alternative directory where to search for
174 # package source tarballs
175 altdir
=$
(cd $2; pwd -P)
176 options
="$options -alt-dir $2"
180 # also try to download questionable URLs
181 options
="$options -try-questionable"
184 -move) altcopy
=move
;;
185 -copy) altcopy
=copy
;;
192 # Read some config values
194 target
=`grep '^export SDECFG_TARGET=' config/$config/config 2>/dev/null |
195 cut -f2 -d= | tr -d "'"`
196 arch
=`grep '^export SDECFG_ARCH=' config/$config/config 2>/dev/null |
197 cut -f2 -d= | tr -d "'"`
198 arch
="${arch:-none}" target
="${target:-none}"
201 if [ $notimeout -eq 0 ]; then
202 curl_options
="$curl_options -y 20 -Y 10 --connect-timeout 60"
203 elif [ $notimeout -eq 1 ]; then
204 curl_options
="$curl_options -y 60 -Y 1 --connect-timeout 300"
207 # Disable checking for certificates on https downloads
208 curl_options
="$curl_options -k"
210 # cksum_chk filename cksum origfile
212 # This function verifies the checksum. If it fails it renames the file
213 # to file.chksum-err and returns failure.
215 # It seams like the [ ] command has problems with comparing high numbers.
216 # That's why I'm using a text comparison here.
218 # Not doing anything if checksum is '0' or a text of 'X'.
222 [ $nocheck = 1 -o -z "${2//0/}" -o -z "${2//X/}" ] && return 0
224 # determine cksum type
226 if [ "$ck" != "$y" ]; then
228 else case "${#ck}" in
236 if ! type -p $cksum > /dev
/null
; then
237 cksum=${cksum#sha} cksum=${cksum%sum}
238 cksum="shasum -a $cksum"
241 local x
="`$cksum "$1" | cut -f1 -d' '`"
242 if [ "$x" != "$y" ]; then
243 # Add .cksum-err extension to filename:
244 echo "Cksum ERROR: $3.cksum-err ($x)"
245 mv "$3" "$3.cksum-err"; return 1
250 # output (multiline) message only if we are not in quiet mode
253 if [ "$verbose" == 1 ]; then
254 echo "$@" |
sed -e 's,^,INFO: ,'
258 # output (multiline) message always
261 echo "$@" |
sed -e 's,^,INFO: ,'
264 # Autodetect best Mirror and safe url in $mirror
268 if [ -f download
/Mirror-Cache
]; then
269 read mirror mirrorver
< download
/Mirror-Cache
270 mirror
=${mirror:-none}
271 if [ "$mirror" = "none" ]; then
272 [ "$quietmirror" != 1 ] &&
274 " "Found download/Mirror-Cache: none (using original download locations)"
276 elif [ "$mirrorver" != "$sdever" -a "$mirrorver" != "any" ]; then
277 echo_warn
"Cached mirror URL in download/Mirror-Cache is outdated."
279 [ "$quietmirror" != 1 ] && var_append info
"
280 " "Found cached mirror: $mirror"
284 echo_warn
"Auto-detecting best mirror:"
286 echo_warn
"Downloading mirror-list from: t2sde.org"
287 curl
-s -S $curl_options -o src
/Download-Mirror-List \
288 "https://t2sde.org/cgi-bin/t2-mirrors.cgi?$sdever"
290 bestval
=0 result
='No Mirror Found!'
291 me
=$
([ -s download
/Me
] && cat download
/Me
)
292 while read mirror_name
; do
293 if [ "${mirror_name#=}" != "$mirror_name" ]; then
294 mirror_name
="${mirror_name#= }"
295 mirror_name
="${mirror_name% =}"
298 case "$mirror_name" in ($me) continue ;; esac
300 echo -n "INFO: Testing <$mirror_name> ..."
301 val
="$(curl -s $curl_options -m 20 "${mirror_url%/}/DOWNTEST
" \
302 -w "ok
%{speed_download
}" -o /dev/null)"
303 if [ "$val" = "${val#ok }" -o "$val" = "ok 0.000" ]; then
306 xval
=`echo ${val#ok } | tr -d .,`; echo " $val B/s"
307 if [ "$xval" -gt "$bestval" ]; then
308 bestval
=$xval mirror
="${mirror_url%/}"
309 result
="Saving mirror $mirror (src/Mirror-Cache)"
314 done < src
/Download-Mirror-List
315 echo "$mirror $sdever" > download
/Mirror-Cache
319 # download_file local-filename download-location cksum repo pkg
321 # This function decides if download directly or from a mirror,
322 # validates checksum, etc.
323 # Calls download_file_now to do the actual download.
328 local gzfile
="$1" location
="$2" cksum="$3" repo
="$4" pkg
="$5"
329 # Make src directory for creating tar balls
331 # Remove optional '-' prefix from $location
332 [ "${location:0:1}" == '-' ] && location
="${location:1}"
334 lkfile
="src/down.lockfile.`echo $gzfile | tr / -`"
336 # Check if it's already there
338 [ -s "$gzfile" -a $checkonly != 1 ] && return 0
342 if [ -s "$lkfile" ]; then
343 echo "Found $lkfile -> skip download."
346 trap 'local ret=$?; rm -f "$lkfile"; return $ret' INT
349 # Check if we only like to test the cksum(s)
351 if [ $checkonly = 1 ]; then
352 if [ ! -f "$gzfile" ]; then
353 echo "File missing: $gzfile"
354 rm -f "$lkfile"; trap INT
; downloaderror
=1; return
356 if [ -z "${cksum##X*}" ]; then
357 echo "No checksum (ignore): $gzfile"
358 rm -f "$lkfile"; trap INT
; return
360 if [ "$cksum" = 0 ]; then
361 echo "No checksum (missing): $gzfile"
362 rm -f "$lkfile"; trap INT
; return
365 elif [ -s "$gzfile" ]; then
366 echo; echo "Already downloaded: $pkg:$gzfile"
369 [ "$info" ] && echo_info
"$info" && info
=
370 echo; echo "Downloading $pkg:$gzfile"
372 # Existing *.cksum-err
374 if [ -s "$gzfile.cksum-err" ]; then
375 # cksum-err file alread exists:
376 echo "ERROR: found: $gzfile.cksum-err"
377 echo "ERROR: That means that we downloaded the" \
378 "file already and it had an"
379 echo "ERROR: incorrect checksum. Remove the" \
380 "*.cksum-err file to force a"
381 echo "ERROR: new download of that file."
382 rm -f "$lkfile"; trap INT
; downloaderror
=1; return 1
385 # Existing *.extck-err
387 if [ -s "$gzfile.extck-err" ]; then
388 # extck-err file alread exists:
389 echo "ERROR: found: $gzfile.extck-err"
390 echo "ERROR: That means that we downloaded the" \
391 "file already and it's content"
392 echo "ERROR: did not match it's filename extension." \
393 "Remove the *.extck-err file"
394 echo "ERROR: to force a new download of that file."
395 rm -f "$lkfile"; trap INT
; downloaderror
=1; return 1
400 if [ "$location" != "${location#\?}" ]; then
401 if [ "$tryques" = 0 ]; then
402 echo "ERROR: URL is marked as questionable." \
403 "Not downloading this file."
404 rm -f "$lkfile"; trap INT
; return 1
406 echo "WARNING: URL is marked as questionable." \
407 "Downloading it anyways."
408 location
="${location#\?}"
412 # Make directory (if required)
414 if [ ! -d `dirname "$gzfile"` ]; then
415 mkdir
-p `dirname "$gzfile"`
418 # Alternative Directory
420 if [ "$altdir" ]; then
421 altfile
=$
(find $altdir/ -name `basename $gzfile` |
head -n 1)
426 if [ "$altfile" ]; then
428 echo "Found `basename $gzfile` as: $altfile"
429 if [ "$altcopy" = 'link' ]; then
430 cp -lv $altfile $gzfile
431 elif [ "$altcopy" = 'copy' ]; then
432 cp -v $altfile $gzfile
433 elif [ "$altcopy" = 'move' ]; then
434 mv -v $altfile $gzfile
441 read mirror mirrorver
< download
/Mirror-Cache
443 if [ -n "$mirror" -a "$mirror" != "none" -a -z "${gzfile##download/mirror/*}" ]; then
445 if ! download_file_now
"!$mirror/${gzfile#download/mirror/}" $gzfile; then
446 echo "INFO: Download from mirror failed, trying original URL."
447 download_file_now
"$location" $gzfile || downloaderror
=1
452 # don't want to use mirror
453 download_file_now
"$location" $gzfile downloaderror
=1
457 if [ ! -s "$gzfile" ]; then
458 rm -f "$lkfile"; trap INT
; return 1
463 if [[ $gzfile = *.gpg
]]; then
464 gzfile
=${gzfile%.gpg}
465 if [ -f $gzfile.gpg
]; then
466 echo "Unsigning GnuPG file: $gzfile.gpg"
469 if [ ! -f $gzfile ]; then
470 echo "Unsigning failed"
471 rm -f "$lkfile"; trap INT
; return 1
475 echo "Checksum testing: $gzfile"
476 local compressor
="$(get_compressor "$gzfile")"
477 if [ "$compressor" ]; then
478 # TODO: w/o temp file
479 $compressor < "$gzfile" > src
/down.$$.dat
480 cksum_chk src
/down.$$.dat
$cksum "$gzfile" || downloaderror
=1
481 rm -f src
/down.$$.dat
483 cksum_chk
"$gzfile" $cksum "$gzfile" || downloaderror
=1
486 # Free Lock and finish
488 rm -f "$lkfile"; trap INT
; return 0
491 # download_file_now location filename
493 # This function executes the actual download using curl.
495 download_file_now
() {
496 local location
="$1" gzfile
="$2" curlret
=0
501 manual
://*) url
="$location" ;;
502 !*) url
="${location#!}" ;;
503 *) url
="${location%/*}/${gzfile##*/}" ;;
510 # Determine if the file has already been downloaded
511 # manually. For this we first look in $HOME then in
513 downloadpath
=${altdir:-$HOME}
514 downloadfile
="${gzfile##*/}"
515 if [ -e $downloadpath/$downloadfile ]; then
516 location
="file://$downloadpath/"
518 location
="http://${url#manual://}"
519 # No manual download has taken place yet.
520 # So inform the user to do so.
522 The file $downloadfile can not be fetched automatically
523 please visit: $location
524 and download it manually into $HOME or somewhere else using -alt-dir
529 # Re-use this function with a modified download location.
530 download_file_now
"$location" $gzfile
533 http
://*|https
://*|
ftp://*|
file://*)
534 if [ -s "$gzfile.incomplete" ]; then
535 echo "INFO: Trying to resume previous download .."
541 [ -s download
/Translations
] && trfile
=download
/Translations || trfile
=misc
/share
/DownloadTranslations
542 trurl
="$(echo "$url" | sed -f $trfile)"
543 if [ -n "$trurl" -a "$trurl" != "$url" ]; then
544 echo "INFO: URL translated."
549 curl
--progress-bar $resume $curl_options "$url" -o "$gzfile.incomplete"
553 [ $curlret -eq 33 -o $curlret -eq 36 ]; then
554 echo "INFO: Resuming download not possible. -> Overwriting old file."
555 rm -f "$gzfile.incomplete"
556 curl
--progress-bar $curl_options "$url" -o "$gzfile.incomplete"
560 if [ $curlret -ne 0 ]; then
563 echo "WARNING: Got only some of the file. A re-run of $0"
564 echo "WARNING: is required to complete the download." ;;
565 22) : ;; # 404 not found
567 echo -e '\rWARNING: CURL got a SIGINT' \
568 "(someone pressed Ctrl-C). A re-run of"
569 echo "WARNING: $0 is required to complete the download."; sleep 1 ;;
571 echo "$curlret $gzfile $url" \
572 >> src
/Download-Errors
573 echo -e "\rERROR: CURL Returned error: $curlret" ;;
576 elif [ ! -s "$gzfile.incomplete" ]; then
577 echo "0 $gzfile $url" >> src
/Download-Errors
578 echo "ERROR: CURL returned success but we have no data!"
585 typeexpr
="gzip compressed data" ;;
587 typeexpr
="bzip2 compressed data" ;;
589 typeexpr
="lzip compressed data" ;;
591 typeexpr
="LZMA compressed data" ;;
593 typeexpr
="Zstandard compressed data" ;;
595 typeexpr
="compress'd data" ;;
597 typeexpr
="Zip archive data" ;;
599 typeexpr
="Java archive data (JAR)" ;;
601 typeexpr
="tar archive" ;;
603 typeexpr
="[xX][zZ] compressed data" ;;
605 echo "WARNING: Unknown file extension: $gzfile"
608 case $
(file "$gzfile.incomplete") in
610 mv "$gzfile"{.incomplete
,}
613 echo "ERROR: File type does not match filename ($typeexpr)!"
614 mv "$gzfile"{.incomplete
,.extck-err
}
620 protocol
="${url%%://*}"
622 # we need to use $location - $url is already mangled above -ReneR
623 # $protocol://$url $options
624 url
="`echo "$location" | sed "s
,$protocol://\
([^
]*\
).
*,\
1,"`"
625 options
="`echo "$location" | cut -s -d' ' -f2-`"
629 # the first option is the module name
630 module
="${options%% *}"
631 options
="${options#* }"
632 cmdline
="cvs -z4 -Q -d $url co -P $options $module"
634 # sometimes cvs wants to read ~/.cvspass just for fun ..
637 svn|svn\
+*) # allow any svn+ other transport and strip the svn+ part off
638 url
="${protocol#svn+}://$url"
639 options
="${options## *}"
640 if [ "$options" == "" -o "${options:0:1}" == "-" ]; then
641 # the module is the last dir of $url,
642 # w/ or wo/ trailing slash (/)
644 module
="${module##*/}"
646 # the first option is the module name
647 module
="${options%% *}"
648 [ "$module" = "$options" ] &&
649 options
= || options
="${options#* }"
651 cmdline
="svn export $options $url $module"
653 git|git\
+*) # allow any git+ other transport and strip the git+ part off
654 url
="${protocol#git+}://$url"
657 cmdline
="git clone --recursive $git_options $url $module"
658 options
="${options#* }"
659 [ -n $options ] && cmdpp
="(cd $module; git checkout $options)"
661 hg|hg\
+*) # allow any hg+ other transport and strip the hg+ part off
662 url
="${protocol#hg+}://$url"
665 cmdline
="hg clone $url $module"
666 options
="${options#* }"
667 [ -n $options ] && cmdpp
="(cd $module; hg clone $options)"
670 echo "$cmdclient unrecognized!"
675 cvsdir
="src/down.${protocol}dir.`echo $gzfile | tr / -`"
676 saved_pwd
=$PWD; mkdir
-p $cvsdir; cd $cvsdir
680 $cmdline ||
touch .cvs_error
683 while fuser .cvs_output
&> /dev
/null
; do
684 echo -ne `nice du -sh 2> /dev/null | \
685 cut -f1` 'downloaded from archive so far ... \r'
689 if [ -f .cvs_error
]; then
690 cd $saved_pwd; rm -rf $cvsdir
691 echo -e "\nError during checkout."
695 echo `du -sh 2> /dev/null | cut -f1` 'downloaded from archive (download finished).'
697 if [ `echo * | wc -w` -gt 1 ]; then
698 # multi-module module
699 echo "Multi-module package detected, relocating ..."
702 [ "$x" != "t2-module.$$" ] && mv -f $x t2-module.$$
/
705 mv -f t2-module.$$
/* "$module"
710 tarname
="`basename $gzfile`"
711 echo "Preparing files for final tarball."
712 [ -n "$cmdpp" ] && eval "$cmdpp"
714 if [ `find -type f | wc -l` -gt 4 ]; then
715 local compressor
="$(get_compressor $tarname)"
716 # explicitly stable sort files
717 find $module |
sort |
718 egrep -v -e '/(CVS|.svn|.git|.hg)$' -e '/(CVS|.svn|.git|.hg)/' |
719 TZ
=UTC
tar -c --owner root
--group root
--mtime 20000101 \
720 --no-recursion --files-from=- |
${compressor/ -d/} > $tarname
721 mv $tarname $saved_pwd/$gzfile
723 echo "Too few files - assuming checkout failure."
727 cd $saved_pwd; rm -rf $cvsdir
735 grep -aH '^\[D\] ' package
/*/*/*.desc
736 grep -aH '^\[D\] ' {architecture
,target
}/*/package
/*/*.desc
737 grep -aH '^[X0-9a-z]' target
/*/download.txt
2> /dev
/null |
745 # we know we only have single spaces due to list_dtags' column_clean
746 list_dtags |
sed -n \
747 -e 's,[^ ]* \([X0-9a-z]*\) \(.\)\([^ ]*\) -.*,\1 download/local/\2/\2\3,p' \
748 -e 's,[^ ]* \([X0-9a-z]*\) \(.\)\([^ ]*\) [^-].*,\1 download/mirror/\2/\2\3,p'
755 list_cksums | cut
-f2- -d' '
761 mkdir
-p src
/; list
> src
/down.$$.lst
762 ls download
/{Proxy
,Proxy-auth
,Me
,Mirror-Cache
} \
763 download
/mirror
/{README
,DOWNTEST
,LAST-UPDATE
} \
764 >> src
/down.$$.lst
2> /dev
/null
765 find download
/* -type f
-o -type l
2> /dev
/null |
767 grep -qx "$fn" src
/down.$$.lst ||
echo "Unknown file: $fn"
769 rm -f src
/down.$$.lst
777 [ -f "$fn" ] ||
echo "$fn"
784 packages
`echo package/$repository/*/*.desc`
789 # Choosen config must exist
791 if [ ! -f config
/$config/packages
]; then
792 echo "ERROR: Config $config doesn't exist."
793 echo "ERROR: try scripts/Config -cfg $config first."
797 while read on a b repo pkg c
; do
799 done < <(grep '^X' config
/$config/packages
)
801 targetchain
="$target" x
="$target"
802 while [ -f "target/$x/extends" ]; do
803 x
="$(< target/$x/extends)"
804 targetchain
="$targetchain $x"
807 for target
in $targetchain; do
808 if [ -f target
/$target/download.txt
]; then
809 while read cksum file url
; do
810 download_file
"`source_file cksum $file "$url"`" "$url" "$cksum" "$target"
811 done < target
/$target/download.txt
818 list_dtags | cut
-d ' ' -f 2- |
while read cksum file url
; do
819 download_file
"`source_file cksum $file "$url"`" "$url" "$cksum"
826 detect_confdir
# relies on $pkg being set
827 if [ ! "$confdir" ]; then
828 echo "Error: Package $pkg not found!"
832 parse_desc
$pkg # relies on $pkg and $confdir being set
833 while read cksum file url
; do
834 download_file
"`source_file cksum $file "$url"`" "$url" "$cksum" "$repo" "$pkg"
835 done < <(echo "$desc_D")
843 if [ ! -f $arg ]; then
844 echo "Skipping \"$arg\" (not found)!"
848 target
="`echo $arg | cut -f2 -d/`"
850 while read cksum file url
; do
851 download_file
"`source_file cksum $file "$url"`" "$url" "$cksum" "$target"
855 if [ "${arg%.desc}" != "$arg" ]; then
856 arg
="`echo $arg | cut -f3 -d/`"; fi
862 # pkg_*_{pre,post}.conf is only activated if extender
863 # is enabled on $config/packages, so we will only
864 # download files of those extenders
866 for extender
in `ls -1 package/*/*/pkg_${arg}_{pre,post}.conf 2> /dev/null |
867 cut -d/ -f3 | sort -u`; do
868 if grep -q "^X .* $extender " \
869 config
/$config/packages
; then
870 echo_info
"Also downloading $extender ..."
880 # Things to do only for downloading
882 if [ "${1:0:5}" != "-list" -a $checkonly = 0 ]; then
883 # Set proxy information
884 if [ -f download
/Proxy
]; then
885 proxy
="$(< download/Proxy)"
886 if [ "$proxy" ]; then
887 curl_options
="$curl_options --proxy $proxy"
889 echo "INFO: No proxy information, removing: download/Proxy"
893 if [ -f download
/Proxy-auth
]; then
894 proxyauth
="$(< download/Proxy-auth)"
895 if [ "$proxyauth" ]; then
896 curl_options
="$curl_options --proxy-user $proxyauth"
897 git_options
="-c http.proxy=http://$proxyauth@$proxy"
899 echo "INFO: No proxy-auth information, removing: download/Proxy-auth"
900 rm download
/Proxy-auth
905 if [ -z "`type -p curl`" ]; then
906 echo "ERROR: we need \`curl\` installed and available in \$PATH to proceed."
910 # Thing to do only once
912 if [ $this_is_the_2nd_run = 0 ]; then
913 # am i using a proxy?
914 if [ "$proxy" ]; then
915 echo "INFO: Setting proxy to: $proxy"
917 if [ "$proxyauth" ]; then
918 echo "INFO: Setting proxy authentication information."
921 # do mirror detection
928 -list-unknown) list_unknown
;;
929 -list-missing) list_missing
;;
930 -list-cksums) list_cksums
;;
932 -required) required
;;
935 -repository) shift; repository
"$@" ;;
937 -*|
"") exec $0 --help ;;