public inbox for gentoo-java@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-java] Adding pkg_preinst to java-utils-2 for QA purposes
@ 2007-12-16  2:08 Petteri Räty
  0 siblings, 0 replies; only message in thread
From: Petteri Räty @ 2007-12-16  2:08 UTC (permalink / raw
  To: gentoo-dev; +Cc: Gentoo Java


[-- Attachment #1.1: Type: text/plain, Size: 1213 bytes --]

I wrote a patch to add pkg_preinst to java-utils-2 to check the jars in
the images for problems in the jars but it can later be used for other
stuff too. If there are no objections we will need to modify the
following ebuilds as not to change their behavior. I will do this in
behalf of the maintainers in question so that all the changes go in at
the same time.

betelgeuse@pena /mnt/checkouts/java/scripts $ bash
find-function-usage-in-inheriting-ebuilds.sh --can-add --no-default
java-pkg-2 pkg_preinst
perl-module.eclass: dev-perl/Inline-Java/Inline-Java-0.50.ebuild
perl-module.eclass: dev-perl/Inline-Java/Inline-Java-0.51.ebuild
perl-module.eclass: dev-perl/Inline-Java/Inline-Java-0.52.ebuild

betelgeuse@pena /mnt/checkouts/java/scripts $ bash
find-function-usage-in-inheriting-ebuilds.sh --can-add --no-default
java-pkg-opt-2 pkg_preinst
perl-module.eclass: app-pda/pilot-link/pilot-link-0.12.2.ebuild
perl-module.eclass: dev-util/subversion/subversion-1.3.2-r3.ebuild
perl-module.eclass: dev-util/subversion/subversion-1.3.2-r4.ebuild

The script can be found in
https://overlays.gentoo.org/svn/proj/java/scripts/find-function-usage-in-inheriting-ebuilds.sh

Regards,
Petteri

[-- Attachment #1.2: java-pkg_preinst.patch --]
[-- Type: text/plain, Size: 1798 bytes --]

Index: java-utils-2.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v
retrieving revision 1.100
diff -u -r1.100 java-utils-2.eclass
--- java-utils-2.eclass	28 Nov 2007 02:03:48 -0000	1.100
+++ java-utils-2.eclass	16 Dec 2007 01:57:29 -0000
@@ -293,7 +295,6 @@
 	java-pkg_do_write_
 }
 
-
 # ------------------------------------------------------------------------------
 # @internal-function depend-java-query
 #
@@ -833,6 +830,30 @@
 }
 
 # ------------------------------------------------------------------------------
+# @eclass-pkg_preinst
+#
+# Checks jars in the image for problems.
+#
+# ------------------------------------------------------------------------------
+
+java-utils-2_pkg_preinst() {
+	debug-print-function ${FUNCNAME} "${@}"
+	is-java-strict || return
+
+	for jar in $(find "${D}" -name "*.jar"); do
+		for dep in $(unzip -p "${jar}" META-INF/MANIFEST.MF | egrep "^Class-Path:" | cut -d ":" -f 2); do
+			local dir=$(dirname "${jar}")
+			einfo "${dir}/${dep}" "${ROOT}${dir#${D}}/${dep}"
+			if [[ ! -e "${dir}/${dep}" && ! -e "${ROOT}${dir#${D}}/${dep}" ]]; then
+				eerror "${jar}"
+				eerror "has Class-Path entry in Manifest pointing at ${dep}"
+				eerror "but that file does not exist in image or ROOT=${ROOT}"
+			fi
+		done
+	done
+}
+
+# ------------------------------------------------------------------------------
 # @section-end install
 # ------------------------------------------------------------------------------
 
@@ -2729,6 +2760,8 @@
 	return $?
 }
 
+EXPORT_FUNCTIONS pkg_preinst
+
 # ------------------------------------------------------------------------------
 # @eclass-end
 # ------------------------------------------------------------------------------

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-12-16  2:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-16  2:08 [gentoo-java] Adding pkg_preinst to java-utils-2 for QA purposes Petteri Räty

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox