Browse Source

* added pre-draft for the new bin/sde-download, only validating the discriminators

and calling getopt with the arguments defined on the man page.


git-svn-id: svn://svn.opensde.net/opensde/opensde/trunk@21711 10447126-35f2-4685-b0cf-6dd780d3921f
misl/sde-wrapper
Alejandro Mery 17 years ago
parent
commit
32d22109b7
1 changed files with 72 additions and 0 deletions
  1. +72
    -0
      bin/sde-download2

+ 72
- 0
bin/sde-download2

@ -0,0 +1,72 @@
#!/bin/sh
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: bin/sde-download2
# Copyright (C) 2007 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License. A copy of the
# GNU General Public License can be found in the file COPYING.
# --- SDE-COPYRIGHT-NOTE-END ---
#Description: Download sources
[ -n "$SDEROOT" ] ||
export SDEROOT=$( cd "${0%/*}/.."; pwd -P )
. $SDEROOT/lib/libsde.in
download_usage() {
local progname=${0##*/}
cat <<EOT >&2
Usage: $progname [DISCRIMINATOR] [OPTIONS] [ITEMS...]
Accepted discriminators:
* config (cfg)
* package (pkg) - default
* repository (repo)
For more information read \`sde help download\`.
EOT
}
# detect discriminator
discriminator=package
if [ $# -gt 0 ]; then
case "$1" in
-*) ;;
config|cfg)
discriminator=config; shift ;;
package|pkg)
discriminator=package; shift ;;
repository|repo)
discriminator=repository: shift ;;
*)
echo_error "$1: invalid discriminator"
download_usage
exit -1 ;;
esac
fi
shortopts='dqvm:'
longopts='dry-run,quiet,verbose,timeout:,check:,mirror:,mode:,dependencies'
options=$( getopt -o "$shortopts" -l "$longopts" -- "$@" )
if [ $? -ne 0 ]; then
download_usage
exit -1
fi
# load new arguments list
eval set -- "$options"
dryrun=
echo_abort 1 "$discriminator: Not yet implemented"
set -e

Loading…
Cancel
Save