Learned another thing today. The ports tree is just a repository of available software, it can be deleted & regenerated. Why would some one wants to delete the ports tree? It needed to be delete and regenerated because some patch was downloaded incorrectly and the problem stubbornly persists.
Sample of the error :
===> Applying FreeBSD patches for exim-4.71 Ignoring previously applied (or reversed) patch. 2 out of 2 hunks ignored--saving rejects to src/daemon.c.rej => Patch patch-src-daemon.c failed to apply cleanly. => Patch(es) patch-OS::Makefile-FreeBSD patch-scripts::exim_install applied cleanly. *** Error code 1 Stop in /usr/ports/mail/exim. *** Error code 1 Stop in /usr/ports/mail/exim.
The error complained about a patch file which the patch file did exists.
What have been tried :
-
portsnap fetch update;make --> NO, it didn't work
-
make clean;make rmconfig;make --> NO, it didn't work
-
make config, deselect all options, make --> NO, it didn't work
-
rm -rf /usr/ports/distfiles/exim then make --> NO, it didn't work
After meddling around for a few minutes, still no clue. Is time to check out :
IRC server : irc.freenode.net
IRC channel : #freebsd
As usual, the FreeBSD community is always helpful. Thanks to “crsd” suggested that this seems to be a local machine error.
The solution to this problem is to clear the ports tree and regenerate it again :
rm -rf /usr/ports;portsnap fetch update
Of cause, it is always a good idea to backup first before doing. Use the following to backup :
tar zcf ~/ports_tree-$(date +%Y%m%d).tar.gz /usr/ports
*** Another note, thanks to “merijn” for pointing out after the very first time running “portsnap fetch extract” (after installing any FreeBSD box), removing /usr/ports tree and regenerate the ports tree don’t need the parameter “extract” anymore. Instead, “portsnap fetch update” is sufficient.
Adios !!!



