]> git.donarmstrong.com Git - lilypond.git/commitdiff
properly handle symlink to directory
authorDon Armstrong <don@donarmstrong.com>
Sun, 27 Apr 2014 21:57:54 +0000 (14:57 -0700)
committerDon Armstrong <don@donarmstrong.com>
Sun, 27 Apr 2014 21:57:54 +0000 (14:57 -0700)
remove w3c callback image
update standards version

debian/changelog
debian/control
debian/lilypond-doc.postinst [new file with mode: 0644]
debian/lilypond-doc.postrm [new file with mode: 0644]
debian/lilypond-doc.preinst [new file with mode: 0644]
debian/remove_w3c_callback [new file with mode: 0644]
debian/rules

index b2b561d40ce0347278737df36d9c1b1d44efc81c..fb339d0c76a59bc6fc984b00cc463d8757807f7c 100644 (file)
@@ -1,6 +1,8 @@
 lilypond (2.18.0-1) unstable; urgency=low
 
   * New upstream version (closes: #729817)
+  * Fix replacement of /usr/share/info/lilypond symlink with a directory
+    (Closes: #736306)
 
  -- Don Armstrong <don@debian.org>  Tue, 31 Dec 2013 13:23:41 -0800
 
index b8f5c073441eb1b3b22cdec63a378b0b5ecc3b8b..959e1b279c10a0fc4dc4d74651e7a2dfade01317 100644 (file)
@@ -16,7 +16,7 @@ Build-Depends: debhelper (>= 9), quilt, python-all-dev (>= 2.6.6-3~), dh-python,
 Section: tex
 Priority: optional
 Maintainer: Don Armstrong <don@debian.org>
-Standards-Version: 3.9.3
+Standards-Version: 3.9.5
 Homepage: http://lilypond.org/
 Vcs-Git: git://git.donarmstrong.com/lilypond.git
 Vcs-Browser: http://git.donarmstrong.com/lilypond.git
diff --git a/debian/lilypond-doc.postinst b/debian/lilypond-doc.postinst
new file mode 100644 (file)
index 0000000..2559f96
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+#DEBHELPER#
+
+if dpkg-maintscript-helper supports symlink_to_dir; then
+    dpkg-maintscript-helper symlink_to_dir \
+        /usr/share/info/lilypond ../doc/lilypond/html/Documentation/user \
+        2.18.0-1~ lilypond-doc -- "$@"
+fi;
diff --git a/debian/lilypond-doc.postrm b/debian/lilypond-doc.postrm
new file mode 100644 (file)
index 0000000..2559f96
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+#DEBHELPER#
+
+if dpkg-maintscript-helper supports symlink_to_dir; then
+    dpkg-maintscript-helper symlink_to_dir \
+        /usr/share/info/lilypond ../doc/lilypond/html/Documentation/user \
+        2.18.0-1~ lilypond-doc -- "$@"
+fi;
diff --git a/debian/lilypond-doc.preinst b/debian/lilypond-doc.preinst
new file mode 100644 (file)
index 0000000..2559f96
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+#DEBHELPER#
+
+if dpkg-maintscript-helper supports symlink_to_dir; then
+    dpkg-maintscript-helper symlink_to_dir \
+        /usr/share/info/lilypond ../doc/lilypond/html/Documentation/user \
+        2.18.0-1~ lilypond-doc -- "$@"
+fi;
diff --git a/debian/remove_w3c_callback b/debian/remove_w3c_callback
new file mode 100644 (file)
index 0000000..9b70881
--- /dev/null
@@ -0,0 +1,33 @@
+#!/usr/bin/perl
+
+use warnings;
+use strict;
+
+use IO::File;
+use File::Find;
+
+# <a href="http://validator.w3.org/check?uri=referer">
+# <img src="http://www.w3.org/Icons/valid-html401"
+#      alt="Valid HTML 4.01 Transitional"
+#      height="31" width="88"></a>
+
+file_find(\&fix_if_file,@ARGV)
+
+sub fix_if_file {
+    return unless -f $_;
+    my $fh = IO::File->new($_,'r') or
+        die "Unable to open $_ for reading: $!";
+    local $/;
+    my $fc = <$fh>;
+    close($fh);
+    if (# strip out the w3c img callback; replace with alt text
+        $fc =~ s{<img\s+src="http://www.w3c.org/Icons/[^"]+"[^>]*?alt="([^"]+)"[^>]*>}{$1}img
+        or
+        # if it doesn't have alt text, just replace it with Valid HTML
+        $fc =~ s{<img\s+src="http://www.w3c.org/Icons/[^"]+"[^>]*>}{Valid HTML}img ) {
+        $fh = IO::File->new($_,'w') or
+            die "Unable to open $_ for writing: $!";
+        print {$fh} $fc;
+        close($fh);
+    }
+}
index 19fca156890848d773e2beae8ad62f40f5b456bd..7c652908cf1c9106369d08d9f6cf84d52b0d336b 100755 (executable)
@@ -52,6 +52,7 @@ override_dh_auto_install-indep:
        $(MAKE) install-info $(DOC_OPTIONS) prefix=$(CURDIR)/debian/tmp/usr
        rm -rf $(CURDIR)/debian/tmp/usr/share/omf
        rm -rf $(CURDIR)/debian/tmp/usr/share/doc/lilypond/html/input
+       perl debian/remove_w3c_callback $(CURDIR)/debian/tmp/usr/share/doc/lilypond/ $(CURDIR)/debian/tmp/usr/share/info/
 
 ## Unfortunately, lilypond is kind of broken, and installs the wrong
 ## info documentation (missing images) if we call their makefile