summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-26 10:22:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-26 10:22:39 +0000
commit34a04be281a82ae949c8869ffa8ca3df0d3b4f6b (patch)
tree67d67b3dc28674b926383a12ed3b7bde63d42608 /lib
parentAdding upstream version 0.1.44. (diff)
downloaddebputy-34a04be281a82ae949c8869ffa8ca3df0d3b4f6b.tar.xz
debputy-34a04be281a82ae949c8869ffa8ca3df0d3b4f6b.zip
Adding upstream version 0.1.45.upstream/0.1.45
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/Dpkg/BuildDriver/Debputy.pm44
1 files changed, 44 insertions, 0 deletions
diff --git a/lib/Dpkg/BuildDriver/Debputy.pm b/lib/Dpkg/BuildDriver/Debputy.pm
new file mode 100644
index 0000000..957f608
--- /dev/null
+++ b/lib/Dpkg/BuildDriver/Debputy.pm
@@ -0,0 +1,44 @@
+package Dpkg::BuildDriver::Debputy;
+use strict;
+use warnings FATAL => 'all';
+use Dpkg::ErrorHandling;
+
+sub _run_cmd {
+ my @cmd = @_;
+ printcmd(@cmd);
+ system @cmd and subprocerr("@cmd");
+}
+
+sub new {
+ my ($this, %opts) = @_;
+ my $class = ref($this) || $this;
+ my $self = bless({
+ 'ctrl' => $opts{ctrl},
+ 'debputy_cmd' => 'debputy',
+ }, $class);
+ return $self;
+}
+
+
+sub pre_check {
+ my ($self) = @_;
+ my $ctrl_src = $self->{'ctrl'}->get_source();
+ my $debputy_self_hosting_cmd = './debputy.sh';
+ if ($ctrl_src->{"Source"} eq 'debputy' and -f -x $debputy_self_hosting_cmd) {
+ $self->{'debputy_cmd'} = $debputy_self_hosting_cmd;
+ notice("Detected this is a self-hosting build of debputy. Using \"${debputy_self_hosting_cmd}\" to self-host.");
+ }
+ return;
+}
+
+sub need_build_task {
+ return 0;
+}
+
+sub run_task {
+ my ($self, $task) = @_;
+ _run_cmd($self->{'debputy_cmd'}, 'internal-command', 'dpkg-build-driver-run-task', $task);
+ return;
+}
+
+1;