summaryrefslogtreecommitdiff
path: root/debian/genbuilddeps
diff options
context:
space:
mode:
authorJoey Hess <joeyh@debian.org>2005-10-07 19:56:36 +0000
committerJoey Hess <joeyh@debian.org>2005-10-07 19:56:36 +0000
commit142a2340e9299c94fca84cc646ae39c48d5a4b18 (patch)
treed018f08dafc8eb63a47726d50e9c1b87f20a74ed /debian/genbuilddeps
parent1ea73eea5ecc6a8ed901316049259aee737ee554 (diff)
downloadinstallation-guide-142a2340e9299c94fca84cc646ae39c48d5a4b18.zip
control file with only the manual build deps.
using genbuildeps may be overkill for this
Diffstat (limited to 'debian/genbuilddeps')
-rwxr-xr-xdebian/genbuilddeps35
1 files changed, 35 insertions, 0 deletions
diff --git a/debian/genbuilddeps b/debian/genbuilddeps
new file mode 100755
index 000000000..ca94a4f06
--- /dev/null
+++ b/debian/genbuilddeps
@@ -0,0 +1,35 @@
+#!/usr/bin/perl
+# Generate build deps line from comments in the control file and replace
+# the current build deps line in the control file with it.
+
+my $control;
+if (-e "debian/control") {
+ $control="debian/control";
+}
+elsif (-e "control") {
+ $control="control";
+}
+else {
+ die "cannot find control file";
+}
+
+my @builddeps;
+my @lines;
+open (IN, $control) || die "read $control: $!";
+while (<IN>) {
+ push @lines, $_;
+ chomp;
+ if (/^#\s+-\s+(.*)$/) {
+ push @builddeps, $1;
+ }
+}
+close IN;
+
+my $builddeps=join(", ", @builddeps);
+open (OUT, ">$control.tmp") || die "write $control.tmp: $!";
+foreach (@lines) {
+ s/^(Build-Depends:\s+)(.*)/$1$builddeps/;
+ print OUT || die "print: $!";
+}
+close OUT || die "close: $!";
+rename("$control.tmp", "$control");