--- eclass/java-osgi.eclass 2008-01-14 18:06:06.000000000 +0100 +++ eclass/java-osgi.eclass 2008-01-22 22:09:47.000000000 +0100 @@ -56,7 +56,7 @@ _java-osgi_plugin() { # We hardcode Gentoo as the vendor name - cat > "${_OSGI_T}/tmp_jar/plugin.properties" <<-EOF + cat > "${_OSGI_T}/osgi/plugin.properties" <<-EOF bundleName="${1}" vendorName="Gentoo" EOF @@ -85,13 +85,9 @@ local absoluteJarPath="$(_canonicalise ${1})" local jarName="$(basename ${1})" - mkdir "${_OSGI_T}/tmp_jar" || die "Unable to create directory ${_OSGI_T}/tmp_jar" [[ -d "${_OSGI_T}/osgi" ]] || mkdir "${_OSGI_T}/osgi" || die "Unable to create directory ${_OSGI_T}/osgi" - cd "${_OSGI_T}/tmp_jar" && jar xf "${absoluteJarPath}" && cd - > /dev/null \ - || die "Unable to uncompress correctly the original jar" - - cat > "${_OSGI_T}/tmp_jar/META-INF/MANIFEST.MF" <<-EOF + cat > "${_OSGI_T}/osgi/MANIFEST.MF" <<-EOF Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %bundleName @@ -104,9 +100,10 @@ _java-osgi_plugin "${3}" - jar cfm "${_OSGI_T}/osgi/${jarName}" "${_OSGI_T}/tmp_jar/META-INF/MANIFEST.MF" \ - -C "${_OSGI_T}/tmp_jar/" . > /dev/null || die "Unable to recreate the OSGi compliant jar" - rm -rf "${_OSGI_T}/tmp_jar" + cp "${absoluteJarPath}" "${_OSGI_T}/osgi" + jar ufm "${_OSGI_T}/osgi/${jarName}" "${_OSGI_T}/osgi/MANIFEST.MF" \ + -C "${_OSGI_T}/osgi/" plugin.properties \ + || die "Unable to update jar to be OSGi compliant" } # ----------------------------------------------------------------------------- @@ -193,28 +190,25 @@ local absoluteJarPath="$(_canonicalise ${1})" local jarName="$(basename ${1})" - mkdir "${_OSGI_T}/tmp_jar" || die "Unable to create directory ${_OSGI_T}/tmp_jar" [[ -d "${_OSGI_T}/osgi" ]] || mkdir "${_OSGI_T}/osgi" || die "Unable to create directory ${_OSGI_T}/osgi" - cd "${_OSGI_T}/tmp_jar" && jar xf "${absoluteJarPath}" && cd - > /dev/null \ - || die "Unable to uncompress correctly the original jar" - [[ -e "${2}" ]] || die "Manifest file ${2} not found" # We automatically change the version if automatic version rewriting is on if (( ${4} )); then cat "${2}" | sed "s/Bundle-Version:.*/Bundle-Version: ${PV}/" > \ - "${_OSGI_T}/tmp_jar/META-INF/MANIFEST.MF" + "${_OSGI_T}/osgi/MANIFEST.MF" else - cat "${2}" > "${_OSGI_T}/tmp_jar/META-INF/MANIFEST.MF" + cat "${2}" > "${_OSGI_T}/osgi/MANIFEST.MF" fi _java-osgi_plugin "${3}" - jar cfm "${_OSGI_T}/osgi/${jarName}" "${_OSGI_T}/tmp_jar/META-INF/MANIFEST.MF" \ - -C "${_OSGI_T}/tmp_jar/" . > /dev/null || die "Unable to recreate the OSGi compliant jar" - rm -rf "${_OSGI_T}/tmp_jar" + cp "${absoluteJarPath}" "${_OSGI_T}/osgi" + jar ufm "${_OSGI_T}/osgi/${jarName}" "${_OSGI_T}/osgi/MANIFEST.MF" \ + -C "${_OSGI_T}/osgi/" plugin.properties \ + || die "Unable to update jar to be OSGi compliant" } # -----------------------------------------------------------------------------