[Pkg-mono-svn-commits] rev 3742 - monodoc/trunk/debian

David Paleino hanska-guest at alioth.debian.org
Fri Oct 24 20:26:38 UTC 2008


Author: hanska-guest
Date: 2008-10-24 20:26:38 +0000 (Fri, 24 Oct 2008)
New Revision: 3742

Added:
   monodoc/trunk/debian/monodoc-manual.postinst
   monodoc/trunk/debian/monodoc-manual.postrm
Modified:
   monodoc/trunk/debian/MAINTAINERS
   monodoc/trunk/debian/changelog
   monodoc/trunk/debian/dh_installmonodoc
   monodoc/trunk/debian/monodoc-manual.installmonodoc
   monodoc/trunk/debian/postinst-monodoc
   monodoc/trunk/debian/postrm-monodoc
   monodoc/trunk/debian/rules
   monodoc/trunk/debian/update-monodoc
Log:
Now using our Monodoc Integration Framework!

Modified: monodoc/trunk/debian/MAINTAINERS
===================================================================
--- monodoc/trunk/debian/MAINTAINERS	2008-10-21 10:15:10 UTC (rev 3741)
+++ monodoc/trunk/debian/MAINTAINERS	2008-10-24 20:26:38 UTC (rev 3742)
@@ -4,3 +4,4 @@
 Current maintainers of the monodoc packages are:
 
 Mirco Bauer <meebey at meebey.net>
+David Paleino <d.paleino at gmail.com>

Modified: monodoc/trunk/debian/changelog
===================================================================
--- monodoc/trunk/debian/changelog	2008-10-21 10:15:10 UTC (rev 3741)
+++ monodoc/trunk/debian/changelog	2008-10-24 20:26:38 UTC (rev 3742)
@@ -37,7 +37,7 @@
       - debian/monodoc-base.install updated
       - debian/update-monodoc added
   * debian/copyright updated
-  * Now using our Monodoc Integration Framework: NOT READY YET!!!
+  * Now using our Monodoc Integration Framework!
 
  -- David Paleino <d.paleino at gmail.com>  Sat, 11 Oct 2008 22:45:31 +0200
 

Modified: monodoc/trunk/debian/dh_installmonodoc
===================================================================
--- monodoc/trunk/debian/dh_installmonodoc	2008-10-21 10:15:10 UTC (rev 3741)
+++ monodoc/trunk/debian/dh_installmonodoc	2008-10-24 20:26:38 UTC (rev 3742)
@@ -50,10 +50,7 @@
 
 	my $monodoc = pkgfile($package, "installmonodoc");
 	my $line;
-	my $path;
-	my $name;
-	my $label;
-	my $parent;
+	my ($path, $basefile, $label, $parent);
 
 	if ($monodoc ne '') {
 		open MONODOC, "<$monodoc" or
@@ -68,7 +65,9 @@
 			$line =~ s/\s+$//;
 			next unless length($line);
 			
-			($path, $name, $label, $parent) = split(/ /, $line, 4);
+			# Strip double spaces.
+			$line =~ s/[ ]+/ /g;
+			($path, $basefile, $label, $parent) = split(/ /, $line, 4);
 
 			# Handle " and ' without inner spaces
 			if ($label =~ /([\"\']).*\1/) {
@@ -84,23 +83,27 @@
 				$parent =~ s/${tmp}${sep}\s*//;
 				$parent = "" if ($parent eq $tmp);
 			}
-			#print "$path $name «$label» --$parent--\n";
+			#print "$path $basefile «$label» --$parent--\n";
 
 			if (! $path) {
-				die "E: Please specify the 'path' parameter for '$label'.\n";
+				die "E: Please specify the \"path\"/\"name\" parameter for \"$label\".\n";
 			} else {
-				if (! -d "$tmp$path") {
-					die "E: Can't find specified path ($path) in temporary build directory ($tmp)!\n";
+				if ($basefile eq "none") {
+					print "W: Skipping checks for \"$label\", as requested.\n";
 				} else {
-					if (! -f "$tmp$path$name.tree") {
-						die "E: Can't find $name.tree in $tmp$path!\n";
+					if (! -d "$tmp$path") {
+						die "E: Can't find specified path ($path) in temporary build directory ($tmp) for \"$label\"!\n";
+					} else {
+						if (! -f "$tmp$path$basefile.tree") {
+							die "E: Can't find $basefile.tree in $tmp$path!\n";
+						}
+						if (! -f "$tmp$path$basefile.zip") {
+							die "E: Can't find $basefile.zip in $tmp$path!\n";
+						}
+						if (! -f "$tmp$path$basefile.source") {
+							die "E: Can't find $basefile.source in $tmp$path!\n";
+						}
 					}
-					if (! -f "$tmp$path$name.zip") {
-						die "E: Can't find $name.zip in $tmp$path!\n";
-					}
-					if (! -f "$tmp$path$name.source") {
-						die "E: Can't find $name.source in $tmp$path!\n";
-					}
 				}
 			}
 			if (! $label) {
@@ -126,8 +129,14 @@
 			
 			# This is our "registry file", same format as .installmonodoc, but ONE FILE PER MANUAL
 			#  (i.e. if .installmonodoc has 5 lines, we should have 5 files in manuals.d/.)
-			print $fh "$name \"$label\" $parent\n" or return undef;
-			doit("install", "-m0644", $filename, "$tmp/usr/share/monodoc/manuals.d/$name");
+			print $fh "$basefile \"$label\" $parent\n" or return undef;
+			if ($basefile eq "none") {
+				# we use the "fake" path parameter to specify the filename, which will be used
+				# in monodoc.xml, at the end.
+				doit("install", "-m0644", $filename, "$tmp/usr/share/monodoc/manuals.d/$path");
+			} else {
+				doit("install", "-m0644", $filename, "$tmp/usr/share/monodoc/manuals.d/$basefile");
+			}
 			close $fh;
 			
 			print "done.\n";

Modified: monodoc/trunk/debian/monodoc-manual.installmonodoc
===================================================================
--- monodoc/trunk/debian/monodoc-manual.installmonodoc	2008-10-21 10:15:10 UTC (rev 3741)
+++ monodoc/trunk/debian/monodoc-manual.installmonodoc	2008-10-24 20:26:38 UTC (rev 3742)
@@ -1,11 +1,16 @@
-# path                    name            label                      parent
-/usr/lib/monodoc/sources/ classlib           "Class Library" root:
-/usr/lib/monodoc/sources/ classlib-mono "Mono Libraries" root:
-/usr/lib/monodoc/sources/ classlib-novell "Novell Libraries" root:
-/usr/lib/monodoc/sources/ classlib-nunit "NUnit Libraries" various
-/usr/lib/monodoc/sources/ cs-errors "C# Compiler Error Reference" root:
-/usr/lib/monodoc/sources/ ecmaspec "C# Language Specification" root:
-/usr/lib/monodocs/sources/ embed            "Mono Embedding" root:
-#/usr/lib/monodoc/sources/ moonlight "Moonlight/Silverlight" root:
-#/usr/lib/monodoc/sources/ mysql "MySql" various
-/usr/lib/monodoc/sources/ various "Various" root:
+# path/name                 basefile  label                         parent
+/usr/lib/monodoc/sources/   netdocs   "Class Library"               root:
+/usr/lib/monodoc/sources/   Mono      "Mono Libraries"              root:
+/usr/lib/monodoc/sources/   Novell    "Novell Libraries"            root:
+/usr/lib/monodoc/sources/   cs-errors "C# Compiler Error Reference" root:
+/usr/lib/monodoc/sources/   ecma334   "C# Language Specification"   root:
+/usr/lib/monodoc/sources/   monoapi   "Mono Embedding"              root:
+classlib-diacanvas          none      "DiaCanvas Libraries"         various
+classlib-nunit              none      "NUnit Libraries"             various
+debugger                    none      "Mono Debugger"               dev-tools
+dev-tools                   none      "Mono Development Tools"      root:
+md                          none      "Monodevelop IDE"             root:
+monodevelop                 none      "API Reference"               md
+monodevelop-extension-guide none      "Extension Point Reference"   md
+moonlight                   none      "Moonlight/Silverlight"       root:
+various                     none      "Various"                     root:

Added: monodoc/trunk/debian/monodoc-manual.postinst
===================================================================
--- monodoc/trunk/debian/monodoc-manual.postinst	                        (rev 0)
+++ monodoc/trunk/debian/monodoc-manual.postinst	2008-10-24 20:26:38 UTC (rev 3742)
@@ -0,0 +1,25 @@
+#!/bin/sh
+# postinst script for monodoc-manual
+#
+# see: dh_installdeb(1)
+
+set -e
+
+case "$1" in
+    configure)
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+#DEBHELPER#
+
+exit 0
+
+

Added: monodoc/trunk/debian/monodoc-manual.postrm
===================================================================
--- monodoc/trunk/debian/monodoc-manual.postrm	                        (rev 0)
+++ monodoc/trunk/debian/monodoc-manual.postrm	2008-10-24 20:26:38 UTC (rev 3742)
@@ -0,0 +1,22 @@
+#!/bin/sh
+# postrm script for monodoc-manual
+#
+# see: dh_installdeb(1)
+
+set -e
+
+case "$1" in
+    purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+    ;;
+
+    *)
+        echo "postrm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+#DEBHELPER#
+
+exit 0
+
+

Modified: monodoc/trunk/debian/postinst-monodoc
===================================================================
--- monodoc/trunk/debian/postinst-monodoc	2008-10-21 10:15:10 UTC (rev 3741)
+++ monodoc/trunk/debian/postinst-monodoc	2008-10-24 20:26:38 UTC (rev 3742)
@@ -1,3 +1,3 @@
-if [ "$1" = "configure" ] && [ -x /usr/bin/update-monodoc ]; then
-	/usr/bin/update-monodoc
+if [ "$1" = "configure" ] && [ -x /usr/sbin/update-monodoc ]; then
+	/usr/sbin/update-monodoc
 fi

Modified: monodoc/trunk/debian/postrm-monodoc
===================================================================
--- monodoc/trunk/debian/postrm-monodoc	2008-10-21 10:15:10 UTC (rev 3741)
+++ monodoc/trunk/debian/postrm-monodoc	2008-10-24 20:26:38 UTC (rev 3742)
@@ -1,3 +1,3 @@
-if [ "$1" = "remove" ] || [ "$1" = "upgrade" ] && [ -x /usr/bin/update-monodoc ]; then
-	/usr/bin/update-monodoc
+if [ "$1" = "remove" ] || [ "$1" = "upgrade" ] && [ -x /usr/sbin/update-monodoc ]; then
+	/usr/sbin/update-monodoc
 fi

Modified: monodoc/trunk/debian/rules
===================================================================
--- monodoc/trunk/debian/rules	2008-10-21 10:15:10 UTC (rev 3741)
+++ monodoc/trunk/debian/rules	2008-10-24 20:26:38 UTC (rev 3742)
@@ -62,9 +62,9 @@
 	  $(CURDIR)/debian/monodoc-base/usr/share/doc/monodoc-base/ChangeLog \
 	  $(CURDIR)/debian/monodoc-manual/usr/share/doc/monodoc-manual/ChangeLog
 	dh_fixperms
+	DH_AUTOSCRIPTDIR=$(CURDIR)/debian debian/dh_installmonodoc
 	dh_installdeb
 	dh_installxsp -V 1,2
-	DH_AUTOSCRIPTDIR=$CURDIR/debian debian/dh_installmonodoc
 	dh_makeclilibs -m 1.0
 	dh_clideps
 	dh_gencontrol

Modified: monodoc/trunk/debian/update-monodoc
===================================================================
--- monodoc/trunk/debian/update-monodoc	2008-10-21 10:15:10 UTC (rev 3741)
+++ monodoc/trunk/debian/update-monodoc	2008-10-24 20:26:38 UTC (rev 3742)
@@ -43,6 +43,10 @@
 my @dummy_parents;
 
 foreach my $file (glob("${manuals}/*")) {
+	# This is to temporarily hide files, use with caution, you might break
+	# monodoc.xml!
+	next if $file =~ /_.*/;
+	
 	my %info = get_info($file);
 	update_tree(%info);
 }
@@ -53,14 +57,14 @@
 sub get_info {
 	my $file = $_[0];
 	my $line;
-	my ($parent, $name, $label);
-	my %res;
+	my ($parent, $basefile, $label, $name);
+	my %ret;
 	
 	open REGISTRY, "<$file" or
 		die "E: Cannot open $file for reading!\n";
 	while (<REGISTRY>) {
 		my $line = $_;
-		our ($name, $label, $parent);
+		our ($basefile, $label, $parent, $name);
 		
 		# This is just in case someone edited them manually... :)
 		$line =~ s/^\s*#.*//;
@@ -69,7 +73,7 @@
 		next unless length($line);
 		
 		# Same checks as dh_installmonodoc
-		($name, $label, $parent) = split(/ /, $line, 3);
+		($basefile, $label, $parent) = split(/ /, $line, 3);
 		
 		# Handle " and ' without inner spaces
 		if ($label =~ /([\"\']).*\1/) {
@@ -94,21 +98,43 @@
 		# Let's set defaults for optional parameters
 		$parent = "various" if !$parent;
 		
-		$res{"parent"} = $parent;
-		$res{"name"} = $name;
-		$res{"label"} = $label;
+		my $parser = XML::LibXML->new();
+		my $path = "/usr/lib/monodoc/sources/".$basefile.".source";
+		if ($basefile eq "none") {
+			# If $basefile is "none", it's intended, and we default to the
+			# filename. 
+			$name = basename($file);
+		} else {
+			if (! -f $path) {
+				die("E: Cannot find $path!\n");
+			} else {
+				my $source = $parser->parse_file($path);
+				my $res = $source->findnodes("/monodoc/source");
+				foreach my $element ($res->get_nodelist) {
+					$name = $element->getAttribute("path");
+				}
+			}
+		}
+		
+		$ret{"parent"} = $parent;
+		$ret{"basefile"} = $basefile;
+		$ret{"label"} = $label;
+		$ret{"name"} = $name;
 	}
 	close REGISTRY;
 	
-	return %res;
+	return %ret;
 }
 
 sub update_tree {
 	my %info = @_;
 	my $name = $info{"name"};
+	my $basefile = $info{"basefile"};
 	my $parent = $info{"parent"};
 	my $label = $info{"label"};
 
+	#print "$label\n";
+	
 	my @nodelist = $dom->getElementsByTagName("node");
 
 	my $res = $dom->findnodes("//node");
@@ -198,7 +224,10 @@
 print $fh $dom->toString(2);
 close $fh;
 
+#print $dom->toString(2)."\n";
+
 system("mv $filename $monodoc");
+system("chmod a+r $monodoc");
 
 print "Regenerating Monodoc search index... ";
 system("monodoc --make-index 2>&1 >/dev/null");




More information about the Pkg-mono-svn-commits mailing list