-
Notifications
You must be signed in to change notification settings - Fork 2
/
pkg
executable file
·97 lines (93 loc) · 2.45 KB
/
pkg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/sh
print_help() {
echo "Usage: pkg ACTION|WRAPPER [PKGNAME|FILE]\n"
echo "ACTIONS:"
echo " help print this help message."
echo " install install package with PKGNAME."
echo " remove remove package with PKGNAME."
echo " search search for PKGNAME in name/description."
echo " upgrade upgrade PKGNAME or all packages."
echo " info show information for package PKGNAME."
echo " which check to which package FILE belongs."
echo " files list files contained in package PKGNAME."
echo " clean remove obsolete packages from package cache."
echo " hold hold package with PKGNAME."
echo " unhold unhold package with PKGNAME."
echo " deps list dependencies for package PKGNAME"
echo " revdeps list packages which need package PKGNAME."
echo " orphans list orphaned packages."
echo " "
echo "WRAPPERS:"
echo " db calls xbps-pkgdb."
echo " alternatives calls xbps-alternatives."
echo " query calls xbps-query."
echo " reconfigure calls xbps-reconfigure."
echo " rindex calls xbps-rindex."
}
if [ $# -lt 1 ]; then
print_help
exit 0
fi
case "$1" in
help)
print_help
;;
install)
shift; xbps-install -S "$@"
;;
remove)
shift; xbps-remove "$@"
;;
search)
shift; xbps-query -Rs "$@"
;;
upgrade)
shift; xbps-install -Su "$@"
;;
info)
shift; xbps-query "$@"
;;
which)
shift; xbps-query -o "$@"
;;
files)
shift; xbps-query -f "$@"
;;
clean)
shift; xbps-remove -O "$@"
;;
hold)
shift; xbps-pkgdb -m hold "$@"
;;
unhold)
shift; xbps-pkgdb -m unhold "$@"
;;
deps|dependencies|depends-on)
shift; xbps-query -Rx "$@"
;;
revdeps|reverse-dependencies|required-by)
shift; xbps-query -RX "$@"
;;
orphans)
shift; xbps-query -O "$@"
;;
db)
shift; xbps-pkgdb "$@"
;;
alternatives)
shift; xbps-alternatives "$@"
;;
query)
shift; xbps-query "$@"
;;
reconfigure)
shift; xbps-reconfigure "$@"
;;
rindex)
shift; xbps-rindex "$@"
;;
*)
echo "Unknown option: $*"
print_help
;;
esac