Browse Source

* changed sde-download2 and sde-download-get to use -n for dryrun as defined on the last version of the manpage

* improved sde-download-get to accept sde-download-$protocol handlers too


git-svn-id: svn://svn.opensde.net/opensde/opensde/trunk@21862 10447126-35f2-4685-b0cf-6dd780d3921f
misl/sde-wrapper
Alejandro Mery 18 years ago
parent
commit
408344f312
2 changed files with 10 additions and 6 deletions
  1. +7
    -3
      bin/sde-download-get
  2. +3
    -3
      bin/sde-download2

+ 7
- 3
bin/sde-download-get

@ -25,7 +25,7 @@ Usage: $progname [-vqd]
EOT
}
shortopts='dqv'
shortopts='nqv'
longopts='dry-run,quiet,verbose'
options=$( getopt -o "$shortopts" -l "$longopts" -- "$@" )
@ -46,7 +46,7 @@ while [ $# -gt 0 ]; do
case "$1" in
--) shift; break ;;
-d|--dry-run)
-n|--dry-run)
dryrun="yes" ;;
-v|--verbose)
let verbose++ ;;
@ -71,7 +71,11 @@ protocol=${source%%:*}
[ $verbose -le 1 ] || echo_info "($protocol) $source"
# find the right handler
handler=$( grep -l "^#Protocol: $protocol\$" "$SDEROOT/bin"/sde-download-* 2> /dev/null )
if [ -x "$SDEROOT/bin/sde-download-$protocol" ]; then
handler="$SDEROOT/bin/sde-download-$protocol"
else
handler=$( grep -l "^#Protocol: $protocol\$" "$SDEROOT/bin"/sde-download-* 2> /dev/null )
fi
handleropt=
[ -x "$handler" ] || echo_abort 2 "$protocol: protocol unhandled"

+ 3
- 3
bin/sde-download2

@ -52,7 +52,7 @@ if [ $# -gt 0 ]; then
esac
fi
shortopts='dqvc:m:e'
shortopts='nqvc:m:e'
longopts='dry-run,quiet,verbose,cfg,timeout:,cfg,check:,mirror:,mode:,extenders'
options=$( getopt -o "$shortopts" -l "$longopts" -- "$@" )
@ -77,7 +77,7 @@ while [ $# -gt 0 ]; do
case "$1" in
--) shift; break ;;
-d|--dry-run)
-n|--dry-run)
dryrun=yes ;;
-e|--extenders)
extenders=yes ;;
@ -162,7 +162,7 @@ esac | while read pkg cksum file location; do
tmpfile="$SDEROOT/tmp/down.$( echo $file | tr '/' '-' )"
# debug output
[ $verbose -le 1 ] || echo_info "pkg:$pkg file:$file ($cksum) source:$location"
[ $verbose -le 1 ] || echo_info "pkg:$pkg file:$file ($cksum) $location"
if [ -s "$SDEROOT/$file" ]; then
:

Loading…
Cancel
Save