summaryrefslogtreecommitdiff
path: root/scripts/Dpkg
diff options
context:
space:
mode:
authorRaphaël Hertzog <hertzog@debian.org>2010-04-28 22:27:08 +0200
committerRaphaël Hertzog <hertzog@debian.org>2010-05-02 21:08:05 +0200
commit8c1fc347f7d50b64f3693ba1d7e064bf9ccbae8c (patch)
treeb2df449436900af90e5c0de07a1b02016974615a /scripts/Dpkg
parent6a606c37571a2aa25dd7d4d46d4ed45206e4dbeb (diff)
downloaddpkg-8c1fc347f7d50b64f3693ba1d7e064bf9ccbae8c.tar.gz
dpkg-source: implement --before-build and --after-build command
Those commands are really hooks that source formats can use and that will be called by dpkg-buildpackage before and after the actual build. Source formats "2.0" and "3.0 (quilt)" use this hook to ensure patches are applied before the build.
Diffstat (limited to 'scripts/Dpkg')
-rw-r--r--scripts/Dpkg/Source/Package.pm8
-rw-r--r--scripts/Dpkg/Source/Package/V2.pm5
2 files changed, 13 insertions, 0 deletions
diff --git a/scripts/Dpkg/Source/Package.pm b/scripts/Dpkg/Source/Package.pm
index 6c9cba2ca..c9d1a07e2 100644
--- a/scripts/Dpkg/Source/Package.pm
+++ b/scripts/Dpkg/Source/Package.pm
@@ -374,6 +374,10 @@ sub do_extract {
# Function used specifically during creation of a source package
+sub before_build {
+ my ($self, $dir) = @_;
+}
+
sub build {
my $self = shift;
eval { $self->do_build(@_) };
@@ -383,6 +387,10 @@ sub build {
}
}
+sub after_build {
+ my ($self, $dir) = @_;
+}
+
sub do_build {
internerr("Dpkg::Source::Package doesn't know how to build a " .
"source package. Use one of the subclasses.");
diff --git a/scripts/Dpkg/Source/Package/V2.pm b/scripts/Dpkg/Source/Package/V2.pm
index 1fc1e0abe..787d6acd6 100644
--- a/scripts/Dpkg/Source/Package/V2.pm
+++ b/scripts/Dpkg/Source/Package/V2.pm
@@ -214,6 +214,11 @@ sub can_build {
return (0, _g("no orig.tar file found"));
}
+sub before_build {
+ my ($self, $dir) = @_;
+ $self->check_patches_applied($dir) if $self->{'options'}{'preparation'};
+}
+
sub prepare_build {
my ($self, $dir) = @_;
$self->{'diff_options'} = {