Bug#114774: dpkg-checkbuilddeps: patch for new features

2008-01-20 Thread Raphael Hertzog
On Sun, 20 Jan 2008, Frank Lichtenheld wrote:
> On Sat, Jan 19, 2008 at 11:07:20PM +0100, Raphael Hertzog wrote:
> > Though I think that -d and -c can be interesting, so I wrote a new patch
> > to support them (it's attached). I'll apply it for dpkg 1.14.17.
> 
> You really should add a option to set Build-Depends-Indep then, too.

-d replaces "Build-Depends and Build-Depends-Indep" at the same time. Same
for -c and Build-Conflicts/Build-Conflits-Indep.

That's why the manual page refers to build dependencies and build
conflicts and not the precise field names.

Cheers,
-- 
Raphaël Hertzog

Le best-seller français mis à jour pour Debian Etch :
http://www.ouaza.com/livre/admin-debian/





Bug#114774: dpkg-checkbuilddeps: patch for new features

2008-01-19 Thread Frank Lichtenheld
On Sat, Jan 19, 2008 at 11:07:20PM +0100, Raphael Hertzog wrote:
> Though I think that -d and -c can be interesting, so I wrote a new patch
> to support them (it's attached). I'll apply it for dpkg 1.14.17.

You really should add a option to set Build-Depends-Indep then, too.

Gruesse,
-- 
Frank Lichtenheld <[EMAIL PROTECTED]>
www: http://www.djpig.de/




-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#114774: dpkg-checkbuilddeps: patch for new features

2008-01-19 Thread Raphael Hertzog
On Sun, 07 Oct 2001, Yann Dirson wrote:
> The attached patch adds a couple of flags to help working with
> build-deps, taking advantage of the already existing mechanics.
> 
>   -m  output met dependencies on stdout, instead of
>   unmet dependencies on stderr
>   -d BuildDepStr  use given string for build-depends instead of
>   getting it from control file
>   -c BldConflStr  use given string for build-conflicts instead of
>   getting it from control file
> 
> I've added those features to be able to easily implement a
> build-information generator, that tries to be as accurate as possible.

I have plans to enhance dpkg-dev itself to provide information concerning
the build environment so it may not be so important to add those features.
And the original patch doesn't apply anymore.

Though I think that -d and -c can be interesting, so I wrote a new patch
to support them (it's attached). I'll apply it for dpkg 1.14.17.

Cheers,
-- 
Raphaël Hertzog

Le best-seller français mis à jour pour Debian Etch :
http://www.ouaza.com/livre/admin-debian/
>From 67a899db6569414af208c063b9c7f1d37f0eed6d Mon Sep 17 00:00:00 2001
From: Raphael Hertzog <[EMAIL PROTECTED]>
Date: Sat, 19 Jan 2008 22:55:01 +0100
Subject: [PATCH] dpkg-checkbuilddeps: add -d and -c options to override build-depends/conflicts

* scripts/dpkg-checkbuilddeps.pl: Add support of options -d and -c to use
build dependencies/conflicts given on the command line instead of those
retrieved from debian/control.
* man/dpkg-checkbuilddeps.1: Document the new options.
---
 man/dpkg-checkbuilddeps.1  |6 
 scripts/dpkg-checkbuilddeps.pl |   50 +++
 2 files changed, 35 insertions(+), 21 deletions(-)

diff --git a/man/dpkg-checkbuilddeps.1 b/man/dpkg-checkbuilddeps.1
index 2214ced..96c7585 100644
--- a/man/dpkg-checkbuilddeps.1
+++ b/man/dpkg-checkbuilddeps.1
@@ -25,6 +25,12 @@ Change the location of the \fBdpkg\fR database. The default location is
 Ignore \fIBuild\-Depends\-Indep\fR lines. Use when no arch-indep packages will
 be built.
 .TP
+.BI "\-d " build-depends-string
+.TP
+.BI "\-c " build-conflicts-string
+Use the given build dependencies/conflicts instead of those contained in the
+debian/control file.
+.TP
 .B \-h
 Show the usage message and exit.
 .
diff --git a/scripts/dpkg-checkbuilddeps.pl b/scripts/dpkg-checkbuilddeps.pl
index 1a82dbc..bf375fb 100755
--- a/scripts/dpkg-checkbuilddeps.pl
+++ b/scripts/dpkg-checkbuilddeps.pl
@@ -21,6 +21,10 @@ sub usage {
 Options:
   control-file   control file to process (default: debian/control).
   -B binary-only, ignore -Indep.
+  -d build-deps  use given string for Build-Depends instead of
+ retrieving it from control file
+  -c build-conf  use given string for Build-Conflicts instead of
+ retrieving it from control file
   --admindir=
  change the administrative directory.
   -h show this help message.
@@ -29,8 +33,11 @@ Options:
 
 my $binary_only=0;
 my $want_help=0;
+my ($bd_value, $bc_value);
 if (! GetOptions('-B' => \$binary_only,
 		 '-h' => \$want_help,
+		 '-d=s' => \$bd_value,
+		 '-c=s' => \$bc_value,
 		 '--admindir=s' => \$admindir)) {
 	usage();
 	exit(2);
@@ -46,30 +53,31 @@ my $control = Dpkg::Control->new($controlfile);
 my $fields = $control->get_source();
 
 my $facts = parse_status("$admindir/status");
-my (@unmet, @conflicts);
-
-push @unmet, build_depends('Implicit-Build-Depends',
-   Dpkg::Deps::parse('build-essential'), $facts);
 
-if (defined($fields->{"Build-Depends"})) {
-	push @unmet, build_depends('Build-Depends',
-   Dpkg::Deps::parse($fields->{"Build-Depends"},
-reduce_arch => 1), $facts);
-}
-if (defined($fields->{"C Build-Conflicts"})) {
-	push @conflicts, build_conflicts('Build-Conflicts',
- Dpkg::Deps::parse($fields->{"Build-Conflicts"},
-reduce_arch => 1, union => 1), $facts);
+unless (defined($bd_value) or defined($bc_value)) {
+$bd_value = 'build-essential';
+$bd_value .= ", " . $fields->{"Build-Depends"} if defined $fields->{"Build-Depends"};
+if (not $binary_only and defined $fields->{"Build-Depends-Indep"}) {
+	$bd_value .= ", " . $fields->{"Build-Depends-Indep"};
+}
+$bc_value = $fields->{"Build-Conflicts"} if defined $fields->{"Build-Conflicts"};
+if (not $binary_only and defined $fields->{"Build-Conflicts-Indep"}) {
+	if ($bc_value) {
+	$bc_value .= ", " . $fields->{"Build-Conflicts-Indep"};
+	} else {
+	$bc_value .= $fields->{"Build-Conflicts-Indep"};
+	}
+}
 }
-if (! $binary_only && defined($fields->{"Build-Depends-Indep"})) {
-	push @unmet, build_depends('Build-Depends-Indep',
-   Dpkg::Deps::parse($fields->{"Build-Depend

Bug#114774: dpkg-checkbuilddeps: patch for new features

2006-11-24 Thread Marc Haber
On Sun, Oct 07, 2001 at 10:23:51PM +0200, Yann Dirson wrote:
> The attached patch adds a couple of flags to help working with
> build-deps, taking advantage of the already existing mechanics.
> 
>   -m  output met dependencies on stdout, instead of
>   unmet dependencies on stderr
>   -d BuildDepStr  use given string for build-depends instead of
>   getting it from control file
>   -c BldConflStr  use given string for build-conflicts instead of
>   getting it from control file
> 
> I've added those features to be able to easily implement a
> build-information generator, that tries to be as accurate as possible.

I consider these features very useful. A pity that the patch is
bitrotting away in the BTS.

Greetings
Marc

-- 
-
Marc Haber | "I don't trust Computers. They | Mailadresse im Header
Mannheim, Germany  |  lose things."Winona Ryder | Fon: *49 621 72739834
Nordisch by Nature |  How to make an American Quilt | Fax: *49 621 72739835



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]