Manual Page Search Parameters

NSD-UPDATE(7) Miscellaneous Information Manual (sparc64) NSD-UPDATE(7)

nsd-updatehow to update the base nsd(8) using git from the upstream git repository

git pull
git format-patch -o ~/nsd-4.3.4/ NSD_4_3_3_REL..NSD_4_3_4_REL
cd /usr/src
git am --directory=usr.sbin/nsd/ -p0 \
    --exclude=\*/tpkg/\* \
    --exclude=\*/contrib/\* \
    --exclude=\*/compat/\* \
    --exclude=\*/README.md \
    --exclude=\*/.travis.yml \
    --exclude=\*/.gitignore \
    --exclude=\*/.cirrus.yml \
    --exclude=\*/.buildkite/\* \
    --exclude=\*/makedist.sh ~/nsd-4.3.4/*.patch
autoheader-2.69
autoconf-2.69

nsd(8) is developed in an git repository. OpenBSD is developed in cvs and does not track the whole nsd(8) tree. For example contrib/ and tpkg/ were not imported. Some developers prefer to work with git. This describes how to more or less automatically get upstream commits imported to a git conversion of the OpenBSD tree. It kinda assumes a local up to date clone of nsd(8) and git conversion of the OpenBSD cvs tree are already available. All commits from the last import to the latest release are exported using upstream tags. Here OpenBSD was at version 4.3.3 and the latest release was 4.3.4.

git format-patch -o ~/nsd-4.3.4/ NSD_4_3_3_REL..NSD_4_3_4_REL

Now we can import all individual patches that lead to the new release ignoring all files and directories we do not track:
git am --directory=usr.sbin/nsd/ -p0 \
    --exclude=\*/tpkg/\* \
    --exclude=\*/contrib/\* \
    --exclude=\*/compat/\* \
    --exclude=\*/README.md \
    --exclude=\*/.travis.yml \
    --exclude=\*/.gitignore \
    --exclude=\*/.cirrus.yml \
    --exclude=\*/.buildkite/\* \
    --exclude=\*/makedist.sh ~/nsd-4.3.4/*.patch

Diffs can now be reviewed without the fluff that is not tracked in OpenBSD 's repo. Before building config.h.in and configure need to be regenerated.
autoheader-2.69
autoconf-2.69

Finally the version numbers in the man pages need to be updated, this is currently a manual process by downloading the release tar ball and running diff -ru. Building is then done with
make -f Makefile.bsd-wrapper obj
make -f Makefile.bsd-wrapper
doas make -f Makefile.bsd-wrapper install

A patch for submission to tech@ is generated:
git diff --relative origin/master..HEAD > ~/nsd_4.3.4.diff

If there is a merge conflict and git am stops it is possible to save the work upto the failing patch:

cid=`git show --pretty=format:"%H" --no-patch`
git am --abort
git merge --ff-only ${cid}
# rm ~/nsd-4.3.4/SUCCESSULLY_APPLIED_PATCHES

git am is then re-run and the merge conflict resolved. It is helpful to do it this way if there are multiple merge conflicts and one needs to call git am --abort to get back to a sensible git tree. If we had not saved our work we would need to fix previous merge conflicts again.

intro(7)

December 6, 2020 tlakh 2.3