Browse Source

* converted `sde package` into bin/sde-package command-wannabe

FIXME: this has to be split into real commands


git-svn-id: svn://svn.opensde.net/opensde/opensde/trunk@20977 10447126-35f2-4685-b0cf-6dd780d3921f
misl/sde-wrapper
Alejandro Mery 18 years ago
parent
commit
eca040ace3
3 changed files with 80 additions and 44 deletions
  1. +47
    -0
      bin/sde-package
  2. +33
    -0
      lib/sde-package.hlp
  3. +0
    -44
      lib/sde-package.in

+ 47
- 0
bin/sde-package

@ -0,0 +1,47 @@
#!/bin/sh
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: bin/sde-package
# Copyright (C) 2006 - 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 ---
#Alias: pkg
#Description: Package related tasks
set -e
[ -n "$SDEROOT" ] ||
export SDEROOT=$( cd "${0%/*}/.."; pwd -P )
. $SDEROOT/lib/libsde.in
. $SDEROOT/lib/sde-package.in
# what action was requested?
if [ $# -eq 0 ]; then
action="help"
else
action="$1"; shift
fi
case "$action" in
help|--help) . $SDEROOT/lib/sde-help.in
help_command package ;;
up|update) . $SDEROOT/lib/sde-package/update.in
package_update "$@" ;;
new) . $SDEROOT/lib/sde-package/new.in
package_new "$@" ;;
*) . $SDEROOT/lib/sde-help.in
echo_warning "'$COLOR_MESSAGE$action$COLOR_NORMAL' not understood by the" \
"$COLOR_MESSAGE$module$COLOR_NORMAL module"
help_command package
exit 1 ;;
esac

+ 33
- 0
lib/sde-package.hlp

@ -0,0 +1,33 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: lib/sde-package.hlp
# 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 ---
Usage: sde package <action> <arguments> (Alias: pkg)
update [--location <url>] [<package>] [<version>] (Alias: up)
Updates a package (which is autodetected if you are on it) to a
given version, or simply download and regenerate checksums.
Using --location you are able to specify which will be the new
download location for this update.
update [--no-location] --md5 <url> (Alias: up)
Updates a set of packages based on a remote .md5 file
Using --no-location you tell the tool to not assume the download
location of the md5 file for the updates but keep their individual
download locations.
new [<repository>/]<package> <download> [...]
Creates a new package based on a template and the given download
locations.
new -fm [<repository>/]<package> [<name_at_freshmeat>]
Creates a new package based on the information available at
freshmeat <http://freshmeat.net> from it.

+ 0
- 44
lib/sde-package.in

@ -15,29 +15,6 @@
#Alias: pkg
#Description: Package related tasks
package_usage() {
cat <<EOT
Usage: sde package <action> <arguments> (Alias: pkg)
update [--location <url>] [<package>] [<version>] (Alias: up)
Updates a package (which is autodetected if you are on it) to a
given version, or simply download and regenerate checksums.
Using --location you are able to specify which will be the new
download location for this update.
update [--no-location] --md5 <url> (Alias: up)
Updates a set of packages based on a remote .md5 file
Using --no-location you tell the tool to not assume the download
location of the md5 file for the updates but keep their individual
download locations.
new [<repository>/]<package> <download> [...]
Creates a new package based on a template and the given download
locations.
new -fm [<repository>/]<package> [<name_at_freshmeat>]
Creates a new package based on the information available at
freshmeat <http://freshmeat.net> from it.
EOT
}
package_autodetect() {
echo $( pwd -P | sed -n -e "s,^$SDEROOT/package/[^/]*/\([^/]*\)\(/.*\)\?$,\1,p" )
}
@ -45,24 +22,3 @@ package_autodetect() {
package_autodetect_repo() {
echo $( pwd -P | sed -n -e "s,^$SDEROOT/package/\([^/]*\)\(/.*\)\?,\1,p" )
}
if [ "$module" = "package" ]; then
# what action was requested?
if [ $# -eq 0 ]; then
action="help"
else
action="$1"; shift
fi
case "$action" in
help|--help) package_usage ;;
up|update) . $SDEROOT/lib/sde-package/update.in
package_update "$@" ;;
new) . $SDEROOT/lib/sde-package/new.in
package_new "$@" ;;
*) echo_warning "'$COLOR_MESSAGE$action$COLOR_NORMAL' not understood by the" \
"$COLOR_MESSAGE$module$COLOR_NORMAL module"
package_usage
exit 1 ;;
esac
fi

Loading…
Cancel
Save