[pkg-java] r11789 - in trunk/maven-repo-helper: debian src/main/share src/test/java/org/debian/maven/repo src/test/resources

Ludovic Claude ludovicc-guest at alioth.debian.org
Mon Mar 1 21:20:33 UTC 2010


Author: ludovicc-guest
Date: 2010-03-01 21:20:31 +0000 (Mon, 01 Mar 2010)
New Revision: 11789

Added:
   trunk/maven-repo-helper/src/test/resources/servlet-api.cleaned
   trunk/maven-repo-helper/src/test/resources/servlet-api.pom
Modified:
   trunk/maven-repo-helper/debian/changelog
   trunk/maven-repo-helper/src/main/share/mh_lib.sh
   trunk/maven-repo-helper/src/test/java/org/debian/maven/repo/POMCleanerTest.java
Log:
A leak of environment variables activated the no-rules option
on mh_cleanpom, preventing mh_installjar to work properly
in some cases (Closes: #570863)

Modified: trunk/maven-repo-helper/debian/changelog
===================================================================
--- trunk/maven-repo-helper/debian/changelog	2010-03-01 20:54:42 UTC (rev 11788)
+++ trunk/maven-repo-helper/debian/changelog	2010-03-01 21:20:31 UTC (rev 11789)
@@ -1,3 +1,11 @@
+maven-repo-helper (1.0.2) unstable; urgency=low
+
+  * A leak of environment variables activated the no-rules option
+    on mh_cleanpom, preventing mh_installjar to work properly
+    in some cases (Closes: #570863)
+
+ -- Ludovic Claude <ludovic.claude at laposte.net>  Mon, 01 Mar 2010 00:46:16 +0100
+
 maven-repo-helper (1.0.1) unstable; urgency=low
 
   * Bump up Standards-Version to 3.8.4

Modified: trunk/maven-repo-helper/src/main/share/mh_lib.sh
===================================================================
--- trunk/maven-repo-helper/src/main/share/mh_lib.sh	2010-03-01 20:54:42 UTC (rev 11788)
+++ trunk/maven-repo-helper/src/main/share/mh_lib.sh	2010-03-01 21:20:31 UTC (rev 11789)
@@ -4,12 +4,17 @@
 # - package selection
 #
 
-MH_VERSION=${MH_VERSION:-0.7}
+MH_VERSION=${MH_VERSION:-1.0.2}
 CLASSPATH=/usr/share/java/stax-api.jar:/usr/share/java/stax.jar:/usr/share/java/xml-apis.jar:/usr/share/java/maven-repo-helper.jar
 JAVA_OPTIONS="-Djavax.xml.stream.XMLOutputFactory=com.bea.xml.stream.XMLOutputFactoryBase -Djavax.xml.stream.XMLInputFactory=com.bea.xml.stream.MXParserFactory"
 
 parseargs()
 {
+   # clean arguments from a previous run
+   set | grep "^opt_.*=" | echo $(sed -e 's/\(opt_.*\)=.*$/unset \1;/') > .cleanargs
+   . .cleanargs
+   rm .cleanargs
+
    ARGC=0
    ARGV=()
    while [ -n "$1" ]; do

Modified: trunk/maven-repo-helper/src/test/java/org/debian/maven/repo/POMCleanerTest.java
===================================================================
--- trunk/maven-repo-helper/src/test/java/org/debian/maven/repo/POMCleanerTest.java	2010-03-01 20:54:42 UTC (rev 11788)
+++ trunk/maven-repo-helper/src/test/java/org/debian/maven/repo/POMCleanerTest.java	2010-03-01 21:20:31 UTC (rev 11789)
@@ -206,6 +206,26 @@
         assertEquals("debian", pomInfo.get("debianVersion"));
     }
 
+    /**
+     * Test of cleanPom method, of class POMCleaner.
+     */
+    public void testCleanServletApiPom() throws Exception {
+        pomProperties = new File(testDir, "pom.properties");
+        usePom("servlet-api.pom");
+        boolean noParent = true;
+        POMCleaner instance = new POMCleaner();
+        instance.addDefaultRules();
+        instance.addRule(new DependencyRule("s/org.apache.tomcat/javax.servlet/ servlet-api jar s/.*/2.5/"));
+        instance.cleanPom(pom, updatedPom, pomProperties, noParent, false, null, "libservlet2.5-java");
+        assertXMLEqual(read("servlet-api.cleaned"), read(updatedPom));
+        Properties pomInfo = new Properties();
+        pomInfo.load(new FileInputStream(pomProperties));
+        assertEquals("javax.servlet", pomInfo.get("groupId"));
+        assertEquals("servlet-api", pomInfo.get("artifactId"));
+        assertEquals("jar", pomInfo.get("type"));
+        assertEquals("2.5", pomInfo.get("version"));
+        assertEquals("2.5", pomInfo.get("debianVersion"));
+    }
 
     /**
      * Test of main method, of class DebianPOM.

Added: trunk/maven-repo-helper/src/test/resources/servlet-api.cleaned
===================================================================
--- trunk/maven-repo-helper/src/test/resources/servlet-api.cleaned	                        (rev 0)
+++ trunk/maven-repo-helper/src/test/resources/servlet-api.cleaned	2010-03-01 21:20:31 UTC (rev 11789)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>javax.servlet</groupId>
+  <artifactId>servlet-api</artifactId>
+  <version>2.5</version>
+  <packaging>jar</packaging>
+
+  <properties>
+    <debian.originalVersion>2.5</debian.originalVersion>
+    <debian.package>libservlet2.5-java</debian.package>
+    <debian.mavenRules><![CDATA[s/org.apache.tomcat/javax.servlet/ servlet-api jar s/.*/2.5/ *]]></debian.mavenRules>
+  </properties>
+
+  <description>javax.servlet package</description>
+</project>

Added: trunk/maven-repo-helper/src/test/resources/servlet-api.pom
===================================================================
--- trunk/maven-repo-helper/src/test/resources/servlet-api.pom	                        (rev 0)
+++ trunk/maven-repo-helper/src/test/resources/servlet-api.pom	2010-03-01 21:20:31 UTC (rev 11789)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.tomcat</groupId>
+  <artifactId>servlet-api</artifactId>
+  <version>2.5</version>
+  <description>javax.servlet package</description>
+</project>




More information about the pkg-java-commits mailing list