From 6cdfedc12ce99200752a5fa1cc4432a88e1954a3 Mon Sep 17 00:00:00 2001 From: Ben Gras Date: Tue, 13 Mar 2012 02:07:22 +0100 Subject: [PATCH] tools: some nbsd_ports fixes . figure out which dates were used for various nbsd imports and specify them for each one in the nbsd_ports file . other minor fixes and improvements --- tools/Makefile | 17 +++++-- tools/nbsd_diff.sh | 15 ++++-- tools/nbsd_ports | 115 +++++++++++++++++++++++---------------------- 3 files changed, 83 insertions(+), 64 deletions(-) diff --git a/tools/Makefile b/tools/Makefile index 99a4ba9eb..70f36e910 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -110,14 +110,21 @@ install: includes services hdboot nbsd_fetch: export CVS_RSH=ssh; \ echo "retrieving hierarchies from ${NBSD_CVSROOT}"; \ - for d in `awk '{print $$2;}' < nbsd_ports`; \ - do echo "retrieving $$d .."; \ - cd ${MINIXSRCDIR} && cvs -q -d ${NBSD_CVSROOT} co -N -d nbsdsrc $$d; \ + IFS=,; \ + cat nbsd_ports | grep -v '^#' | while read port ; \ + do set $$port; \ + date=$$1; minixpath=$$2; origpath=$$3; \ + if [ $$# -lt 3 ]; then origpath=$$2; fi; \ + echo "retrieving $$origpath .."; \ + cd ${MINIXSRCDIR} && cvs -q -d ${NBSD_CVSROOT} co -N -D "$$date UTC" -d nbsdsrc "src/$$origpath" ; \ done nbsd_diff: - cd ${MINIXSRCDIR} && awk '{ system("sh tools/nbsd_diff.sh " \ - "nbsdsrc/"$$2" "$$1" "$$1"/minix-port.patch");}' < tools/nbsd_ports + find ${MINIXSRCDIR} -name minix-port.patch | xargs rm + cat nbsd_ports | grep -v '^#' | \ + ( cd ${MINIXSRCDIR} && awk -F, '{ minixpath=$$2; origpath=$$3; if(NF < 3) { origpath=$$2; } system("sh tools/nbsd_diff.sh " \ + "nbsdsrc/src/"origpath" "minixpath" "minixpath"/minix-port.patch");}' ) + find ${MINIXSRCDIR} -name minix-port.patch | xargs wc -l | sort -n # clean up compile results diff --git a/tools/nbsd_diff.sh b/tools/nbsd_diff.sh index 11cfbea7f..d0edb06ac 100644 --- a/tools/nbsd_diff.sh +++ b/tools/nbsd_diff.sh @@ -1,6 +1,15 @@ #!/bin/sh -echo "Updating $3" -diff -ru $1 $2 | \ +diff=$3 +rm -f "$diff" +if [ ! -d "$1" -o ! -d "$2" ] +then echo Skipping $diff + exit 0 +fi +diff -aru $1 $2 | \ sed /"^Only in"/d | \ sed -e 's/^\(---.*\)\t.*/\1/' | \ - sed -e 's/^\(\+\+\+.*\)\t.*/\1/' > $3 + sed -e 's/^\(\+\+\+.*\)\t.*/\1/' > $diff + +if [ ! -s "$diff" ] +then rm -f "$diff" +fi diff --git a/tools/nbsd_ports b/tools/nbsd_ports index fcbdf626b..ea9ee9469 100644 --- a/tools/nbsd_ports +++ b/tools/nbsd_ports @@ -1,56 +1,59 @@ -external/public-domain/xz src/external/public-domain/xz -usr.bin/gzip src/usr.bin/gzip -bin/date src/bin/date -common/lib/libprop src/common/lib/libprop -include/ufs src/sys/ufs -sbin/newfs_ext2fs src/sbin/newfs_ext2fs -sbin/fsck_ext2fs src/sbin/fsck_ext2fs -lib/libprop src/lib/libprop -common/include/arch/x86 src/sys/arch/x86/include -common/include/arch/i386 src/sys/arch/i386/include -common/include src/common/include -common/lib/libc src/common/lib/libc -lib/libc src/lib/libc -lib/libm src/lib/libm -lib/libcrypt src/lib/libcrypt -lib/libterminfo src/lib/libterminfo -lib/libcurses src/lib/libcurses -lib/libutil src/lib/libutil -common/lib/libutil src/common/lib/libutil -lib/libbz2 src/lib/libbz2 -include src/include -bin/mkdir src/bin/mkdir -bin/rm src/bin/rm -bin/rmdir src/bin/rmdir -usr.sbin/fsck src/usr.sbin/fsck -usr.bin/chpass src/usr.bin/chpass -usr.bin/m4 src/usr.bin/m4 -usr.bin/indent src/usr.bin/indent -usr.bin/sed src/usr.bin/sed -usr.bin/stat src/usr.bin/stat -usr.bin/tic src/usr.bin/tic -usr.bin/mkdep src/usr.bin/mkdep -usr.bin/newgrp src/usr.bin/newgrp -usr.bin/uniq src/usr.bin/uniq -usr.bin/seq src/usr.bin/seq -usr.bin/du src/usr.bin/du -usr.bin/man src/usr.bin/man -usr.bin/apropos src/usr.bin/apropos -usr.bin/mdocml src/external/bsd/mdocml -usr.sbin/installboot src/usr.sbin/installboot -usr.sbin/pwd_mkdb src/usr.sbin/pwd_mkdb -usr.sbin/user src/usr.sbin/user -usr.sbin/vipw src/usr.sbin/vipw -usr.sbin/zic src/usr.sbin/zic -usr.bin/bzip2 src/usr.bin/bzip2 -usr.bin/bzip2recover src/usr.bin/bzip2recover -libexec/makewhatis src/libexec/makewhatis -dist/bzip2 src/dist/bzip2 -share/zoneinfo src/share/zoneinfo -sys/arch/i386/stand/bootxx src/sys/arch/i386/stand/bootxx -sys/arch/i386/stand/boot src/sys/arch/i386/stand/boot -sys/arch/i386/stand/cdboot src/sys/arch/i386/stand/cdboot -sys/arch/i386/stand/mbr src/sys/arch/i386/stand/mbr -sys/arch/i386/stand/lib src/sys/arch/i386/stand/lib -sys/lib/libsa src/sys/lib/libsa -sys/lib/libz src/sys/lib/libz +# Format: +# Timestamp in UTC,minixpath,netbsdpath +# minixpath: path in Minix source tree (starting from /usr/src/) +# netbsdpath: path in BSD source tree (starting from src/) +2012/02/10 16:16:12,share/zoneinfo +2011/05/26 00:00:00,external/public-domain/xz +2011/09/30 01:32:21,usr.bin/gzip +2011/08/27 12:55:09,bin/date +2011/10/17 09:24:54,common/lib/libprop +2011/11/28 12:50:07,include/ufs,sys/ufs +2010/09/10 15:51:20,sbin/newfs_ext2fs +2011/09/16 16:13:18,sbin/fsck_ext2fs +2011/09/30 22:08:19,lib/libprop +2011/08/30 12:39:55,common/include/arch/i386,sys/arch/i386/include +2011/11/13 22:19:09,common/include +2011/01/17 18:11:10,common/lib/libc +2011/01/21 23:36:49,lib/libc +2011/01/12 23:03:56,lib/libm +2009/05/01 00:28:17,lib/libcrypt +2010/10/12 12:57:51,lib/libterminfo +2011/01/06 11:29:40,lib/libcurses +2010/12/22 09:12:28,lib/libutil +2009/05/13 02:50:31,common/lib/libutil +2008/08/29 00:02:22,lib/libbz2 +2011/01/21 23:36:49,include +2008/07/20 00:52:40,bin/mkdir +2011/08/29 14:48:46,bin/rm +2011/08/29 14:49:38,bin/rmdir +2011/06/09 21:23:29,sbin/fsck +2009/04/11 12:10:02,usr.bin/chpass +2010/05/14 17:14:28,usr.bin/m4 +2011/01/12 06:17:52,usr.bin/indent +2010/02/19 16:35:27,usr.bin/sed +2011/01/15 22:54:10,usr.bin/stat +2010/02/22 23:05:39,usr.bin/tic +2010/10/15 05:46:48,usr.bin/mkdep +2010/05/14 17:28:23,usr.bin/newgrp +2010/10/06 07:59:18,usr.bin/uniq +2010/05/27 08:40:19,usr.bin/seq +2011/09/01 13:37:33,usr.bin/du +2010/07/07 21:24:34,usr.bin/man +2009/05/08 12:48:43,usr.bin/apropos +2011/01/12 23:02:22,usr.bin/mdocml,external/bsd/mdocml +2011/11/03 20:46:41,usr.sbin/installboot +2011/01/04 10:01:51,usr.sbin/pwd_mkdb +2011/01/04 10:30:21,usr.sbin/user +2009/04/19 00:44:49,usr.sbin/vipw +2009/04/22 15:23:10,usr.sbin/zic +2007/05/28 12:06:24,usr.bin/bzip2 +2007/05/28 12:06:25,usr.bin/bzip2recover +2009/04/02 21:39:33,libexec/makewhatis +2010/05/14 16:43:34,dist/bzip2 +2011/08/17 00:07:38,sys/arch/i386/stand/bootxx +2011/12/25 06:09:09,sys/arch/i386/stand/boot +2011/05/20 22:29:55,sys/arch/i386/stand/cdboot +2011/09/21 18:15:59,sys/arch/i386/stand/mbr +2011/11/28 07:56:54,sys/arch/i386/stand/lib +2012/01/16 18:47:57,sys/lib/libsa +2011/10/30 00:28:57,sys/lib/libz -- 2.44.0