[Python-modules-commits] r17758 - in packages/sphinx/trunk/debian (dh_sphinxdoc)
jwilk at users.alioth.debian.org
jwilk at users.alioth.debian.org
Fri Jul 8 21:04:33 UTC 2011
Date: Friday, July 8, 2011 @ 21:04:31
Author: jwilk
Revision: 17758
dh_sphinxdoc: allow -X to exclude .js and .txt files.
Modified:
packages/sphinx/trunk/debian/dh_sphinxdoc
Modified: packages/sphinx/trunk/debian/dh_sphinxdoc
===================================================================
--- packages/sphinx/trunk/debian/dh_sphinxdoc 2011-07-08 20:49:52 UTC (rev 17757)
+++ packages/sphinx/trunk/debian/dh_sphinxdoc 2011-07-08 21:04:31 UTC (rev 17758)
@@ -97,7 +97,8 @@
open(F, '<', $searchfn) or error("cannot open $searchfn");
my $search = <F>;
close F;
- my %js = map { $_, 1 } $search =~ m{<script type="text/javascript" src="([^"]++)"></script>}g;
+ my %js = ();
+ grep { $js{$_} = 1 unless excludefile($_); } $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*'([^']*)'};
@@ -109,12 +110,20 @@
}
for my $page (split(/","/, $index))
{
- -f "$path/$page.html" or error("$path/$page.html is missing");
- -f "$path/_sources/$page.txt" or error("$path/_sources/$page.txt is missing") if $has_source;
+ -f "$path/$page.html"
+ or excludefile("$page.html")
+ or error("$path/$page.html is missing");
+ -f "$path/_sources/$page.txt"
+ or excludefile("_sources/$page.txt")
+ or error("$path/_sources/$page.txt is missing")
+ if $has_source;
}
if (opendir(D, "$path/_static/"))
{
- grep { /[.]js$/ and $js{"_static/$_"} = 1; } readdir(D);
+ grep {
+ $js{"_static/$_"} = 1
+ if /[.]js$/ and not excludefile("_static/$_");
+ } readdir(D);
closedir(D);
}
return keys(%js);
More information about the Python-modules-commits
mailing list