Subject: fixing ifdefs and big patches
To: None <tech-userlevel@NetBSD.ORG>
From: Tim Rightnour <>
List: tech-userlevel
Date: 05/28/1998 21:45:40
While porting a FreeBSD package from thier ports system to our pkg system
today, I ran into a ton of diffs that were clumped together into one massive
patch.  I also ran into *heaps* of #ifdef __FreeBSD__ 's

Following my mantra of "never type anything more than once" I built a pair of
scripts. and takes a single argument, which is a big "glob" patch.  It then
breaks it down into patch-aa -ab etc etc.  I usually cat patch-?? >patch then
run it, to keep it from clobbering other patches. then runs against all the patch-?? files in the current directory, and
does a quick sed to replace #ifdef __FreeBSD__ and #ifndef's with the
appropriate __NetBSD__ and __FreeBSD__ checks.  It makes very short work of an
otherwise tedious task.

Anyhow.. if anyone would like this, Its up on my web page at:

There may be a few bugs in it.. None that ive seen yet.. but If you find any..
please let me know, so I can fix them.  Thanks.

Tim Rightnour    -