more bugfixes

This commit is contained in:
joey
2000-04-22 02:09:13 +00:00
parent 624306abba
commit f85230dc81
4 changed files with 47 additions and 6 deletions

View File

@@ -253,6 +253,15 @@ to produce a suitable build tree.
sub prep {}
=item cleantree
This method should clean the unpacked_tree of any effects the prep and
build methods might have on it.
=cut
sub cleantree {}
=item build
This method takes a prepped build tree, and simply builds a package from

View File

@@ -384,6 +384,19 @@ sub build {
return $this->name."_".$this->version."-".$this->release."_".$this->arch.".deb";
}
=item cleantree
Delete the entire debian/ directory.
=cut
sub cleantree {
my $this=shift;
my $dir=$this->unpacked_tree || die "The package must be unpacked first!";
system("rm -rf $dir/debian");
}
=item package
Set/get package name.

View File

@@ -265,6 +265,19 @@ sub prep {
close OUT;
}
=item cleantree
Delete the spec file.
=cut
sub cleantree {
my $this=shift;
my $dir=$this->unpacked_tree || die "The package must be unpacked first!";
unlink "$dir/".$this->name."-".$this->version."-".$this->release.".spec";
}
=item build
Build a rpm. If RPMBUILDOPT is set in the environement, the options in
@@ -376,7 +389,8 @@ sub _script_helper {
# get
return unless defined wantarray; # optimization
$_=$this->{$script};
return $_ if ! defined $_ || m/^\s*$/;
return '' unless defined $_;
return $_ if m/^\s*$/;
my $f = pack("u",$_);
$f =~ s/%/%%/g; # Rpm expands %S, so escape such things.
return "set -e\n".