[go: up one dir, main page]

Menu

[r6]: / trunk / apk_update  Maximize  Restore  History

Download this file

57 lines (47 with data), 1.5 kB

#!/bin/sh 

VERSION=0.0.9

# I'd like to implement those:
#
# * -v      Turn on verbose output.
#   -I      If any installation scripts (pre-install or post-install) exist
#           for a given package, do not execute them.
#   -n      Don't actually install a package, just report the steps that
#           would be taken if it was.
#   -r      Use the remote fetching feature.  This will determine the appro-
#           priate objformat and release and then fetch and install the pack-
#           age.


#read the apklib funfctions
. ${APKLIBS:="/lib/apk"}/apkfuncs.sh

usage() {
	eecho "apk_backup $VERSION"
	eecho "usage: apk_backup [ -v ] [ PACKAGE [ ...]] | PACKAGE [ ... ]"
	eecho "   -I           If any installation scripts (pre-backup or post-backup) exist"
	eecho "                for a given package, do not execute them."
	eecho "   -n           Don't actually backup a package, just report the steps that"
	eecho "                would be taken if it was."
	eecho "   -v           Turn on verbose output."
	eecho "   -r           Use the remote fetching feature."
	eecho "   -h           Display this help"

	exit 1
}

#parse args here
unset vflag
unset rflag
unset Iflag
unset nflag
#set -- `getopt hIvrnf: "$@"`
set -- `getopt hIvrn "$@"`
[ $# -lt 1 ] && exit 1	# getopt failed
while [ $# -gt 0 ] ; do
	case "$1" in 
		-h) usage;;
		-v) vflag="on";;
		-r) rflag="on";;
		-I) Iflag="on";;
		-n) nflag="on";;
		--) shift; break;;
		-*) usage;;
		*)  break;;
	esac
	shift
done