On Fri, Jul 06, 2007 at 12:19:54PM +0200, Emanuele Aina wrote:
> Attached a patch backporting the --compat-libtool option to the version of
> lcov currently in Debian unstable (1.5-1).
I've attached a debdiff'ed version of this patch. Needed only basic rediffing
to apply cleanly.
Sjoerd
--
Either I'm dead or my watch has stopped.
-- Groucho Marx's last words
diff -u lcov-1.5/debian/changelog lcov-1.5/debian/changelog
--- lcov-1.5/debian/changelog
+++ lcov-1.5/debian/changelog
@@ -1,3 +1,11 @@
+lcov (1.5-1.1) unstable; urgency=low
+
+ * debian/patches/30_lcov_compat_libtool.patch:
+ * Added. Add support for projects using libtool (From upstream CVS)
+ (Thanks Emanuele Aina) (Closes: #431397)
+
+ -- Sjoerd Simons <[EMAIL PROTECTED]> Mon, 09 Jul 2007 13:37:31 +0200
+
lcov (1.5-1) unstable; urgency=low
* New upstream release.
only in patch2:
unchanged:
--- lcov-1.5.orig/debian/patches/30_lcov_compat_libtool.patch
+++ lcov-1.5/debian/patches/30_lcov_compat_libtool.patch
@@ -0,0 +1,110 @@
+diff -Naur lcov-1.5.old/bin/geninfo lcov-1.5/bin/geninfo
+--- lcov-1.5.old/bin/geninfo 2007-07-09 13:34:05.000000000 +0200
++++ lcov-1.5/bin/geninfo 2007-07-09 13:34:09.000000000 +0200
+@@ -104,6 +104,7 @@
+ our $follow;
+ our $nochecksum;
+ our $preserve_paths;
++our $compat_libtool;
+ our $adjust_testname = (`uname -m` =~ /^s390/); # Always on on s390
+ our $config; # Configuration file contents
+ our $compatibility; # Compatibility version flag - used to indicate
+@@ -148,7 +149,8 @@
+ "version" =>\$version,
+ "quiet" => \$quiet,
+ "help" => \$help,
+- "follow" => \$follow
++ "follow" => \$follow,
++ "compat-libtool" => \$compat_libtool
+ ))
+ {
+ print_usage(*STDERR);
+@@ -307,6 +309,7 @@
+ -f, --follow Follow links when searching .da/.gcda
files
+ -n, --no-checksum Do not calculate checksum for each line
+ -b, --base-directory DIR Use DIR as base directory for relative
paths
++ --compat-libtool Assume libtool environment
+
+ See $lcov_url for more information about this tool.
+ END_OF_USAGE
+@@ -387,6 +390,7 @@
+
+ my $da_filename; # Name of data file to process
+ my $da_dir; # Directory of data file
++ my $source_dir; # Directory of source file
+ my $da_basename; # data filename without ".da/.gcda" extension
+ my $bb_filename; # Name of respective graph file
+ my %bb_content; # Contents of graph file
+@@ -420,11 +424,11 @@
+ # Get directory and basename of data file
+ ($da_dir, $da_basename) = split_filename($da_filename);
+
+- # Check for writable $da_dir (gcov will try to write files there)
+- stat($da_dir);
+- if (!-w _)
+- {
+- die("ERROR: cannot write to directory $da_dir!\n");
++ # avoid files from .libs dirs
++ if ($compat_libtool && $da_dir =~ m/(.*)\/\.libs$/) {
++ $source_dir = $1;
++ } else {
++ $source_dir = $da_dir;
+ }
+
+ if (-z $da_filename)
+@@ -443,7 +447,14 @@
+ }
+ else
+ {
+- $base_dir = $da_dir;
++ $base_dir = $source_dir;
++ }
++
++ # Check for writable $base_dir (gcov will try to write files there)
++ stat($base_dir);
++ if (!-w _)
++ {
++ die("ERROR: cannot write to directory $base_dir!\n");
+ }
+
+ # Construct name of graph file
+diff -Naur lcov-1.5.old/bin/lcov lcov-1.5/bin/lcov
+--- lcov-1.5.old/bin/lcov 2007-07-09 13:34:05.000000000 +0200
++++ lcov-1.5/bin/lcov 2007-07-09 13:34:09.000000000 +0200
+@@ -148,6 +148,7 @@
+ our $follow; # If set, indicates that find shall follow links
+ our $diff_path = ""; # Path removed from tracefile when applying diff
+ our $base_directory; # Base directory (cwd of gcc during compilation)
++our $compat_libtool; # Specify to work with libtool build environment
+ our $config; # Configuration file contents
+ chomp($cwd);
+ our $tool_dir = dirname($0); # Directory where genhtml tool is installed
+@@ -205,7 +206,8 @@
+ "version" => \$version,
+ "follow" => \$follow,
+ "path=s" => \$diff_path,
+- "base-directory=s" => \$base_directory
++ "base-directory=s" => \$base_directory,
++ "compat-libtool" => \$compat_libtool
+ ))
+ {
+ print_usage(*STDERR);
+@@ -349,6 +351,7 @@
+ --convert-filenames Convert filenames when applying diff
+ --strip DEPTH Strip initial DEPTH directory levels in diff
+ --path PATH Strip PATH from tracefile when applying diff
++ --compat-libtool Assume libtool environment
+
+ See $lcov_url for more information about this tool.
+ END_OF_USAGE
+@@ -470,6 +473,10 @@
+ {
+ @param = (@param, "--base-directory", $base_directory);
+ }
++ if ($compat_libtool)
++ {
++ @param = (@param, "--compat-libtool");
++ }
+
+ system(@param);
+ exit($? >> 8);