~ubuntu-branches/ubuntu/vivid/installation-guide/vivid-proposed

« back to all changes in this revision

Viewing changes to debian/genbuilddeps

  • Committer: Bazaar Package Importer
  • Author(s): Frans Pop
  • Date: 2005-10-25 17:37:25 UTC
  • Revision ID: james.westby@ubuntu.com-20051025173725-aq0bm11be7bfd7rw
Tags: 20051025
* Mention in copyright that full GPL is included in the manual.
  Closes: #334925
* Register installed documents with doc-base.
* Minor updates in English text and translations.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
2
# Generate build deps line from comments in the control file and replace
 
3
# the current build deps line in the control file with it.
 
4
 
 
5
my $control;
 
6
if (-e "debian/control") {
 
7
        $control="debian/control";
 
8
}
 
9
elsif (-e "control") {
 
10
        $control="control";
 
11
}
 
12
else {
 
13
        die "cannot find control file";
 
14
}
 
15
 
 
16
my @builddeps;
 
17
my @lines;
 
18
open (IN, $control) || die "read $control: $!";
 
19
while (<IN>) {
 
20
        push @lines, $_;
 
21
        chomp;
 
22
        if (/^#\s+-\s+(.*)$/) {
 
23
                push @builddeps, $1;
 
24
        }
 
25
}
 
26
close IN;
 
27
 
 
28
my $builddeps=join(", ", @builddeps);
 
29
open (OUT, ">$control.tmp") || die "write $control.tmp: $!";
 
30
foreach (@lines) {
 
31
        s/^(Build-Depends:\s+)(.*)/$1$builddeps/;
 
32
        print OUT || die "print: $!";
 
33
}
 
34
close OUT || die "close: $!";
 
35
rename("$control.tmp", "$control");