Skip to content
John C. Vernaleo edited this page Jul 31, 2015 · 14 revisions

The Bitrig ports tree is periodically synced with the OpenBSD ports tree that it originally forked from. The general procedure will be documented here (although this is still somewhat a work in progress). This is not something a user would ever need to or want to do.

OpenBSD ports use cvs for version control so we have to use the git mirror provided at xenocara.org.

TODO describe how we do the actual import into the openbsd branch.

Make sure you are starting with all up to date code. Also make sure you have no local changes on master branch.

$ cd /usr/ports/
$ git fetch --all
$ git co master
$ git status
$ git merge --ff-only origin/master
$ git co openbsd
$ git merge --ff-only origin/openbsd

Find the first and last commit you need from the openbsd branch. The easiest way is to make note of the last commit you merged from (otherwise you have to match the date and the commit message since the hash will be different on the master and on openbsd branches) and then use git log to find the commit right after. A list of commits used in the previous syncs should be kept at Sync-Commits. The latest commit you need is probably just the most recent commit on the openbsd branch (unless you only want to do a partial sync).

$ git co openbsd
$ git log --reverse --ancestry-path PREVIOUSMERGELAST..openbsd | head #FIRST
$ git show #LAST

Now, using the two hashes you worked out above (FIRST, LAST):

$ git co -b YOURNAME_sync LAST
$ git rebase --onto master -i FIRST

You will now have to deal with any merge conficts. Generally we do not touch the commit messages. It is important to get the REVISION correct when merging. If the port is a new version you can safely delete the revision, but since the OpenBSD ports have different REVISIONs than bitrig ports it can be tough to get them right.

Once the rebase is completed, there are several checks that are made before the sync branch can be pushed to master. This is to catch mistakes and to make sure no MAINTAINER lines have been added since we do not use those. Fix any problems these two commands find and commit with a single commit. stdc++ should not be in any WANTLIBs (and should be replaced with c++ c++abi).

$ find . -name Makefile | xargs grep MAINTAINER | \
grep -v -e 'IS_' -e '???' -e 'MAINTAINERCLEANFILES' \
-e 'MAINTAINER_MODE' -e 'MAINTAINERS' -e 'MAKE_FLAGS' \
-e 'pobj'
$ find . -name Makefile | xargs grep ^REVISION | grep -v pobj \
| awk -F"=" '{print $1}' | uniq -d
$ find . -name Makefile | grep -v portcheck | xargs grep WANTLIB \
| grep stdc++ | grep -v estdc++
$ make clean

If any new commits have gone in to master since you started this sync you will need to rebase against master once again. Hopefully this one will not cause any conflicts.

$ git co master
$ git pull
$ git co YOURNAME_sync
$ git rebase -i master

Update the index. This has the added benefit of catching any Makefiles that are not properly formed.

$ make index
$ git add INDEX
$ git commit -m "Update INDEX"

You should now push your sync branch to give others a chance to review or test it.

git push origin YOURNAME_sync

You should build all the ports that have been updated at this point to make sure nothing new has been broken at the very least. It is better to do a full build of all ports with dpb. You need to check that no new ports have broken since the most recent snapshot (we do not have a procedure worked out for this just yet).

Now push the code to master and tag. For the tag, use the date of the latest OpenBSD commit synced, not the current date.

git co master
git merge --ff-only YOURNAME_sync
git tag sync_DATE
git push origin master
git push origin sync_DATE
git push origin :YOURNAME_sync
git branch -d YOURNAME_sync
Clone this wiki locally