[Python-modules-commits] r20238 - in packages/sphinx/branches/1.1/debian (2 files)

jwilk at users.alioth.debian.org jwilk at users.alioth.debian.org
Wed Feb 1 15:29:47 UTC 2012


    Date: Wednesday, February 1, 2012 @ 15:29:46
  Author: jwilk
Revision: 20238

dh_sphinxdoc: -X<item> should now exclude a file if <item> exists anywhere in the path, so it can be used e.g. to exclude whole directories.

Modified:
  packages/sphinx/branches/1.1/debian/changelog
  packages/sphinx/branches/1.1/debian/dh-sphinxdoc/dh_sphinxdoc

Modified: packages/sphinx/branches/1.1/debian/changelog
===================================================================
--- packages/sphinx/branches/1.1/debian/changelog	2012-02-01 14:59:52 UTC (rev 20237)
+++ packages/sphinx/branches/1.1/debian/changelog	2012-02-01 15:29:46 UTC (rev 20238)
@@ -14,8 +14,10 @@
     not supported (see bug #658238).
   * Don't include websupport.js in libjs-jquery. Make dh_sphinxdoc remove this
     file from binary package.
+  * dh_sphinxdoc: -X<item> should now exclude a file if <item> exists anywhere
+    in the path, so it can be used e.g. to exclude whole directories.
 
- -- Jakub Wilk <jwilk at debian.org>  Wed, 01 Feb 2012 15:57:10 +0100
+ -- Jakub Wilk <jwilk at debian.org>  Wed, 01 Feb 2012 16:18:39 +0100
 
 sphinx (1.1.2+dfsg-1) experimental; urgency=low
 

Modified: packages/sphinx/branches/1.1/debian/dh-sphinxdoc/dh_sphinxdoc
===================================================================
--- packages/sphinx/branches/1.1/debian/dh-sphinxdoc/dh_sphinxdoc	2012-02-01 14:59:52 UTC (rev 20237)
+++ packages/sphinx/branches/1.1/debian/dh-sphinxdoc/dh_sphinxdoc	2012-02-01 15:29:46 UTC (rev 20238)
@@ -184,7 +184,7 @@
     my $search = <F>;
     close F;
     my %js = ();
-    grep { $js{$_} = 1 unless excludefile($_); } $search =~ m{<script type="text/javascript" src="([^"]++)"></script>}g;
+    grep { $js{$_} = 1 unless excludefile("$path/$_"); } $search =~ m{<script type="text/javascript" src="([^"]++)"></script>}g;
     my $loads_searchindex = $search =~ m/\QjQuery(function() { Search.loadIndex("searchindex.js"); });\E/;
     my ($has_source) = $search =~ m{HAS_SOURCE:\s*(true|false)};
     my ($url_root) = $search =~ m{URL_ROOT:\s*'([^']*)'};
@@ -198,10 +198,10 @@
     for my $page (split(/","/, $index))
     {
         -f "$path/$page.html"
-            or excludefile("$page.html")
+            or excludefile("$path/$page.html")
             or error("$path/$page.html is missing");
         -f "$path/_sources/$page.txt"
-            or excludefile("_sources/$page.txt")
+            or excludefile("$path/_sources/$page.txt")
             or error("$path/_sources/$page.txt is missing")
             if $has_source;
     }
@@ -209,7 +209,7 @@
     {
         grep {
             $js{"_static/$_"} = 1
-                if /[.]js$/ and not excludefile("_static/$_"); 
+                if /[.]js$/ and not excludefile("$path/_static/$_"); 
         } readdir(D);
         closedir(D);
     }
@@ -293,21 +293,23 @@
 sub drop_cruft($)
 {
     my ($path) = @_;
-    unless (excludefile('.doctrees'))
+    my $doctrees = "$path/.doctrees/";
+    my $buildinfo = "$path/.buildinfo";
+    if (-f $doctrees and not excludefile($doctrees))
     {
-        my $doctrees = "$path/.doctrees/";
-        doit('rm', '-rf', $doctrees) if -d $doctrees;
+        doit('rm', '-rf', $doctrees);
     }
-    unless (excludefile('.buildinfo'))
+    if (-f $buildinfo and not excludefile($buildinfo))
     {
-        my $buildinfo = "$path/.buildinfo";
-        doit('rm', '-f', $buildinfo) if -f $buildinfo;
+        doit('rm', '-f', $buildinfo);
     }
     foreach my $js (@cruft_js)
     {
         my $js = "$path/_static/$js";
-        next if excludefile($js);
-        doit('rm', '-f', $js) if -f $js;
+        if (-f $js and not excludefile($js))
+        {
+            doit('rm', '-f', $js) if -f $js;
+        }
     }
 }
  




More information about the Python-modules-commits mailing list