[darcs-users] How to you handle content-related dependencies?
Steffen Schuldenzucker
sschuldenzucker at uni-bonn.de
Tue Jun 7 08:30:24 UTC 2011
Thanks for the code. Lacking some settings in .darcs/defaults, I had to
apply the patch at the bottom of this message to prevent darcs from
asking questions.
I tried it on this repo
http://patch-tag.com/r/steffen/stBaTe/
, and the results were:
steffen at gandalf deptest $ grep '^Failed$' deptest.out | wc -l
182
steffen at gandalf deptest $ grep '^Succeeded$' deptest.out | wc -l
70
Note that undefined references are /not/ an error, but only throw a
warning. Skimming through the output, the two main reasons for errors were:
* Undefined \newcommandS. This looks very similar to the
\label{...}/\ref{...} problem.
* Missing dependencies on the build system (which is a little bit
complex: A haskell program implementing my tiny templating language is
compiled, it creates a .tex document which is in turn processed by
LaTeX). "No Makefile found" appeared often.
I guess these errors could have been prevented by introducing a tag
build_system_works and letting all changes to the actual document depend
on it.
On 06/06/2011 10:48 PM, Miles Gould wrote:
> [...]
>
> By the way, I thought it might be fun to measure the extent of the
> "underapproximated dependency" problem with my own thesis, to give
> Steffen more of an idea how much he should be worrying. Unfortunately,
> it turns out that most revisions of my thesis don't compile under
> versions of TeXLive released since 2008! Anyone like to suggest
> another repo I should try?
>
> Here's my code, FWIW:
>
> #!/usr/bin/perl
>
> use strict;
> use warnings;
> use 5.010;
>
> use XML::XPath;
>
> my $upstream = shift @ARGV;
> my $make_command = join " ", @ARGV;
>
> my $outfile_name = "deptest.out";
>
> my $change_xml = `darcs changes --repo=$upstream --xml`;
> my $xp = XML::XPath->new(xml => $change_xml);
> my $change_hashes = $xp->find('changelog/patch/@hash');
> my @changes;
>
> foreach my $node ($change_hashes->get_nodelist) {
> my $hash = $node->getData();
> $hash =~ s/\.gz$//;
> push @changes, $hash;
> }
>
> foreach my $change (reverse @changes) {
> open my $outfile, ">>", $outfile_name;
> say $outfile $change;
> close $outfile;
> system "darcs pull --match 'hash $change' $upstream";
> system "time -o $outfile_name -a $make_command";
> open $outfile, ">>", $outfile_name;
> say $outfile (($?>> 8) == 0) ? "Succeeded" : "Failed";
> say $outfile "";
> close $outfile;
> system "darcs unpull";
> }
>
> To use it with a repo $darcsrepo:
>
> 1) Save it somewhere in your PATH (I call it "deptest") and chmod +x it.
> 2) Install XML::XPath: `cpan XML::XPath`
> 3) Create a new darcs repository:
> mkdir deptest; cd deptest; darcs init
> 4) Run deptest [path to repo to test] [build command]; in my case that's
> deptest ../thesis "latexmk thesis"
> 5) Look through "deptest.out" for timing and success/failure info.
> "Failed" in this context ought to mean "has unspecified dependencies",
> assuming you haven't recorded any broken patches.
>
> [Step 3 is not automated because of further stupidity specific to my
> thesis repo.]
@@ -26,11 +26,11 @@
open my $outfile, ">>", $outfile_name;
say $outfile $change;
close $outfile;
- system "darcs pull --match 'hash $change' $upstream";
+ system "darcs pull --dont-prompt-for-dependencies --all --match
'hash $change' $upstream";
system "time -o $outfile_name -a $make_command";
open $outfile, ">>", $outfile_name;
say $outfile (($? >> 8) == 0) ? "Succeeded" : "Failed";
say $outfile "";
close $outfile;
- system "darcs unpull";
+ system "darcs unpull --all --dont-prompt-for-dependencies";
}
-- Steffen
More information about the darcs-users
mailing list