Port-Patches automatisch generieren
Ändert man einen FreeBSD -Port und möchte dazu Patches erstellen, welche im Port unter dem Verzeichnis files gespeichert werden, so muss man diese nicht unbedingt von Hand mit diff(1) erzeugen. Zuerst erstellt man von jeder Datei, die man verändern möchte, unterhalb des work/-Verzeichnisses eine Kopie mit der Endung .orig und bearbeitet das Original.
# cd /usr/ports/security/nss/work/nss-3.12.4/mozilla/security/nss/lib/nss/ # ls -l config.mk* -rw-r----- 1 root wheel 3181 30 Aug 22:27 config.mk -rw-r----- 1 root wheel 3182 11 Jun 02:55 config.mk.orig
Sind alle Änderungen gemacht, geht man in das Port-Verzeichnis und gibt make makepatch ein:
# cd /usr/ports/security/nss # ls -l files total 0 # make makepatch /usr/bin/diff -ud ./cmd/modutil/modutil.h.orig ./cmd/modutil/modutil.h > /usr/ports/security/nss/files/patch-cmd__modutil__modutil.h /usr/bin/diff -ud ./cmd/modutil/pk11.c.orig ./cmd/modutil/pk11.c > /usr/ports/security/nss/files/patch-cmd__modutil__pk11.c /usr/bin/diff -ud ./cmd/platlibs.mk.orig ./cmd/platlibs.mk > /usr/ports/security/nss/files/patch-cmd__platlibs.mk /usr/bin/diff -ud ./tests/common/init.sh.orig ./tests/common/init.sh > /usr/ports/security/nss/files/patch-tests__common__init.sh /usr/bin/diff -ud ./lib/ckfw/dbm/ckdbm.h.orig ./lib/ckfw/dbm/ckdbm.h > /usr/ports/security/nss/files/patch-lib__ckfw__dbm__ckdbm.h /usr/bin/diff -ud ./lib/ssl/config.mk.orig ./lib/ssl/config.mk > /usr/ports/security/nss/files/patch-lib__ssl__config.mk /usr/bin/diff -ud ./lib/smime/config.mk.orig ./lib/smime/config.mk > /usr/ports/security/nss/files/patch-lib__smime__config.mk /usr/bin/diff -ud ./lib/certdb/xauthkid.c.orig ./lib/certdb/xauthkid.c > /usr/ports/security/nss/files/patch-lib__certdb__xauthkid.c /usr/bin/diff -ud ./lib/certdb/xbsconst.c.orig ./lib/certdb/xbsconst.c > /usr/ports/security/nss/files/patch-lib__certdb__xbsconst.c /usr/bin/diff -ud ./lib/certdb/xconst.c.orig ./lib/certdb/xconst.c > /usr/ports/security/nss/files/patch-lib__certdb__xconst.c /usr/bin/diff -ud ./lib/softoken/legacydb/cdbhdl.h.orig ./lib/softoken/legacydb/cdbhdl.h > /usr/ports/security/nss/files/patch-lib__softoken__legacydb__cdbhdl.h /usr/bin/diff -ud ./lib/softoken/legacydb/dbmshim.c.orig ./lib/softoken/legacydb/dbmshim.c > /usr/ports/security/nss/files/patch-lib__softoken__legacydb__dbmshim.c /usr/bin/diff -ud ./lib/softoken/legacydb/keydb.c.orig ./lib/softoken/legacydb/keydb.c > /usr/ports/security/nss/files/patch-lib__softoken__legacydb__keydb.c /usr/bin/diff -ud ./lib/softoken/legacydb/pcertdb.c.orig ./lib/softoken/legacydb/pcertdb.c > /usr/ports/security/nss/files/patch-lib__softoken__legacydb__pcertdb.c /usr/bin/diff -ud ./lib/softoken/legacydb/pk11db.c.orig ./lib/softoken/legacydb/pk11db.c > /usr/ports/security/nss/files/patch-lib__softoken__legacydb__pk11db.c /usr/bin/diff -ud ./lib/softoken/legacydb/keydbi.h.orig ./lib/softoken/legacydb/keydbi.h > /usr/ports/security/nss/files/patch-lib__softoken__legacydb__keydbi.h /usr/bin/diff -ud ./lib/softoken/config.mk.orig ./lib/softoken/config.mk > /usr/ports/security/nss/files/patch-lib__softoken__config.mk /usr/bin/diff -ud ./lib/nss/config.mk.orig ./lib/nss/config.mk > /usr/ports/security/nss/files/patch-lib__nss__config.mk /usr/bin/diff -ud ./lib/freebl/config.mk.orig ./lib/freebl/config.mk > /usr/ports/security/nss/files/patch-lib__freebl__config.mk /usr/bin/diff -ud ./lib/pk11wrap/secmodi.h.orig ./lib/pk11wrap/secmodi.h > /usr/ports/security/nss/files/patch-lib__pk11wrap__secmodi.h /usr/bin/diff -ud ./Makefile.orig ./Makefile > /usr/ports/security/nss/files/patch-Makefile # ls -l files total 42 -rw-r--r-- 1 root wheel 434 30 Aug 22:29 patch-Makefile -rw-r--r-- 1 root wheel 451 30 Aug 22:29 patch-cmd__modutil__modutil.h -rw-r--r-- 1 root wheel 1448 30 Aug 22:29 patch-cmd__modutil__pk11.c -rw-r--r-- 1 root wheel 635 30 Aug 22:29 patch-cmd__platlibs.mk -rw-r--r-- 1 root wheel 341 30 Aug 22:29 patch-lib__certdb__xauthkid.c -rw-r--r-- 1 root wheel 509 30 Aug 22:29 patch-lib__certdb__xbsconst.c -rw-r--r-- 1 root wheel 481 30 Aug 22:29 patch-lib__certdb__xconst.c -rw-r--r-- 1 root wheel 285 30 Aug 22:29 patch-lib__ckfw__dbm__ckdbm.h -rw-r--r-- 1 root wheel 291 30 Aug 22:29 patch-lib__freebl__config.mk -rw-r--r-- 1 root wheel 284 30 Aug 22:29 patch-lib__nss__config.mk -rw-r--r-- 1 root wheel 301 30 Aug 22:29 patch-lib__pk11wrap__secmodi.h -rw-r--r-- 1 root wheel 311 30 Aug 22:29 patch-lib__smime__config.mk -rw-r--r-- 1 root wheel 296 30 Aug 22:29 patch-lib__softoken__config.mk -rw-r--r-- 1 root wheel 333 30 Aug 22:29 patch-lib__softoken__legacydb__cdbhdl.h -rw-r--r-- 1 root wheel 372 30 Aug 22:29 patch-lib__softoken__legacydb__dbmshim.c -rw-r--r-- 1 root wheel 332 30 Aug 22:29 patch-lib__softoken__legacydb__keydb.c -rw-r--r-- 1 root wheel 361 30 Aug 22:29 patch-lib__softoken__legacydb__keydbi.h -rw-r--r-- 1 root wheel 341 30 Aug 22:29 patch-lib__softoken__legacydb__pcertdb.c -rw-r--r-- 1 root wheel 353 30 Aug 22:29 patch-lib__softoken__legacydb__pk11db.c -rw-r--r-- 1 root wheel 368 30 Aug 22:29 patch-lib__ssl__config.mk -rw-r--r-- 1 root wheel 495 30 Aug 22:29 patch-tests__common__init.sh
Nun wurde von allen veränderten Dateien ein Patch im Verzeichnis files erstellt.
Comments
No new comments allowed (anymore) on this post.