1
# Copyright © 2008 Raphaël Hertzog <hertzog@debian.org>
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; either version 2 of the License, or
6
# (at your option) any later version.
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
# GNU General Public License for more details.
13
# You should have received a copy of the GNU General Public License
14
# along with this program. If not, see <http://www.gnu.org/licenses/>.
16
package Dpkg::Source::Package::V3::custom;
21
our $VERSION = "0.01";
23
use base 'Dpkg::Source::Package';
27
use Dpkg::ErrorHandling;
29
our $CURRENT_MINOR_VERSION = "0";
31
sub parse_cmdline_option {
32
my ($self, $opt) = @_;
33
if ($opt =~ /^--target-format=(.*)$/) {
34
$self->{'options'}{'target_format'} = $1;
40
error(_g("Format `3.0 (custom)' is only used to create source packages"));
44
my ($self, $dir) = @_;
45
return (scalar(@{$self->{'options'}{'ARGV'}}),
46
_g("no files indicated on command line"));
50
my ($self, $dir) = @_;
51
# Update real target format
52
my $format = $self->{'options'}{'target_format'};
53
error(_g("--target-format option is missing")) unless $format;
54
$self->{'fields'}{'Format'} = $format;
56
foreach my $file (@{$self->{'options'}{'ARGV'}}) {
57
$self->add_file($file);