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