aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sping@gentoo.org>2015-08-16 03:14:54 +0200
committerSebastian Pipping <sping@gentoo.org>2015-08-16 03:19:58 +0200
commit1d51e9a1a4a6e233332403b9584a49cc9352de38 (patch)
tree359e209bc3a42a4665e96804a75a138db542e2a0
parentdev-util/eclipse-sdk-bin: 4.5.0 (diff)
downloadeclipse-1d51e9a1a4a6e233332403b9584a49cc9352de38.tar.gz
eclipse-1d51e9a1a4a6e233332403b9584a49cc9352de38.tar.bz2
eclipse-1d51e9a1a4a6e233332403b9584a49cc9352de38.zip
dev-util/eclipse-sdk-bin: Fix unbundling
-rw-r--r--dev-util/eclipse-sdk-bin/eclipse-sdk-bin-4.5.0-r1.ebuild (renamed from dev-util/eclipse-sdk-bin/eclipse-sdk-bin-4.5.0.ebuild)23
1 files changed, 20 insertions, 3 deletions
diff --git a/dev-util/eclipse-sdk-bin/eclipse-sdk-bin-4.5.0.ebuild b/dev-util/eclipse-sdk-bin/eclipse-sdk-bin-4.5.0-r1.ebuild
index e8053ad..3a3a35d 100644
--- a/dev-util/eclipse-sdk-bin/eclipse-sdk-bin-4.5.0.ebuild
+++ b/dev-util/eclipse-sdk-bin/eclipse-sdk-bin-4.5.0-r1.ebuild
@@ -35,19 +35,36 @@ S="${WORKDIR}"/eclipse
_unbundle_single() {
local mode="${1}" destination_jar="${2}" package="${3}" package_jar="${4}"
+ local abs_destination_jar="${PWD}/${destination_jar}"
+ local backup_dir="${T}"/${destination_jar##*/}.dir
+
if [[ "${mode}" = delete ]]; then
+ # Backup META-INF/MANIFEST.MF with checksums
+ # Then delete .jar file
+ mkdir -p "${backup_dir}"/META-INF
+ unzip -p "${destination_jar}" META-INF/MANIFEST.MF \
+ | sed -e '/^Name:/d' -e '/^SHA1-Digest:/d' -e '/^\s*$/d' \
+ > "${backup_dir}"/META-INF/MANIFEST.MF || die
rm "${destination_jar}" || die
elif [[ "${mode}" = wire ]]; then
+ einfo "Replacing bundled ${destination_jar}..."
+ # Create new .jar based on system-wide build
+ # In the process, apply META-INF/MANIFEST.MF backup
java-pkg_jar-from "${package}" "${package_jar}" "${destination_jar}"
+ local source_jar="$(readlink -f "${destination_jar}")"
+ rm "${destination_jar}" || die
+
+ cp "${source_jar}" "${destination_jar}" || die
+ ( cd "${backup_dir}" \
+ && [[ -f "${abs_destination_jar}" ]] \
+ && zip "${abs_destination_jar}" META-INF/MANIFEST.MF >/dev/null
+ ) || die
fi
}
_unbundle_known() {
local mode="${1}"
- ewarn 'Unbundling broken, skipping.'
- return 0
-
# https://wiki.gentoo.org/wiki/Eclipse/Building_From_Source
_unbundle_single "${mode}" plugins/com.ibm.icu_54.1.1.v201501272100.jar icu4j-52 icu4j.jar log4j-1.2.8.jar
_unbundle_single "${mode}" plugins/javax.annotation_1.2.0.v201401042248.jar jsr250 jsr250.jar