This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cygport pkgcheck


Yaakov S (Cygwin Ports) schrieb:
Reini Urban wrote:
I added a function pkgcheck, which checks for duplicate and missing
files comparing inst to the generated binpkg files.
To check if the manually written pkg_names[] array is correct.
This is only useful for splitted packages.

I found it useful for postgresql, which is quite split up.
Maybe you want to look at it.

OK, sounds interesting.


Note: I allow duplicate /usr/include *.h files, because server and
client libs might want to share these.

I don't understand; if a file is present in more than one package, then you get all sorts of problems with clobbering, missing files, etc. This is a limitation of setup.exe that we have to deal with. A given file should be in one and only one package, period.

Unless I misunderstood you, could you please make a new patch without
that part of the code.

Agreed.


Attached is the new version.
No ChangeLog, ... entries.
--
Reini
--- /usr/bin/cygport	2006-05-12 01:27:53.000000000 +0000
+++ cygport	2006-06-07 06:50:03.648625000 +0000
@@ -15,7 +15,7 @@
 set -e
 
 declare -rx _name=cygport
-declare -r _version=0.1.93
+declare -r _version=0.1.94
 
 if [ -n "${CYGPORT_BOOTSTRAP}" -a -n "${top_srcdir}" ]
 then
@@ -903,6 +903,44 @@
 	done
 }
 
+pkg_pkgcheck() {
+	echo ">>> Checking missing/duplicate files for all binary packages"
+	cd ${D}
+	local _status=0
+	local tmp1="${T}/tmptar.log"
+	local tmp2="${T}/tmpfind.log"
+	[ -e $tmp1 ] && rm -f $tmp1
+	local n=0
+	while [ -n "${pkg_name[${n}]}" ]
+	do
+		tar tjf ${top}/${pkg_name[${n}]}-${PVR}.tar.bz2 | grep -Ev "/$" >> $tmp1
+		let n+=1
+	done
+        sort < $tmp1 > "$tmp1.sorted"
+	mv "$tmp1.sorted" $tmp1
+
+	cd ${D}
+        find * -type f -o -type l | sort > $tmp2
+	if diff -u0 "$tmp2" "$tmp1" > /dev/null
+	then
+	    rm $tmp1 $tmp2 && true
+	else
+	    # detect duplicates and missing files
+	    diff -u0 "$tmp2" "$tmp1" | grep -E -v '^@' > "${T}/pkgcheck.diff"
+	    if grep -E '^\+[^\+]' ${T}/pkgcheck.diff > /dev/null
+	    then
+		warning "duplicate files in the distribution:"
+		grep -E '^\+[^\+]' ${T}/pkgcheck.diff
+	    fi
+	    if grep -E '^-[^\-]' ${T}/pkgcheck.diff > /dev/null
+	    then
+		warning "missing files in the distribution:"
+		grep -E '^-[^\-]' ${T}/pkgcheck.diff
+	    fi
+	    false
+	fi
+}
+
 pkg_diff() {
 	local default_excludes="-x CYGWIN-PATCHES -x aclocal.m4* \
 		-x ltmain.sh -x config.* -x depcomp -x install-sh -x missing \
@@ -1075,7 +1113,7 @@
 }
 
 # protect functions
-readonly -f pkg_binpkg pkg_diff gpg_sign pkg_srcpkg pkg_dist finish
+readonly -f pkg_binpkg pkg_pkgcheck pkg_diff gpg_sign pkg_srcpkg pkg_dist finish
 
 
 ################################################################################
@@ -1234,7 +1272,12 @@
 			;;
 		package|pkg)
 			__stage Packaging
-			(pkg_binpkg && pkg_srcpkg && pkg_dist) | tee ${pkglog} 2>&1
+			(pkg_binpkg && pkg_pkgcheck && pkg_srcpkg && pkg_dist) | tee ${pkglog} 2>&1
+			_status=$?
+			;;
+    		pkgcheck)
+			__stage Package check
+			pkg_pkgcheck
 			_status=$?
 			;;
 		diff|mkdiff|mkpatch)
--- /usr/share/doc/cygport-0.1.93/README.orig	2006-05-12 01:28:05.000000000 +0000
+++ /usr/share/doc/cygport-0.1.93/README	2006-06-07 06:58:55.523625000 +0000
@@ -167,6 +167,7 @@
     list     - create a file listing suitable for the Cygwin README
     deps     - list direct dependencies of all executables
     dist     - copy packages into a directory structure suitable for upload
+    pkgcheck - check the binary packages for missing and duplicate files
 
 For compatibility, the sole arguments --help or --version may also be
 passed to cygport.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]