-
Notifications
You must be signed in to change notification settings - Fork 5
/
freebsd-wip-checkout
executable file
·109 lines (84 loc) · 2.17 KB
/
freebsd-wip-checkout
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
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/bin/sh -e
##########################################################################
# Script description:
# Check out a copy of FreeBSD ports wip and modify the ports
# configuration to accomodate the wip category.
#
# History:
# Date Name Modification
# 2017-02-11 Jason Bacon Begin
##########################################################################
usage()
{
printf "Usage: $0\n"
exit 1
}
##########################################################################
# Function description:
# Pause until user presses return
##########################################################################
pause()
{
local junk
printf "Press return to continue..."
read junk
}
##########################################################################
# Main
##########################################################################
if [ $# = 1 ]; then
if [ $1 = svn ]; then
printf "Subversion is no longer supported. Using git...\n"
pause
fi
elif [ $# != 0 ]; then
usage
fi
if [ -z $PORTSDIR ]; then
PORTSDIR=/usr/ports
fi
if which git > /dev/null 2>&1; then
git=`which git`
else
git=/usr/local/bin/git
fi
if [ ! -e $git ]; then
pkg install -y git
fi
$git clone \
https://github.com/outpaddling/freebsd-ports-wip \
$PORTSDIR/wip
cd $PORTSDIR/wip
printf "\nEditing .gitconfig.\n\n"
printf "Full name? "
read name
printf "Email? "
read email
printf "Editor? [vi] "
read editor
if [ 0$editor = 0 ]; then
editor=vi
fi
git config user.name "$name"
git config user.email "$email"
git config core.editor "$editor"
git config pull.rebase false
if ! fgrep 'USE_LOCAL_MK=yes' /etc/make.conf > /dev/null; then
cat << EOM >> /etc/make.conf
# Added by freebsd-wip-checkout
USE_LOCAL_MK=yes
# End addition
EOM
fi
if ! fgrep 'VALID_CATEGORIES+=wip' $PORTSDIR/Mk/bsd.local.mk > /dev/null; then
cat << EOM >> $PORTSDIR/Mk/bsd.local.mk
# Added by freebsd-wip-checkout
VALID_CATEGORIES+=wip
# End addition
EOM
fi
cd $PORTSDIR/wip/wip-tools && make deinstall clean install
cat << EOM
Run wip-update frequently to keep up with the latest WIP ports.
See $PORTSDIR/wip/README for basic info.
EOM