[SCM] UNNAMED PROJECT branch, master, updated. 0.37-4-g3973d88

Niels Thykier niels at thykier.net
Tue Jan 10 21:20:03 UTC 2012


The following commit has been merged in the master branch:
commit 3973d8837d937579e596eaff7c0c30e2ec57883d
Author: Niels Thykier <niels at thykier.net>
Date:   Tue Jan 10 22:13:32 2012 +0100

    jh_build: limit line length to 72 chars in manifests
    
    Some Jar implementations do not allow long lines and do not
    auto-correction for us.
    
    Also modified the way D::JH::Java re-writes long line to be consistent
    with the (new) regex used in jh_build.
    
    Signed-off-by: Niels Thykier <niels at thykier.net>

diff --git a/debian/changelog b/debian/changelog
index c485899..d2a0d9a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,9 @@ javatools (0.38) UNRELEASED; urgency=low
   * Fixed the "find" expressions in jh_repack to only remove files
     named "*.jar" or "*.class".  Thanks to Andrew Ross for the report.
     (Closes: #646514)
+  * Fixed a bug where jh_build would generate manifests with lines
+    longer than some jar implementations would allow.  Thanks to
+    Giovanni Mascellani for the report.  (Closes: #653412)
 
  -- Niels Thykier <niels at thykier.net>  Mon, 11 Jul 2011 15:20:40 +0200
 
diff --git a/jh_build b/jh_build
index 8fb495f..d61ca74 100755
--- a/jh_build
+++ b/jh_build
@@ -80,15 +80,17 @@ function dobuild()
 	fi
 
 	rm -f debian/_jh_manifest.$ext
-	touch debian/_jh_manifest.$ext
-	if [ -n "$CLASSPATH" ]; then
-		echo -n "Class-Path: " >> debian/_jh_manifest.$ext
-		echo $CLASSPATH | sed 's/:/ /g' >> debian/_jh_manifest.$ext
-	fi
-	if [ -n "`getarg m main`" ]; then
-		echo "Main-Class: `getarg m main`" >> debian/_jh_manifest.$ext
-		echo "Debian-Java-Home: $JAVA_HOME" >> debian/_jh_manifest.$ext
-	fi
+	(
+            if [ -n "$CLASSPATH" ]; then
+		echo -n "Class-Path: "
+		echo $CLASSPATH | sed 's/:/ /g'
+	    fi
+	    if [ -n "`getarg m main`" ]; then
+		echo "Main-Class: `getarg m main`"
+		echo "Debian-Java-Home: $JAVA_HOME"
+	    fi
+        ) | perl 's/(.{72})(?=.)/$1\n /go' >> debian/__jh_manifest.$ext
+        # (NB: see D::JH::Java::write_manifest_section_fd on the regex above)
 
    CLASSPATHDOCS="`for i in $(grep-dctrl --no-field-names --show-field Build-Depends,Build-Depends-Indep -F source "$pkg" debian/control | tr , ' ' | sed 's/([^)]*)//g') ; do dpkg -L $i 2>/dev/null | grep /usr/share/doc/.*/api$; done | sed 's/^/-link /' | xargs`"
 
diff --git a/lib/Debian/Javahelper/Java.pm b/lib/Debian/Javahelper/Java.pm
index 229c362..785dac7 100644
--- a/lib/Debian/Javahelper/Java.pm
+++ b/lib/Debian/Javahelper/Java.pm
@@ -223,10 +223,15 @@ sub write_manifest_section_fd{
     # return manifest-version and name first
     foreach my $entry ($sec->get_values()) {
 	my $line = join(": ", @$entry);
-	# Extend long lines.
-	# Technically this is incorrect since the rules says "bytes" and not "characters"
-	$line =~ s/(.{72})/$1\n /go;
-	$line =~ s/^ \n(\w)/$1/go;
+	# Extend long lines.  Technically this is incorrect since the
+	# rules says "bytes" and not "characters".
+	#
+	# (for future reference this is: Insert '\n ' after every 72
+	# chars, but only if there is a 73rd character following them)
+	#
+	# If you change this, remember to change jh_build as well,
+	# which also have this.
+	$line =~ s/(.{72})(?=.)/$1\n /go;
 	print $fd "$line\n";
     }
     print $fd "\n";

-- 
UNNAMED PROJECT



More information about the pkg-java-commits mailing list