public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* cygport pkgcheck
@ 2006-06-06 19:44 Reini Urban
  2006-06-07  0:34 ` Yaakov S (Cygwin Ports)
  0 siblings, 1 reply; 4+ messages in thread
From: Reini Urban @ 2006-06-06 19:44 UTC (permalink / raw)
  To: Cygwin List

[-- Attachment #1: Type: text/plain, Size: 448 bytes --]

Hi Yaakov,

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.

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

-- 
Reini

[-- Attachment #2: cygport-0.1.93.diff --]
[-- Type: text/plain, Size: 2021 bytes --]

--- /usr/bin/cygport	2006-05-12 01:27:53.000000000 +0000
+++ cygport	2006-06-06 18:29:15.445500000 +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,39 @@
 	done
 }
 
+pkg_pkgcheck() {
+	echo ">>> Checking missing/duplicate files for all binary packages"
+	cd ${D}
+	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/nul) ]
+	then
+	    rm $tmp1 $tmp2
+	else
+	    # duplicate headers should be silently ignored
+	    diff -u0 "$tmp2" "$tmp1" | grep -E -v '^@' > "${T}/pkgcheck.diff"
+	    if grep -E '^+usr/include.*\.h$' ${T}/pkgcheck.diff > /dev/null
+	    then
+		warning "some files might be missing/duplicate in the distribution"
+		cat ${T}/pkgcheck.diff
+   	    else
+	        echo "some duplicate headers might be ignored"
+	    fi
+	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 +1108,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 +1267,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)


[-- Attachment #3: Type: text/plain, Size: 218 bytes --]

--
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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: cygport pkgcheck
  2006-06-06 19:44 cygport pkgcheck Reini Urban
@ 2006-06-07  0:34 ` Yaakov S (Cygwin Ports)
  2006-06-07  9:14   ` Reini Urban
  0 siblings, 1 reply; 4+ messages in thread
From: Yaakov S (Cygwin Ports) @ 2006-06-07  0:34 UTC (permalink / raw)
  To: cygwin

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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.

Thanks,


Yaakov


P.S. Now that I think about it, it might be a good idea to have a
similar function that checks for _forgotten_ files, i.e. those that were
not included in any package.  PTC.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEhhujpiWmPGlmQSMRArpKAKDorhQ7zg5Xxa4XSYboLs3cuGpjgQCffaKE
JO0gw3jou5E7MkcWIIflWiM=
=ZXi0
-----END PGP SIGNATURE-----

--
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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: cygport pkgcheck
  2006-06-07  0:34 ` Yaakov S (Cygwin Ports)
@ 2006-06-07  9:14   ` Reini Urban
  2006-06-14 21:52     ` Yaakov S (Cygwin Ports)
  0 siblings, 1 reply; 4+ messages in thread
From: Reini Urban @ 2006-06-07  9:14 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 983 bytes --]

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

[-- Attachment #2: cygport-0.1.93-2.diff --]
[-- Type: text/plain, Size: 2121 bytes --]

--- /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)

[-- Attachment #3: cygport-README-0.1.93-2.diff --]
[-- Type: text/plain, Size: 553 bytes --]

--- /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.


[-- Attachment #4: Type: text/plain, Size: 218 bytes --]

--
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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: cygport pkgcheck
  2006-06-07  9:14   ` Reini Urban
@ 2006-06-14 21:52     ` Yaakov S (Cygwin Ports)
  0 siblings, 0 replies; 4+ messages in thread
From: Yaakov S (Cygwin Ports) @ 2006-06-14 21:52 UTC (permalink / raw)
  To: cygwin

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Reini Urban wrote:
> Attached is the new version.
> No ChangeLog, ... entries.

Incorporated into CVS.  Thanks for the patch.


Yaakov
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEkHv8piWmPGlmQSMRAmdRAKDWY7qQks2l+rq2Ru8nwoStpNmb2wCePoP2
9ZHi/4I0SBuh24ilvcCpK/w=
=/uBe
-----END PGP SIGNATURE-----

--
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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-06-14 21:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-06 19:44 cygport pkgcheck Reini Urban
2006-06-07  0:34 ` Yaakov S (Cygwin Ports)
2006-06-07  9:14   ` Reini Urban
2006-06-14 21:52     ` Yaakov S (Cygwin Ports)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).