public inbox for gentoo-java@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Petteri Räty" <betelgeuse@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: Gentoo Java <gentoo-java@lists.gentoo.org>
Subject: [gentoo-java] Adding pkg_preinst to java-utils-2 for QA purposes
Date: Sun, 16 Dec 2007 04:08:04 +0200	[thread overview]
Message-ID: <47648884.7040902@gentoo.org> (raw)


[-- 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 --]

                 reply	other threads:[~2007-12-16  2:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47648884.7040902@gentoo.org \
    --to=betelgeuse@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    --cc=gentoo-java@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox