4 # Author: Martti Kuparinen <martti@NetBSD.org>
6 # This file contains copy-pastable commands to import a new PF release
7 # into the NetBSD repository. Before importing the code into the official
8 # NetBSD repository, you'll import the code into your own local test
9 # repository, resolve the conflicts and make sure everything works as expected.
11 # Steps in this document:
12 # 1) Get the PF dist files and a copy of the CVS repository
13 # 2) Create a local test repository for the test imports
14 # 3) Import the new PF release into the test repository
15 # 4) Resolve conflicts and make other adjustments
16 # 5) Save the required modifications
17 # 6) Re-create a local test repository for the final test import
18 # 7) Import the new PF release into the test repository
20 # 9) Compile everything and make sure the new version really works
21 # 10) Update your /usr/src (cd /usr/src && cvs update -dPA)
22 # 11) Import the new PF release into the NetBSD repository
24 # 13) Update your /usr/src one more time (cd /usr/src && cvs update -dPA)
25 # 14) Compile and install everything
26 # 15) Update src/doc/3RDPARTY and src/doc/CHANGES
27 # 16) Send an announcement to current-users
30 ###############################################################################
31 ###############################################################################
32 # COMMON SETTINGS FOR EVERYTHING BELOW
33 ###############################################################################
34 ###############################################################################
36 export NETBSDUSERNAME="fixthis"
38 export VERTAG="`echo ${VERSION} | sed 's+\.+_+g'`"
41 export ORIG="${HOME}/netbsd/orig"
42 export WORK="${HOME}/netbsd/work"
43 export FIXES="${HOME}/netbsd/fixes/${VERSION}"
44 export RSYNC_RSH="ssh -4"
45 export RSYNC="rsync -avzr --delete"
47 ###############################################################################
48 ###############################################################################
49 # Fetch the official PF sources
50 ###############################################################################
51 ###############################################################################
53 mkdir -p ${ORIG}/openbsd-${VERSION}
54 cd ${ORIG}/openbsd-${VERSION}
55 if [ ! -f src.tar.gz ]; then
56 ftp ftp://ftp.df.lth.se/pub/OpenBSD/${VERSION}/src.tar.gz
58 if [ ! -f sys.tar.gz ]; then
59 ftp ftp://ftp.df.lth.se/pub/OpenBSD/${VERSION}/sys.tar.gz
62 ###############################################################################
63 ###############################################################################
64 # GET COPY OF THE CVS REPOSITORY FOR LOCAL TEST IMPORTS
65 ###############################################################################
66 ###############################################################################
69 RSYNC="rsync -avzr --delete -e ssh"
70 S="${NETBSDUSERNAME}@cvs.netbsd.org::cvsroot"
73 if [ "${NETBSDUSERNAME}" = "fixthis" ]; then
74 echo "You MUST use your real NetBSD user name..."
77 ${RSYNC} ${S}/src/ ${D}/src
78 ${RSYNC} --exclude 'commitlog*' --exclude 'history*' ${S}/CVSROOT/ ${D}/CVSROOT
80 ###############################################################################
81 ###############################################################################
83 ###############################################################################
84 ###############################################################################
86 # Get a new repository
88 ${RSYNC} ${ORIG}/cvsroot ${WORK}
89 rm -f ${WORK}/cvsroot/CVSROOT/commitinfo*
90 rm -f ${WORK}/cvsroot/CVSROOT/loginfo*
91 touch ${WORK}/cvsroot/CVSROOT/commitinfo
92 touch ${WORK}/cvsroot/CVSROOT/loginfo
93 chmod 644 ${WORK}/cvsroot/CVSROOT/config
94 sed 's+/cvslock+/tmp/cvslock+' < ${WORK}/cvsroot/CVSROOT/config \
95 > ${WORK}/cvsroot/CVSROOT/config.1
96 grep -v -e tag= -e AdminGroup= -e AdminOptions= \
97 < ${WORK}/cvsroot/CVSROOT/config.1 > ${WORK}/cvsroot/CVSROOT/config
98 chmod 444 ${WORK}/cvsroot/CVSROOT/config
99 rm -f ${WORK}/cvsroot/CVSROOT/config.1
100 mkdir -p /tmp/cvslock
101 export CVSROOT="${WORK}/cvsroot"
103 # Checkout a working copy
111 rm -rf dist/pf sys/dist/pf
117 rm -rf dist/pf sys/dist/pf
118 cvs update -dPA dist/pf sys/dist/pf
122 cvs tag BEFORE-PF-${VERTAG} dist/pf sys/dist/pf
124 # Prepare the files for import
125 rm -rf /tmp/openbsd-${VERSION}
126 mkdir -p /tmp/openbsd-${VERSION}
127 cd /tmp/openbsd-${VERSION}
128 tar -xzf ${ORIG}/openbsd-${VERSION}/src.tar.gz
129 tar -xzf ${ORIG}/openbsd-${VERSION}/sys.tar.gz
130 rm -rf /tmp/netbsd-${VERSION}
131 ${WORK}/src/dist/pf/pf2netbsd /tmp/openbsd-${VERSION} /tmp/netbsd-${VERSION}
132 cd /tmp/netbsd-${VERSION}
134 # Import the new version
135 cd /tmp/netbsd-${VERSION}
136 cvs import -I ! -I CVS -m "Import PF from OpenBSD ${VERSION}" \
137 src OPENBSD ${VERNEW}
140 cd ${WORK}/src/dist/pf
141 cvs update -kk -j${VEROLD} -j${VERNEW} -d
142 A=`cvs update | grep ^C | awk '{ print $2 }'`
146 ##for i in $A; do mkdir -p ${FIXES}/1/src/dist/pf/`dirname $i`; done
147 ##for i in $A; do cp $i ${FIXES}/1/src/dist/pf/$i; done
148 cvs diff -u -kk -rOPENBSD $A | less
149 cvs diff -u -kk -rOPENBSD | less
153 cd ${WORK}/src/sys/dist/pf
154 cvs update -kk -j${VEROLD} -j${VERNEW} -d
155 B=`cvs update | grep ^C | awk '{ print $2 }'`
159 ##for i in $B; do mkdir -p ${FIXES}/1/src/sys/dist/pf/`dirname $i`; done
160 ##for i in $B; do cp $i ${FIXES}/1/src/sys/dist/pf/$i; done
161 cvs diff -u -kk -rOPENBSD $B | less
162 cvs diff -u -kk -rOPENBSD | less
166 cvs ci -m "Upgraded PF to ${VERSION}" dist/pf sys/dist/pf
170 cvs diff -u -kk -rOPENBSD dist/pf sys/dist/pf | less
172 ###############################################################################
173 ###############################################################################
175 ###############################################################################
176 ###############################################################################
178 # Get a new repository
180 ${RSYNC} ${ORIG}/cvsroot ${WORK}
181 rm -f ${WORK}/cvsroot/CVSROOT/commitinfo*
182 rm -f ${WORK}/cvsroot/CVSROOT/loginfo*
183 touch ${WORK}/cvsroot/CVSROOT/commitinfo
184 touch ${WORK}/cvsroot/CVSROOT/loginfo
185 chmod 644 ${WORK}/cvsroot/CVSROOT/config
186 sed 's+/cvslock+/tmp/cvslock+' < ${WORK}/cvsroot/CVSROOT/config \
187 > ${WORK}/cvsroot/CVSROOT/config.1
188 grep -v -e tag= -e AdminGroup= -e AdminOptions= \
189 < ${WORK}/cvsroot/CVSROOT/config.1 > ${WORK}/cvsroot/CVSROOT/config
190 chmod 444 ${WORK}/cvsroot/CVSROOT/config
191 rm -f ${WORK}/cvsroot/CVSROOT/config.1
192 mkdir -p /tmp/cvslock
193 export CVSROOT="${WORK}/cvsroot"
195 # Checkout a working copy
197 rm -rf dist/pf sys/dist/pf
198 cvs update -dPA dist/pf sys/dist/pf
202 cvs tag BEFORE-PF-${VERTAG} dist/pf sys/dist/pf
204 # Prepare the files for import
205 rm -rf /tmp/openbsd-${VERSION}
206 mkdir -p /tmp/openbsd-${VERSION}
207 cd /tmp/openbsd-${VERSION}
208 tar -xzf ${ORIG}/openbsd-${VERSION}/src.tar.gz
209 tar -xzf ${ORIG}/openbsd-${VERSION}/sys.tar.gz
210 rm -rf /tmp/netbsd-${VERSION}
211 ${WORK}/src/dist/pf/pf2netbsd /tmp/openbsd-${VERSION} /tmp/netbsd-${VERSION}
212 cd /tmp/netbsd-${VERSION}
214 # Import the new version
215 cd /tmp/netbsd-${VERSION}
216 cvs import -I ! -I CVS -m "Import PF from OpenBSD ${VERSION}" \
217 src OPENBSD ${VERNEW}
219 # Merge and fix conflicts
220 cd ${WORK}/src/dist/pf
221 cvs update -kk -j${VEROLD} -j${VERNEW} -d
224 cd ${WORK}/src/sys/dist/pf
225 cvs update -kk -j${VEROLD} -j${VERNEW} -d
228 cd ${FIXES}/1 && tar cf - * | tar xvf - -C ${WORK}
230 cvs ci -m "Upgraded PF to ${VERSION}" dist/pf sys/dist/pf
232 cd ${FIXES}/2 && tar cf - * | tar xvf - -C ${WORK}
234 cvs ci -m "Sync with official PF" dist/pf sys/dist/pf
236 ###############################################################################
237 ###############################################################################
238 # FINAL IMPORT IN TO NETBSD REPOSITORY
239 ###############################################################################
240 ###############################################################################
243 if [ "${NETBSDUSERNAME}" = "fixthis" ]; then
244 echo "You MUST use your real NetBSD user name..."
248 export CVSROOT="${NETBSDUSERNAME}@cvs.netbsd.org:/cvsroot"
250 # Update the local copy first
252 cvs update -dPA dist/pf sys/dist/pf
255 cvs tag BEFORE-PF-${VERTAG} dist/pf sys/dist/pf
257 # Prepare the files for import
258 rm -rf /tmp/openbsd-${VERSION}
259 mkdir -p /tmp/openbsd-${VERSION}
260 cd /tmp/openbsd-${VERSION}
261 tar -xzf ${ORIG}/openbsd-${VERSION}/src.tar.gz
262 tar -xzf ${ORIG}/openbsd-${VERSION}/sys.tar.gz
263 rm -rf /tmp/netbsd-${VERSION}
264 ${WORK}/src/dist/pf/pf2netbsd /tmp/openbsd-${VERSION} /tmp/netbsd-${VERSION}
265 cd /tmp/netbsd-${VERSION}
267 # Import the new version
268 cd /tmp/netbsd-${VERSION}
269 cvs import -I ! -I CVS -m "Import PF from OpenBSD ${VERSION}" \
270 src OPENBSD ${VERNEW}
272 # Merge and fix conflicts
273 cd ${WORK}/src/dist/pf
274 cvs update -kk -j${VEROLD} -j${VERNEW} -d
277 cd ${WORK}/src/sys/dist/pf
278 cvs update -kk -j${VEROLD} -j${VERNEW} -d
281 cd ${FIXES}/1 && tar cf - * | tar xvf - -C ${WORK}
283 cvs ci -m "Upgraded PF to ${VERSION}" dist/pf sys/dist/pf
285 cd ${FIXES}/2 && tar cf - * | tar xvf - -C ${WORK}
287 cvs ci -m "Sync with official PF" dist/pf sys/dist/pf
289 # fix doc/3RDPARTY and doc/CHANGES
290 # send mail to current-users@
296 I have just upgraded PF to the latest version on NetBSD -current. I've
297 tested this by building i386 and amd64 release and installed the sets
300 If you detect any errors (or have improvements), please send a problem
301 report with the send-pr tool.