[SCM] eclipse - Powerful IDE written in java - Debian package. branch, master, updated. 800f9363d5bf9fd801b4ac36365727848b2bbdcf

Niels Thykier nthykier-guest at alioth.debian.org
Mon Feb 22 20:59:35 UTC 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "eclipse - Powerful IDE written in java - Debian package.".

The branch, master has been updated
       via  800f9363d5bf9fd801b4ac36365727848b2bbdcf (commit)
      from  684640d5928d4c36a63f51918c49f7607fcbaf25 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 800f9363d5bf9fd801b4ac36365727848b2bbdcf
Author: Niels Thykier <niels at thykier.net>
Date:   Mon Feb 22 21:59:30 2010 +0100

    Reinstated unjar-jar and updated repack-eclipse.

-----------------------------------------------------------------------

Summary of changes:
 debian/extra/repack-eclipse |    3 +-
 debian/extra/unjar-jar      |   69 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 70 insertions(+), 2 deletions(-)

diff --git a/debian/extra/repack-eclipse b/debian/extra/repack-eclipse
index df31bf7..0dac78e 100755
--- a/debian/extra/repack-eclipse
+++ b/debian/extra/repack-eclipse
@@ -29,5 +29,4 @@ for jar_file in $(cat removed-jars); do
 done
 
 # Replace source .jar files
-cd ..
-./unjar-jar -c eclipse/plugins
+../debian/extra/unjar-jar plugins/*.source_*.jar
diff --git a/debian/extra/unjar-jar b/debian/extra/unjar-jar
new file mode 100755
index 0000000..b451c9b
--- /dev/null
+++ b/debian/extra/unjar-jar
@@ -0,0 +1,69 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use Debian::Debhelper::Dh_Lib;
+
+my $tmp = undef;
+my $wdir = undef;
+
+$SIG{'INT'} = \&cleanup;
+$SIG{'TERM'} = \&cleanup;
+
+
+## we do not need the argument parsing...
+#init();
+inhibit_log();
+
+chomp($tmp = `mktemp -d`);
+chomp($wdir = `pwd`);
+
+map { map { repack($_); } glob($_); } @ARGV;
+
+cleanup();
+exit 0;
+
+
+sub repack {
+    my $file = shift;
+    my $mtime;
+    choke("$file does not exist") if( ! -e $file);
+    complex_doit("cd \"$tmp\" && jar xf \"$wdir/$file\"");
+
+    unlink($file) or choke("Unlinking $file: $!");
+    $mtime = (stat("$tmp/META-INF/MANIFEST.MF"))[9];
+    open(MANIFEST_ORIG, "<", "$tmp/META-INF/MANIFEST.MF") or choke("Opening $tmp/META-INF/MANIFEST.MF");
+    open(MANIFEST, ">", "$tmp/manifest") or choke("Opening $tmp/manifest: $!");
+    while( my $line = <MANIFEST_ORIG> ) {
+	chomp($line);
+	last if($line =~ m/^\s*$/o);
+	print MANIFEST "$line\n";
+    }
+    close(MANIFEST) or choke("Writing $tmp/manifest: $!");
+    close(MANIFEST_ORIG);
+    # Set both atime and mtime to mtime of original manifest.
+    utime($mtime, $mtime, "$tmp/manifest") or print STDERR "W: Could not set modification time of $tmp/manifest: $!";
+    complex_doit("cd \"$tmp\" && jar cmf \"$tmp/manifest\" \"$wdir/$file\"  && rm -fr \"$tmp/\"*");
+    info("Replaced $file");
+    return 1;
+}
+
+sub choke{
+    my $msg = shift;
+    cleanup();
+    error($msg);
+    exit 1;
+}
+
+sub info{
+    my $msg = shift;
+    print "I: $msg\n";
+}
+
+sub cleanup{
+    if(defined($tmp) && -d $tmp){
+	info("Removing $tmp");
+	system("rm -fr \"$tmp\"");
+    }
+}
+


hooks/post-receive
-- 
eclipse - Powerful IDE written in java - Debian package.



More information about the pkg-java-commits mailing list