diff options
Diffstat (limited to 'scripts/Dpkg/Control')
-rw-r--r-- | scripts/Dpkg/Control/Changelog.pm | 2 | ||||
-rw-r--r-- | scripts/Dpkg/Control/Fields.pm | 22 | ||||
-rw-r--r-- | scripts/Dpkg/Control/Hash.pm | 32 | ||||
-rw-r--r-- | scripts/Dpkg/Control/Info.pm | 10 |
4 files changed, 33 insertions, 33 deletions
diff --git a/scripts/Dpkg/Control/Changelog.pm b/scripts/Dpkg/Control/Changelog.pm index affa096ec..420ffc943 100644 --- a/scripts/Dpkg/Control/Changelog.pm +++ b/scripts/Dpkg/Control/Changelog.pm @@ -18,7 +18,7 @@ package Dpkg::Control::Changelog; use strict; use warnings; -our $VERSION = "1.00"; +our $VERSION = '1.00'; use Dpkg::Control; use base 'Dpkg::Control'; diff --git a/scripts/Dpkg/Control/Fields.pm b/scripts/Dpkg/Control/Fields.pm index 0adc75733..2494eaee3 100644 --- a/scripts/Dpkg/Control/Fields.pm +++ b/scripts/Dpkg/Control/Fields.pm @@ -18,7 +18,7 @@ package Dpkg::Control::Fields; use strict; use warnings; -our $VERSION = "1.00"; +our $VERSION = '1.00'; use base qw(Exporter); use Dpkg::Gettext; @@ -288,7 +288,7 @@ our %FIELDS = ( ); my @checksum_fields = map { &field_capitalize("Checksums-$_") } checksums_get_list(); -my @sum_fields = map { $_ eq "md5" ? "MD5sum" : &field_capitalize($_) } +my @sum_fields = map { $_ eq 'md5' ? 'MD5sum' : &field_capitalize($_) } checksums_get_list(); &field_register($_, CTRL_PKG_SRC | CTRL_FILE_CHANGES) foreach @checksum_fields; &field_register($_, CTRL_INDEX_PKG) foreach @sum_fields; @@ -330,20 +330,20 @@ $FIELD_ORDER{CTRL_INDEX_PKG()} = [ @{$FIELD_ORDER{CTRL_PKG_DEB()}} ]; &field_insert_before(CTRL_INDEX_PKG, 'Section', 'Filename', 'Size', @sum_fields); # Order for CTRL_INDEX_SRC is derived from CTRL_PKG_SRC $FIELD_ORDER{CTRL_INDEX_SRC()} = [ @{$FIELD_ORDER{CTRL_PKG_SRC()}} ]; -@{$FIELD_ORDER{CTRL_INDEX_SRC()}} = map { $_ eq "Source" ? "Package" : $_ } +@{$FIELD_ORDER{CTRL_INDEX_SRC()}} = map { $_ eq 'Source' ? 'Package' : $_ } @{$FIELD_ORDER{CTRL_PKG_SRC()}}; -&field_insert_after(CTRL_INDEX_SRC, "Version", "Priority", "Section"); -&field_insert_before(CTRL_INDEX_SRC, "Checksums-Md5", "Directory"); +&field_insert_after(CTRL_INDEX_SRC, 'Version', 'Priority', 'Section'); +&field_insert_before(CTRL_INDEX_SRC, 'Checksums-Md5', 'Directory'); # Register vendor specifics fields -foreach my $op (run_vendor_hook("register-custom-fields")) { +foreach my $op (run_vendor_hook('register-custom-fields')) { next if not (defined $op and ref $op); # Skip when not implemented by vendor my $func = shift @$op; - if ($func eq "register") { + if ($func eq 'register') { &field_register(@$op); - } elsif ($func eq "insert_before") { + } elsif ($func eq 'insert_before') { &field_insert_before(@$op); - } elsif ($func eq "insert_after") { + } elsif ($func eq 'insert_after') { &field_insert_after(@$op); } else { error("vendor hook register-custom-fields sent bad data: @$op"); @@ -376,7 +376,7 @@ except the first of each word (words are separated by a dash in field names). sub field_capitalize($) { my $field = lc(shift); # Some special cases due to history - return "MD5sum" if $field eq "md5sum"; + return 'MD5sum' if $field eq 'md5sum'; return uc($field) if checksums_is_supported($field); # Generic case return join '-', map { ucfirst } split /-/, $field; @@ -466,7 +466,7 @@ sub field_transfer_single($$;$) { } } elsif (not field_is_allowed_in($field, $from_type)) { warning(_g("unknown information field '%s' in input data in %s"), - $field, $from->get_option("name") || _g("control information")); + $field, $from->get_option('name') || _g('control information')); } return; } diff --git a/scripts/Dpkg/Control/Hash.pm b/scripts/Dpkg/Control/Hash.pm index eee6dc350..038ac539a 100644 --- a/scripts/Dpkg/Control/Hash.pm +++ b/scripts/Dpkg/Control/Hash.pm @@ -18,7 +18,7 @@ package Dpkg::Control::Hash; use strict; use warnings; -our $VERSION = "1.00"; +our $VERSION = '1.00'; use Dpkg::Gettext; use Dpkg::ErrorHandling; @@ -183,7 +183,7 @@ sub parse { $parabody = 1; if (exists $self->{$1}) { unless ($$self->{allow_duplicate}) { - syntaxerr($desc, sprintf(_g("duplicate field %s found"), $1)); + syntaxerr($desc, sprintf(_g('duplicate field %s found'), $1)); } } $self->{$1} = $2; @@ -191,7 +191,7 @@ sub parse { } elsif (m/^\s(\s*\S.*)$/) { my $line = $1; unless (defined($cf)) { - syntaxerr($desc, _g("continued value line not in field")); + syntaxerr($desc, _g('continued value line not in field')); } if ($line =~ /^\.+$/) { $line = substr $line, 1; @@ -205,18 +205,18 @@ sub parse { last if m/^\s*$/; } } else { - syntaxerr($desc, _g("PGP signature not allowed here")); + syntaxerr($desc, _g('PGP signature not allowed here')); } } elsif (m/^$/ || ($expect_pgp_sig && m/^-----BEGIN PGP SIGNATURE-----$/)) { if ($expect_pgp_sig) { # Skip empty lines $_ = <$fh> while defined($_) && $_ =~ /^\s*$/; length($_) || - syntaxerr($desc, _g("expected PGP signature, found EOF " . - "after blank line")); + syntaxerr($desc, _g('expected PGP signature, found EOF ' . + 'after blank line')); s/\s*\n$//; unless (m/^-----BEGIN PGP SIGNATURE-----$/) { - syntaxerr($desc, sprintf(_g("expected PGP signature, " . + syntaxerr($desc, sprintf(_g('expected PGP signature, ' . "found something else \`%s'"), $_)); } # Skip PGP signature @@ -225,7 +225,7 @@ sub parse { last if m/^-----END PGP SIGNATURE-----$/; } unless (defined($_)) { - syntaxerr($desc, _g("unfinished PGP signature")); + syntaxerr($desc, _g('unfinished PGP signature')); } # This does not mean the signature is correct, that needs to # be verified by gnupg. @@ -234,12 +234,12 @@ sub parse { last; # Finished parsing one block } else { syntaxerr($desc, - _g("line with unknown format (not field-colon-value)")); + _g('line with unknown format (not field-colon-value)')); } } if ($expect_pgp_sig and not $pgp_signed) { - syntaxerr($desc, _g("unfinished PGP signature")); + syntaxerr($desc, _g('unfinished PGP signature')); } return defined($cf); @@ -296,7 +296,7 @@ filehandle. sub output { my ($self, $fh) = @_; - my $str = ""; + my $str = ''; my @keys; if (@{$$self->{out_order}}) { my $i = 1; @@ -324,7 +324,7 @@ sub output { next if $$self->{drop_empty} and $value !~ m/\S/; # Escape data to follow control file syntax my @lines = split(/\n/, $value); - $value = (scalar @lines) ? shift @lines : ""; + $value = (scalar @lines) ? shift @lines : ''; foreach (@lines) { s/\s+$//; if (/^$/ or /^\.+$/) { @@ -336,7 +336,7 @@ sub output { # Print it out if ($fh) { print $fh "$key: $value\n" || - syserr(_g("write error on control data")); + syserr(_g('write error on control data')); } $str .= "$key: $value\n" if defined wantarray; } @@ -407,7 +407,7 @@ use base qw(Tie::ExtraHash); sub field_capitalize($) { my $field = lc(shift); # Some special cases due to history - return "MD5sum" if $field eq "md5sum"; + return 'MD5sum' if $field eq 'md5sum'; return uc($field) if checksums_is_supported($field); # Generic case return join '-', map { ucfirst } split /-/, $field; @@ -433,8 +433,8 @@ sub new { sub TIEHASH { my ($class, $parent) = @_; - die "Parent object must be Dpkg::Control::Hash" - if not $parent->isa("Dpkg::Control::Hash"); + die 'Parent object must be Dpkg::Control::Hash' + if not $parent->isa('Dpkg::Control::Hash'); return bless [ {}, $$parent ], $class; } diff --git a/scripts/Dpkg/Control/Info.pm b/scripts/Dpkg/Control/Info.pm index 8e28446b0..41fbb3352 100644 --- a/scripts/Dpkg/Control/Info.pm +++ b/scripts/Dpkg/Control/Info.pm @@ -18,7 +18,7 @@ package Dpkg::Control::Info; use strict; use warnings; -our $VERSION = "1.00"; +our $VERSION = '1.00'; use Dpkg::Control; use Dpkg::ErrorHandling; @@ -62,7 +62,7 @@ sub new { if ($arg) { $self->load($arg); } else { - $self->load("debian/control"); + $self->load('debian/control'); } return $self; } @@ -100,17 +100,17 @@ sub parse { return if not $cdata->parse($fh, $desc); $self->{source} = $cdata; unless (exists $cdata->{Source}) { - syntaxerr($desc, _g("first block lacks a source field")); + syntaxerr($desc, _g('first block lacks a source field')); } while (1) { $cdata = Dpkg::Control->new(type => CTRL_INFO_PKG); last if not $cdata->parse($fh, $desc); push @{$self->{packages}}, $cdata; unless (exists $cdata->{Package}) { - syntaxerr($desc, _g("block lacks the '%s' field"), "Package"); + syntaxerr($desc, _g("block lacks the '%s' field"), 'Package'); } unless (exists $cdata->{Architecture}) { - syntaxerr($desc, _g("block lacks the '%s' field"), "Architecture"); + syntaxerr($desc, _g("block lacks the '%s' field"), 'Architecture'); } } |