[med-svn] r10350 - in trunk/packages/netcdf-java/trunk/debian: . patches

Mathieu Malaterre malat at alioth.debian.org
Mon Apr 9 17:18:49 UTC 2012


Author: malat
Date: 2012-04-09 17:18:49 +0000 (Mon, 09 Apr 2012)
New Revision: 10350

Added:
   trunk/packages/netcdf-java/trunk/debian/patches/
   trunk/packages/netcdf-java/trunk/debian/patches/series
   trunk/packages/netcdf-java/trunk/debian/patches/sleepy.patch
Modified:
   trunk/packages/netcdf-java/trunk/debian/rules
Log:
First compilation of netcdf

Added: trunk/packages/netcdf-java/trunk/debian/patches/series
===================================================================
--- trunk/packages/netcdf-java/trunk/debian/patches/series	                        (rev 0)
+++ trunk/packages/netcdf-java/trunk/debian/patches/series	2012-04-09 17:18:49 UTC (rev 10350)
@@ -0,0 +1 @@
+sleepy.patch

Added: trunk/packages/netcdf-java/trunk/debian/patches/sleepy.patch
===================================================================
--- trunk/packages/netcdf-java/trunk/debian/patches/sleepy.patch	                        (rev 0)
+++ trunk/packages/netcdf-java/trunk/debian/patches/sleepy.patch	2012-04-09 17:18:49 UTC (rev 10350)
@@ -0,0 +1,196 @@
+Index: netcdf-4.3.8-BETA/cdm/src/main/java/thredds/inventory/CollectionManagerAbstract.java
+===================================================================
+--- netcdf-4.3.8-BETA.orig/cdm/src/main/java/thredds/inventory/CollectionManagerAbstract.java	2012-02-10 20:40:42.000000000 +0100
++++ netcdf-4.3.8-BETA/cdm/src/main/java/thredds/inventory/CollectionManagerAbstract.java	2012-04-09 18:02:51.000000000 +0200
+@@ -145,6 +145,9 @@
+     if (getCollectionName() == null) return; // eg no scan in ncml
+     try {
+       mm = new MetadataManager(getCollectionName());
++    } catch (com.sleepycat.je.DatabaseException e) {
++      e.printStackTrace();
++      throw new RuntimeException(e.getMessage());
+     } catch (IOException e) {
+       e.printStackTrace();
+       throw new RuntimeException(e.getMessage());
+Index: netcdf-4.3.8-BETA/cdm/src/main/java/thredds/inventory/bdb/MetadataManager.java
+===================================================================
+--- netcdf-4.3.8-BETA.orig/cdm/src/main/java/thredds/inventory/bdb/MetadataManager.java	2012-04-09 18:05:44.000000000 +0200
++++ netcdf-4.3.8-BETA/cdm/src/main/java/thredds/inventory/bdb/MetadataManager.java	2012-04-09 18:47:56.000000000 +0200
+@@ -155,7 +155,7 @@
+     }
+   }
+ 
+-  static public void showEnvStats(Formatter f) {
++  static public void showEnvStats(Formatter f) throws DatabaseException {
+     if (myEnv == null)
+       setup();
+ 
+@@ -176,12 +176,12 @@
+     return root;
+   }
+ 
+-  static public void sync() {
++  static public void sync() throws DatabaseException {
+     if (myEnv != null)
+       myEnv.sync();
+   }
+ 
+-  static public List<String> getCollectionNames() {
++  static public List<String> getCollectionNames() throws DatabaseException {
+     if (myEnv == null)
+       setup();
+     return myEnv.getDatabaseNames();
+@@ -198,7 +198,7 @@
+     myEnv.removeDatabase(null, collectionName);
+   }
+ 
+-  static public void delete(String collectionName, String key) {
++  static public void delete(String collectionName, String key) throws DatabaseException {
+     try {
+       MetadataManager mm = new MetadataManager(collectionName);
+       mm.delete(key);
+@@ -226,7 +226,7 @@
+   }
+ 
+   // assumes only one open at a time; could have MetadataManagers share open databases
+-  private void openDatabase() {
++  private void openDatabase() throws DatabaseException {
+     if (database != null) return;
+     DatabaseConfig dbConfig = new DatabaseConfig();
+     dbConfig.setReadOnly(readOnly);
+@@ -240,31 +240,39 @@
+ 
+   public void put(String key, String value) {
+     if (readOnly) return;
+-    openDatabase();
+     try {
++    openDatabase();
+       database.put(null, new DatabaseEntry(key.getBytes(UTF8)), new DatabaseEntry(value.getBytes(UTF8)));
+     } catch (UnsupportedEncodingException e) {
+       throw new RuntimeException(e.getMessage());
++    } catch (DatabaseException e) {
++      throw new RuntimeException(e.getMessage());
+     }
+   }
+ 
+   public void put(byte[] key, byte[] value) {
+     if (readOnly) return;
++try {
+     openDatabase();
+     database.put(null, new DatabaseEntry(key), new DatabaseEntry(value));
++    } catch (DatabaseException e) {
++      throw new RuntimeException(e.getMessage());
++}
+   }
+ 
+   public void put(String key, byte[] value) {
+     if (readOnly) return;
+-    openDatabase();
+     try {
++    openDatabase();
+       database.put(null, new DatabaseEntry(key.getBytes(UTF8)), new DatabaseEntry(value));
++    } catch (DatabaseException e) {
++      throw new RuntimeException(e.getMessage());
+     } catch (UnsupportedEncodingException e) {
+       throw new RuntimeException(e.getMessage());
+     }
+   }
+ 
+-  public byte[] get(byte[] key) {
++  public byte[] get(byte[] key) throws DatabaseException {
+     openDatabase();
+     DatabaseEntry value = new DatabaseEntry();
+     database.get(null, new DatabaseEntry(key), value, LockMode.DEFAULT);
+@@ -272,25 +280,29 @@
+   }
+ 
+   public byte[] getBytes(String key) {
+-    openDatabase();
+     try {
++    openDatabase();
+       DatabaseEntry value = new DatabaseEntry();
+       database.get(null, new DatabaseEntry(key.getBytes(UTF8)), value, LockMode.DEFAULT);
+       return value.getData();
++    } catch (DatabaseException e) {
++      throw new RuntimeException(e);
+     } catch (UnsupportedEncodingException e) {
+       throw new RuntimeException(e);
+     }
+   }
+ 
+   public String get(String key) {
+-    openDatabase();
+     try {
++    openDatabase();
+       DatabaseEntry value = new DatabaseEntry();
+       OperationStatus status = database.get(null, new DatabaseEntry(key.getBytes(UTF8)), value, LockMode.DEFAULT);
+       if (status == OperationStatus.SUCCESS)
+         return new String(value.getData(), UTF8);
+       else
+         return null;
++    } catch (DatabaseException e) {
++      throw new RuntimeException(e);
+     } catch (UnsupportedEncodingException e) {
+       throw new RuntimeException(e);
+     }
+@@ -302,8 +314,8 @@
+       return;
+     }
+ 
+-    openDatabase();
+     try {
++    openDatabase();
+       DatabaseEntry entry = new DatabaseEntry(theKey.getBytes("UTF-8"));
+       database.delete(null, entry);
+     } catch (Exception e) {
+@@ -317,7 +329,12 @@
+       return;
+     }
+     
++    try {
+     openDatabase();
++    } catch (Exception e) {
++      throw new RuntimeException(e);
++}
++
+     List<DatabaseEntry> result = new ArrayList<DatabaseEntry>();
+     Cursor myCursor = null;
+     try {
+@@ -350,6 +367,7 @@
+       }
+       logger.info("{} #files deleted = {}", collectionName, countDelete);
+ 
++    } catch (DatabaseException e) {
+     } catch (UnsupportedOperationException e) {
+       logger.error("Trying to delete " + collectionName, e);
+ 
+@@ -358,22 +376,28 @@
+ 
+     } finally {
+       if (null != myCursor)
++try {
+         myCursor.close();
++    } catch (DatabaseException e) {
++}
+     }
+ 
+   }
+ 
+   public void close() {
+     if (database != null) {
++try {
+       database.close();
++    } catch (DatabaseException e) {
++}
+       openDatabases.remove(this);
+       database = null;
+     }
+   }
+ 
+   public void showStats(Formatter f) {
+-    openDatabase();
+     try {
++    openDatabase();
+       DatabaseStats dstats = database.getStats(null);
+       f.format("primary stats %n%s%n", dstats);
+ 

Modified: trunk/packages/netcdf-java/trunk/debian/rules
===================================================================
--- trunk/packages/netcdf-java/trunk/debian/rules	2012-04-05 20:22:12 UTC (rev 10349)
+++ trunk/packages/netcdf-java/trunk/debian/rules	2012-04-09 17:18:49 UTC (rev 10350)
@@ -4,11 +4,11 @@
 JAVA_HOME=/usr/lib/jvm/default-java
 # libprotobuf-java 2.3.0 -> /usr/share/java/protobuf.jar
 # libprotobuf-java 2.4.1 -> /usr/share/java/protobuf-java.jar
-export CLASSPATH=/usr/share/java/quartz.jar:/usr/share/java/protobuf.jar:/usr/share/java/ehcache.jar:/usr/share/java/jdom1.jar:/usr/share/java/slf4j-api.jar:/usr/share/java/commons-httpclient.jar:/usr/share/java/protobuf-java.jar:/usr/share/java/joda-time.jar:/usr/share/java/db-je.jar
+export CLASSPATH=/usr/share/java/quartz.jar:/usr/share/java/protobuf.jar:/usr/share/java/ehcache.jar:/usr/share/java/jdom1.jar:/usr/share/java/slf4j-api.jar:/usr/share/java/commons-httpclient.jar:/usr/share/java/protobuf-java.jar:/usr/share/java/db-je.jar:/usr/share/java/joda-time.jar
 ANT_OPTS=-Dbuild.sysclasspath=first
 
 %:
-	dh $@ --sourcedirectory=cdm #--with ant
+	dh $@ --sourcedirectory=cdm --with javahelper
 
 override_dh_auto_build:
 	dh_auto_build -- $(ANT_OPTS) makeCore




More information about the debian-med-commit mailing list