mirror of
https://github.com/outbackdingo/scratchpkg.git
synced 2026-02-05 00:25:53 +00:00
updated
This commit is contained in:
16
installpkg
16
installpkg
@@ -403,6 +403,14 @@ parse_options() {
|
||||
*.spkg.txz)
|
||||
[ -f $1 ] && PKGNAME=$1 || msg "${color_red}$1${color_reset} not exist."
|
||||
;;
|
||||
--root)
|
||||
if [ ! "$2" ]; then
|
||||
msg "Option '$1' require an argument (root path)."
|
||||
exit 1
|
||||
fi
|
||||
ROOT="$2"
|
||||
shift
|
||||
;;
|
||||
-h|--help)
|
||||
SHOW_HELP=yes
|
||||
;;
|
||||
@@ -429,6 +437,14 @@ main() {
|
||||
|
||||
loadconfigfile
|
||||
|
||||
# CHANGE ROOT PATH ###
|
||||
if [ "$ROOT" ]; then
|
||||
ROOT_DIR="$ROOT"
|
||||
INDEX_DIR="$ROOT_DIR/$INDEX_DIR"
|
||||
BACKUP_DIR="$ROOT_DIR/$BACKUP_DIR"
|
||||
REJECTED_DIR="$ROOT_DIR/$REJECTED_DIR"
|
||||
fi
|
||||
|
||||
### SHOW HELP ###
|
||||
if [ "$SHOW_HELP" ]; then
|
||||
help
|
||||
|
||||
16
removepkg
16
removepkg
@@ -243,6 +243,14 @@ parse_options() {
|
||||
--no-orphan-check)
|
||||
NO_ORPHAN_CHECK=yes
|
||||
;;
|
||||
--root)
|
||||
if [ ! "$2" ]; then
|
||||
msg "Option '$1' require an argument (root path)."
|
||||
exit 1
|
||||
fi
|
||||
ROOT="$2"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
RMNAME=$1
|
||||
;;
|
||||
@@ -265,6 +273,14 @@ main() {
|
||||
|
||||
loadconfigfile
|
||||
|
||||
# CHANGE ROOT PATH ###
|
||||
if [ "$ROOT" ]; then
|
||||
ROOT_DIR="$ROOT"
|
||||
INDEX_DIR="$ROOT_DIR/$INDEX_DIR"
|
||||
BACKUP_DIR="$ROOT_DIR/$BACKUP_DIR"
|
||||
REJECTED_DIR="$ROOT_DIR/$REJECTED_DIR"
|
||||
fi
|
||||
|
||||
if [ -z $RMNAME ]; then
|
||||
msgerr "Please state package name for remove."
|
||||
exit 1
|
||||
|
||||
20
scratch
20
scratch
@@ -8,7 +8,7 @@ listinstalled() {
|
||||
for ip in ${installedpkg[@]}; do
|
||||
echo $ip
|
||||
done
|
||||
msg "Total installed package: ${#installedpkg[@]}"
|
||||
msg "Total installed package(s): ${#installedpkg[@]}"
|
||||
}
|
||||
|
||||
getinstalledname() {
|
||||
@@ -49,7 +49,7 @@ listorphan() {
|
||||
for i in ${ORPHAN_PKG[@]}; do
|
||||
echo $i
|
||||
done
|
||||
msg "Total orphan package: ${#ORPHAN_PKG[@]}"
|
||||
msg "Total orphan package(s): ${#ORPHAN_PKG[@]}"
|
||||
}
|
||||
|
||||
searchpkg() {
|
||||
@@ -525,6 +525,14 @@ parse_options() {
|
||||
OUTPUT_PKG="$2"
|
||||
shift
|
||||
;;
|
||||
--root)
|
||||
if [ ! "$2" ]; then
|
||||
msg "Option '$1' require an argument (root path)."
|
||||
exit 1
|
||||
fi
|
||||
ROOT="$2"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
msg "Option invalid!"
|
||||
exit 1
|
||||
@@ -548,6 +556,14 @@ main() {
|
||||
|
||||
loadconfigfile
|
||||
|
||||
# CHANGE ROOT PATH ###
|
||||
if [ "$ROOT" ]; then
|
||||
ROOT_DIR="$ROOT"
|
||||
INDEX_DIR="$ROOT_DIR/$INDEX_DIR"
|
||||
BACKUP_DIR="$ROOT_DIR/$BACKUP_DIR"
|
||||
REJECTED_DIR="$ROOT_DIR/$REJECTED_DIR"
|
||||
fi
|
||||
|
||||
### SHOW PORT PATH ###
|
||||
if [ $PORT_PATH ]; then
|
||||
showportpath
|
||||
|
||||
Reference in New Issue
Block a user