[arch-commits] Commit in java7-openjdk/trunk (PKGBUILD)

Guillaume Alaux guillaume at nymeria.archlinux.org
Sun May 11 13:43:50 UTC 2014


    Date: Sunday, May 11, 2014 @ 15:43:50
  Author: guillaume
Revision: 212283

Use array for backup files

Modified:
  java7-openjdk/trunk/PKGBUILD

----------+
 PKGBUILD |   92 +++++++++++++++++++++++--------------------------------------
 1 file changed, 35 insertions(+), 57 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2014-05-11 12:50:20 UTC (rev 212282)
+++ PKGBUILD	2014-05-11 13:43:50 UTC (rev 212283)
@@ -135,28 +135,30 @@
               'java-rhino: for some JavaScript support')
   provides=('java-runtime-headless=7')
   conflicts=('openjdk6')
-  backup=(etc/profile.d/jre.sh
-          etc/profile.d/jre.csh
-          etc/java-7-openjdk/calendars.properties
-          etc/java-7-openjdk/content-types.properties
-          etc/java-7-openjdk/cursors/cursors.properties
-          etc/java-7-openjdk/flavormap.properties
-          etc/java-7-openjdk/fontconfig.bfc
-          etc/java-7-openjdk/fontconfig.properties
-          etc/java-7-openjdk/jvm.cfg
-          etc/java-7-openjdk/logging.properties
-          etc/java-7-openjdk/management/jmxremote.access
-          etc/java-7-openjdk/management/jmxremote.password
-          etc/java-7-openjdk/management/management.properties
-          etc/java-7-openjdk/management/snmp.acl
-          etc/java-7-openjdk/net.properties
-          etc/java-7-openjdk/psfont.properties.ja
-          etc/java-7-openjdk/psfontj2d.properties
-          etc/java-7-openjdk/security/java.policy
-          etc/java-7-openjdk/security/java.security
-          etc/java-7-openjdk/security/nss.cfg
-          etc/java-7-openjdk/sound.properties
-          etc/java-7-openjdk/tz.properties)
+  # Upstream config files that should go to etc and get backup
+  _backup_etc=(etc/java-7-openjdk/${_JARCH}/jvm.cfg
+               etc/java-7-openjdk/calendars.properties
+               etc/java-7-openjdk/content-types.properties
+               etc/java-7-openjdk/flavormap.properties
+               etc/java-7-openjdk/fontconfig.bfc
+               etc/java-7-openjdk/fontconfig.properties
+               etc/java-7-openjdk/images/cursors/cursors.properties
+               etc/java-7-openjdk/logging.properties
+               etc/java-7-openjdk/management/jmxremote.access
+               etc/java-7-openjdk/management/jmxremote.password
+               etc/java-7-openjdk/management/management.properties
+               etc/java-7-openjdk/management/snmp.acl
+               etc/java-7-openjdk/net.properties
+               etc/java-7-openjdk/psfont.properties.ja
+               etc/java-7-openjdk/psfontj2d.properties
+               etc/java-7-openjdk/security/java.policy
+               etc/java-7-openjdk/security/java.security
+               etc/java-7-openjdk/security/nss.cfg
+               etc/java-7-openjdk/sound.properties
+               etc/java-7-openjdk/tz.properties)
+  backup=(${_backup_etc[@]}
+          etc/profile.d/jre.sh
+          etc/profile.d/jre.csh)
   install=jre7-openjdk-headless.install
 
   cd "${srcdir}/${_imgdir}/jre"
@@ -210,43 +212,19 @@
 
   # link license
   ln -sf /usr/share/licenses/${pkgbase} "${pkgdir}/usr/share/licenses/${pkgname}"
-		 
-  # Put some more files under backup control
-  install -m755 -d ${pkgdir}/etc/java-7-openjdk/
-  install -m644 ${pkgdir}${_jvmdir}/jre/lib/*.properties* ${pkgdir}/etc/java-7-openjdk/
-  # install dummy links to make them found by JAVA
-  cd ${pkgdir}${_jvmdir}/jre/lib/
-  for file in `ls ${pkgdir}/etc/java-7-openjdk/*.properties*`; do
-    ln -vsf /etc/java-7-openjdk/`basename $file` .
+
+  # Copy these template so that they can be used in _backup_etc
+  ln -fs lib/management/jmxremote.password.template lib/management/jmxremote.password
+  ln -fs lib/management/snmp.acl.template lib/management/snmp.acl
+
+  # Move config files that were set in _backup_etc from ./lib to /etc
+  for file in ${_backup_etc[@]}; do
+    _filepkgpath=${_jvmdir}/jre/lib/${file#etc/java-7-openjdk/}
+    install -D -m 644 "${pkgdir}${_filepkgpath}" "${pkgdir}/${file}"
+    ln -sf /${file} "${pkgdir}${_filepkgpath}"
   done
-  # some more
-  install -m755 -d ${pkgdir}/etc/java-7-openjdk/{cursors,management,security}
-  install -m644 ${pkgdir}${_jvmdir}/jre/lib/images/cursors/cursors.properties \
-                ${pkgdir}/etc/java-7-openjdk/cursors/
-  pushd ${pkgdir}${_jvmdir}/jre/lib/images/cursors/
-    ln -vsf /etc/java-7-openjdk/cursors/cursors.properties .
-  popd
-  mv ${pkgdir}${_jvmdir}/jre/lib/management/jmxremote.password.template \
-     ${pkgdir}${_jvmdir}/jre/lib/management/jmxremote.password
-  mv ${pkgdir}${_jvmdir}/jre/lib/management/snmp.acl.template \
-     ${pkgdir}${_jvmdir}/jre/lib/management/snmp.acl
-  install -m644 ${pkgdir}${_jvmdir}/jre/lib/management/{management.properties,jmxremote.access,jmxremote.password,snmp.acl} \
-                ${pkgdir}/etc/java-7-openjdk/management/
-  pushd ${pkgdir}${_jvmdir}/jre/lib/management
-    ln -vsf /etc/java-7-openjdk/management/{management.properties,jmxremote.access,jmxremote.password,snmp.acl} .
-  popd
-  install -m644 ${pkgdir}${_jvmdir}/jre/lib/security/{java.policy,java.security,nss.cfg} \
-                ${pkgdir}/etc/java-7-openjdk/security/
-  pushd ${pkgdir}${_jvmdir}/jre/lib/security
-    ln -vsf /etc/java-7-openjdk/security/{java.policy,java.security,nss.cfg} .
-  popd
-  install -m644 ${pkgdir}${_jvmdir}/jre/lib/fontconfig.bfc ${pkgdir}/etc/java-7-openjdk/
-  install -m644 ${pkgdir}${_jvmdir}/jre/lib/${_JARCH}/jvm.cfg ${pkgdir}/etc/java-7-openjdk/
-  pushd ${pkgdir}${_jvmdir}/jre/lib/${_JARCH}/
-     ln -vsf /etc/java-7-openjdk/jvm.cfg .
-  popd
 }
-	 
+
 package_jre7-openjdk() {
   pkgdesc='OpenJDK Java 7 full runtime environment'
   depends=('jre7-openjdk-headless' 'xdg-utils' 'hicolor-icon-theme')




More information about the arch-commits mailing list