[Pkg-haskell-commits] r1128 - in /packages/haskell-devscripts/trunk: debian/changelog dh_haskell_install

arjan at users.alioth.debian.org arjan at users.alioth.debian.org
Sat Mar 22 19:26:50 UTC 2008


Author: arjan
Date: Sat Mar 22 19:26:50 2008
New Revision: 1128

URL: http://svn.debian.org/wsvn/pkg-haskell/?sc=1&rev=1128
Log:
* dh_haskell_install: Do not prune all non-existant directories from the
  install-pkg-config file. Only prune references to non-existant
  directories in /usr/lib/haskell-packages/ghc6/ (which should have been
  shipped with the generated packages otherwise) and give a warning for
  other non-existing directories.

Modified:
    packages/haskell-devscripts/trunk/debian/changelog
    packages/haskell-devscripts/trunk/dh_haskell_install

Modified: packages/haskell-devscripts/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-haskell/packages/haskell-devscripts/trunk/debian/changelog?rev=1128&op=diff
==============================================================================
--- packages/haskell-devscripts/trunk/debian/changelog (original)
+++ packages/haskell-devscripts/trunk/debian/changelog Sat Mar 22 19:26:50 2008
@@ -1,3 +1,13 @@
+haskell-devscripts (0.6.8~pre1) unstable; urgency=low
+
+  * dh_haskell_install: Do not prune all non-existant directories from the
+    install-pkg-config file. Only prune references to non-existant
+    directories in /usr/lib/haskell-packages/ghc6/ (which should have been
+    shipped with the generated packages otherwise) and give a warning for
+    other non-existing directories.
+  
+ -- Arjan Oosting <arjan at debian.org>  Sat, 22 Mar 2008 17:03:47 +0100
+
 haskell-devscripts (0.6.7) unstable; urgency=low
 
   * dh_haskell_build:

Modified: packages/haskell-devscripts/trunk/dh_haskell_install
URL: http://svn.debian.org/wsvn/pkg-haskell/packages/haskell-devscripts/trunk/dh_haskell_install?rev=1128&op=diff
==============================================================================
--- packages/haskell-devscripts/trunk/dh_haskell_install (original)
+++ packages/haskell-devscripts/trunk/dh_haskell_install Sat Mar 22 19:26:50 2008
@@ -87,7 +87,8 @@
 	    doit("rm", "-f", "$tmp/usr/share/doc/$cabalnameversion/LICENSE");
 	    finddepth({wanted => \&remove_emptydir}, "$tmp/usr/share/doc");
 	} elsif ($pkgtype eq "ghc6") {
-	    mkpath("$tmp" . getcabalbasepath($pkgtype));
+	    my $pkgdir = getcabalbasepath($pkgtype);
+	    mkpath("$tmp$pkgdir");
 	    doit("./setup", "copy", "--destdir=$tmp");
 	    # Remove installed docs as the go into a separete package
 	    rmtree("$tmp/usr/lib/haskell-packages/ghc6/share/$cabalnameversion/doc/");
@@ -102,32 +103,61 @@
 	    open OUTCONFIG, ">", "$tmp" .
 		getcabalpkglibpath($pkgtype) . "/installed-pkg-config"
 		or die "Cannot write installed-pkg-config: $!";
+	    my $field;
 	    while (<INCONFIG>) {
 		chomp;
-		if (m%(\w+-dirs):\s+(.*)%) {
-		    $_ = "$1:";
-		    foreach my $dir (split(/\s+/, $2)) {
-			if ( -d "$tmp$dir" ) {
-			    $_ .= " $dir" ;
+		my $out;
+		if (/([^\s:]+):(.*)/) {
+		    $field = $1;
+		    print OUTCONFIG "$field:";
+		    $_ = $2;
+		}
+		if ($field =~ /\w+-dirs/) {
+		    s/^\s+//;
+		    s/\s+$//;
+		    foreach my $dir (split(/\s+/, $_)) {
+			if ($dir =~ /^$pkgdir/ ) {
+			    if ( -d "$tmp$dir" ) {
+				print OUTCONFIG " $dir";
+			    } else {
+				print "Removing non-existing directory $dir "
+				    . "from the $field field.\n";
+			    }
 			} else {
-			    print "Removing non-existing directory " .
-				$dir . " from $1 field";
+			    if ( ! -d "$dir") {
+				print "WARNING: package description file "
+				    . "mentions non-existing directory \'"
+				    . $dir . "\'\n";
+			    }
+			    print OUTCONFIG " $dir";
 			}
 		    }
-		}
-		if (defined($haddockpkg)) {
-		    if(cabal_version_ge(1.2)) {
-			s%(haddock-interfaces:).*/doc/$cabalnameversion/html/(.*\.haddock)%$1 /usr/share/doc/$haddockpkg/html/$cabalname/$2%;
-			s%(haddock-html:).*/doc/$cabalnameversion/html%$1 /usr/share/doc/$haddockpkg/html/$cabalname%;
+		    print OUTCONFIG "\n";
+		} elsif ($field eq "haddock-interfaces") {
+		    if (defined($haddockpkg)) {
+			if(cabal_version_ge(1.2)) {
+			    s%.*/doc/$cabalnameversion/html/(.*\.haddock)% /usr/share/doc/$haddockpkg/html/$cabalname/$1%;
+			} else {
+			    s%.*/doc(/html/.*\.haddock)% /usr/share/doc/$haddockpkg$1%;
+			}
+			print OUTCONFIG "$_\n";
 		    } else {
-			s%(haddock-interfaces:).*/doc(/html/.*\.haddock)%$1 /usr/share/doc/$haddockpkg$2%;
-			s%(haddock-html:).*/doc(/html)%$1 /usr/share/doc/$haddockpkg$2%;
+			print OUTCONFIG "\n";
+		    }
+		} elsif ($field eq "haddock-html") {
+		    if (defined($haddockpkg)) {
+			if(cabal_version_ge(1.2)) {
+			    s%.*/doc/$cabalnameversion/html% /usr/share/doc/$haddockpkg/html/$cabalname%;
+			} else {
+			    s%.*/doc(/html)% /usr/share/doc/$haddockpkg$1%;
+			}
+			print OUTCONFIG "$_\n";
+		    } else {
+			print OUTCONFIG "\n";
 		    }
 		} else {
-		    s%(haddock-interfaces:).*%$1%;
-		    s%(haddock-html:).*%$1%;
+		    print OUTCONFIG "$_\n";
 		}
-		print OUTCONFIG "$_\n";
 	    }
 	    close INCONFIG;
 	    close OUTCONFIG;




More information about the Pkg-haskell-commits mailing list