forked from RomaniukVadim/hack_scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathport
More file actions
37 lines (29 loc) · 692 Bytes
/
Copy pathport
File metadata and controls
37 lines (29 loc) · 692 Bytes
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
#!/bin/sh
# Wrapper script for managing ports
if [ -n "$1" ]; then
case "$1" in
# edit Pkgfile
edit) sudo $EDITOR Pkgfile ;;
# force building
force) fakeroot pkgmk -d -f ;;
# search ports tree
grep) ports -l | grep $2 ;;
# check if port updates are needed
news) ports -d ;;
# update ports tree
update) sudo ports -u ;;
# upgrade all ports
upgrade) sudo prt-get sysup ;;
# verify port
verify) prtverify . ;;
# error
*)
echo "Invalid command."
echo "Usage: port [edit|force|grep|news|update|upgrade|verify]"
exit 1
;;
esac
else
# build with dtach and fakeroot
exec dtach -A "$TMPDIR/dtach/build-$(date +%s)" fakeroot /usr/bin/pkgmk -d
fi