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

Niels Thykier nthykier-guest at alioth.debian.org
Thu Nov 12 10:57:54 UTC 2009


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  972c2d6e36ec277036833c83e1d6d415712b49a9 (commit)
      from  b1acc83825a61c1451b1ca26d1078801eb609259 (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 972c2d6e36ec277036833c83e1d6d415712b49a9
Author: Niels Thykier <niels at thykier.net>
Date:   Thu Nov 12 11:57:48 2009 +0100

    Rewrote link script to handle features/ links.

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

Summary of changes:
 debian/extra/imagemv.pl |   56 +++++++++++++++++++++++++++++++++++++++++++++++
 debian/extra/imagemv.sh |   14 -----------
 debian/rules            |    2 +-
 3 files changed, 57 insertions(+), 15 deletions(-)

diff --git a/debian/extra/imagemv.pl b/debian/extra/imagemv.pl
new file mode 100755
index 0000000..6e3f217
--- /dev/null
+++ b/debian/extra/imagemv.pl
@@ -0,0 +1,56 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+my $dryrun = defined($ARGV[0]) && $ARGV[0] eq '--dry-run';
+
+while( my $image = <STDIN> ){
+    my $des;
+    my $desdir;
+    my $relpath;
+    my $linktarget;
+    chomp($image);
+    if( -l $image ){
+	# already a link - not touching
+	next;
+    }
+    if( ! -e $image ){
+	choke("Cannot \"mv + ln\" $image: it does not exists.");
+    }
+    # Remove the leading ./ (from find output).
+    $image =~ s@^./@@o;
+    $des = $image;
+    $des =~ s at lib/@share/@o;
+    if($des =~ m at eclipse/features/@o){
+	# They have some names that changes based on arch/build/something.
+	# So we will just remove that so the link is always correct.
+	# e.g. 
+	#   org.eclipse.help_1.1.1.R35x_v20090811-7e7eFAnFEx2XZoYwvOe8duD
+	# becomes
+	#   org.eclipse.help_1.1.1.R35x_v20090811
+	$des =~ s@(_)v\d{8}-[^/]++@$1 at o;
+    }
+    $desdir = $des;
+    # Remove the last part (the name of the file)
+    $desdir =~ s@[^/]++$@@o;
+    $relpath = $desdir;
+    # Replace path parts with ".."
+    $relpath =~ s@[^/]++ at ..@go;
+    # concat with the original target and we have
+    # the relative link - There is no / in between
+    # because $relpath already contains it.
+    $linktarget = "$relpath$des";
+    if($dryrun){
+	print "mkdir -p \"$desdir\" && mv -f \"$image\" \"$des\" && ln -s \"$linktarget\" \"$image\"\n";
+    } else {
+	system("mkdir -p \"$desdir\" && mv -f \"$image\" \"$des\" && ln -s \"$linktarget\" \"$image\"") == 0
+	    or choke("Could not complete link of $image.");
+    }
+}
+
+sub choke{
+    my $msg = shift;
+    print STDERR "$msg\n";
+    exit(1);
+}
diff --git a/debian/extra/imagemv.sh b/debian/extra/imagemv.sh
deleted file mode 100755
index a06a29a..0000000
--- a/debian/extra/imagemv.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/sh
-set -e
-
-# You must be in the destDir/prefix directory!
-
-LINK_NAME=$(echo $1 | sed "s@^\./@@")
-
-IMAGE_NAME=$(echo ${LINK_NAME} | sed "s at lib/@share/@g")
-IMAGE_DIR=$(dirname ${IMAGE_NAME})
-LINK_DEST=$(dirname ${LINK_NAME} | sed "s|[^/]*|..|g")/${IMAGE_NAME}
-
-mkdir -p "${IMAGE_DIR}"
-mv "${LINK_NAME}" "${IMAGE_NAME}"
-ln -sf "${LINK_DEST}" "${LINK_NAME}"
diff --git a/debian/rules b/debian/rules
index bfe7d87..c427be1 100755
--- a/debian/rules
+++ b/debian/rules
@@ -103,7 +103,7 @@ debian-install-stamp:
 	@echo "*** debian-install-stamp ***"
 	dh_testdir
 	# move images from /usr/lib to /usr/share
-	cd debian/tmp/usr && find lib/ -type f \( -name '*.bmp' -o -name '*.gif' -o -name '*.jpg' -o -name '*.png' \) -exec sh ../../../debian/extra/imagemv.sh '{}' \;
+	cd debian/tmp/usr && find lib/ -type f \( -name '*.bmp' -o -name '*.gif' -o -name '*.jpg' -o -name '*.png' \) | perl ../../../debian/extra/imagemv.pl
 	rm -fr $(DEBIAN_PACK_LIBDIR)/p2/
 	# Generate metadata and extract the swt libraries.
 	cd $(DEB_DESTDIR) && java \


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



More information about the pkg-java-commits mailing list