diff options
Diffstat (limited to 'scripts/Dpkg/Source/Package/V3')
-rw-r--r-- | scripts/Dpkg/Source/Package/V3/bzr.pm | 38 | ||||
-rw-r--r-- | scripts/Dpkg/Source/Package/V3/custom.pm | 8 | ||||
-rw-r--r-- | scripts/Dpkg/Source/Package/V3/git.pm | 78 | ||||
-rw-r--r-- | scripts/Dpkg/Source/Package/V3/native.pm | 14 | ||||
-rw-r--r-- | scripts/Dpkg/Source/Package/V3/quilt.pm | 48 |
5 files changed, 93 insertions, 93 deletions
diff --git a/scripts/Dpkg/Source/Package/V3/bzr.pm b/scripts/Dpkg/Source/Package/V3/bzr.pm index 28c9935a8..9bc69f23e 100644 --- a/scripts/Dpkg/Source/Package/V3/bzr.pm +++ b/scripts/Dpkg/Source/Package/V3/bzr.pm @@ -24,7 +24,7 @@ package Dpkg::Source::Package::V3::bzr; use strict; use warnings; -our $VERSION = "0.01"; +our $VERSION = '0.01'; use base 'Dpkg::Source::Package'; @@ -41,7 +41,7 @@ use Dpkg::Source::Archive; use Dpkg::Exit; use Dpkg::Source::Functions qw(erasedir); -our $CURRENT_MINOR_VERSION = "0"; +our $CURRENT_MINOR_VERSION = '0'; sub import { foreach my $dir (split(/:/, $ENV{PATH})) { @@ -49,28 +49,28 @@ sub import { return 1; } } - error(_g("cannot unpack bzr-format source package because " . - "bzr is not in the PATH")); + error(_g('cannot unpack bzr-format source package because ' . + 'bzr is not in the PATH')); } sub sanity_check { my $srcdir = shift; if (! -d "$srcdir/.bzr") { - error(_g("source directory is not the top directory of a bzr repository (%s/.bzr not present), but Format bzr was specified"), + error(_g('source directory is not the top directory of a bzr repository (%s/.bzr not present), but Format bzr was specified'), $srcdir); } # Symlinks from .bzr to outside could cause unpack failures, or # point to files they shouldn't, so check for and don't allow. if (-l "$srcdir/.bzr") { - error(_g("%s is a symlink"), "$srcdir/.bzr"); + error(_g('%s is a symlink'), "$srcdir/.bzr"); } my $abs_srcdir = Cwd::abs_path($srcdir); find(sub { if (-l $_) { if (Cwd::abs_path(readlink($_)) !~ /^\Q$abs_srcdir\E(\/|$)/) { - error(_g("%s is a symlink to outside %s"), + error(_g('%s is a symlink to outside %s'), $File::Find::name, $srcdir); } } @@ -114,8 +114,8 @@ sub do_build { # Check for uncommitted files. # To support dpkg-source -i, remove any ignored files from the # output of bzr status. - open(my $bzr_status_fh, '-|', "bzr", "status") || - subprocerr("bzr status"); + open(my $bzr_status_fh, '-|', 'bzr', 'status') || + subprocerr('bzr status'); my @files; while (<$bzr_status_fh>) { chomp; @@ -125,10 +125,10 @@ sub do_build { push @files, $_; } } - close($bzr_status_fh) || syserr(_g("bzr status exited nonzero")); + close($bzr_status_fh) || syserr(_g('bzr status exited nonzero')); if (@files) { - error(_g("uncommitted, not-ignored changes in working directory: %s"), - join(" ", @files)); + error(_g('uncommitted, not-ignored changes in working directory: %s'), + join(' ', @files)); } chdir($old_cwd) || @@ -138,11 +138,11 @@ sub do_build { push @Dpkg::Exit::handlers, sub { erasedir($tmp) }; my $tardir = "$tmp/$dirname"; - system("bzr", "branch", $dir, $tardir); + system('bzr', 'branch', $dir, $tardir); $? && subprocerr("bzr branch $dir $tardir"); # Remove the working tree. - system("bzr", "remove-tree", $tardir); + system('bzr', 'remove-tree', $tardir); # Some branch metadata files are unhelpful. unlink("$tardir/.bzr/branch/branch-name", @@ -150,7 +150,7 @@ sub do_build { # Create the tar file my $debianfile = "$basenamerev.bzr.tar." . $self->{options}{comp_ext}; - info(_g("building %s in %s"), + info(_g('building %s in %s'), $sourcepackage, $debianfile); my $tar = Dpkg::Source::Archive->new(filename => $debianfile, compression => $self->{options}{compression}, @@ -177,18 +177,18 @@ sub do_extract { my @files = $self->get_files(); if (@files > 1) { - error(_g("format v3.0 uses only one source file")); + error(_g('format v3.0 uses only one source file')); } my $tarfile = $files[0]; if ($tarfile !~ /^\Q$basenamerev\E\.bzr\.tar\.$compression_re_file_ext$/) { - error(_g("expected %s, got %s"), + error(_g('expected %s, got %s'), "$basenamerev.bzr.tar.$compression_re_file_ext", $tarfile); } erasedir($newdirectory); # Extract main tarball - info(_g("unpacking %s"), $tarfile); + info(_g('unpacking %s'), $tarfile); my $tar = Dpkg::Source::Archive->new(filename => "$dscdir$tarfile"); $tar->extract($newdirectory); @@ -199,7 +199,7 @@ sub do_extract { syserr(_g("unable to chdir to `%s'"), $newdirectory); # Reconstitute the working tree. - system("bzr", "checkout"); + system('bzr', 'checkout'); chdir($old_cwd) || syserr(_g("unable to chdir to `%s'"), $old_cwd); diff --git a/scripts/Dpkg/Source/Package/V3/custom.pm b/scripts/Dpkg/Source/Package/V3/custom.pm index 9ba8d5874..475a7cf46 100644 --- a/scripts/Dpkg/Source/Package/V3/custom.pm +++ b/scripts/Dpkg/Source/Package/V3/custom.pm @@ -18,7 +18,7 @@ package Dpkg::Source::Package::V3::custom; use strict; use warnings; -our $VERSION = "0.01"; +our $VERSION = '0.01'; use base 'Dpkg::Source::Package'; @@ -26,7 +26,7 @@ use Dpkg; use Dpkg::Gettext; use Dpkg::ErrorHandling; -our $CURRENT_MINOR_VERSION = "0"; +our $CURRENT_MINOR_VERSION = '0'; sub parse_cmdline_option { my ($self, $opt) = @_; @@ -43,14 +43,14 @@ sub do_extract { sub can_build { my ($self, $dir) = @_; return (scalar(@{$self->{options}{ARGV}}), - _g("no files indicated on command line")); + _g('no files indicated on command line')); } sub do_build { my ($self, $dir) = @_; # Update real target format my $format = $self->{options}{target_format}; - error(_g("--target-format option is missing")) unless $format; + error(_g('--target-format option is missing')) unless $format; $self->{fields}{'Format'} = $format; # Add all files foreach my $file (@{$self->{options}{ARGV}}) { diff --git a/scripts/Dpkg/Source/Package/V3/git.pm b/scripts/Dpkg/Source/Package/V3/git.pm index 863576f86..5bb83ed3c 100644 --- a/scripts/Dpkg/Source/Package/V3/git.pm +++ b/scripts/Dpkg/Source/Package/V3/git.pm @@ -22,7 +22,7 @@ package Dpkg::Source::Package::V3::git; use strict; use warnings; -our $VERSION = "0.02"; +our $VERSION = '0.02'; use base 'Dpkg::Source::Package'; @@ -36,7 +36,7 @@ use Dpkg::ErrorHandling; use Dpkg::Exit; use Dpkg::Source::Functions qw(erasedir); -our $CURRENT_MINOR_VERSION = "0"; +our $CURRENT_MINOR_VERSION = '0'; # Remove variables from the environment that might cause git to do # something unexpected. @@ -52,20 +52,20 @@ sub import { return 1; } } - error(_g("cannot unpack git-format source package because " . - "git is not in the PATH")); + error(_g('cannot unpack git-format source package because ' . + 'git is not in the PATH')); } sub sanity_check { my $srcdir = shift; if (! -d "$srcdir/.git") { - error(_g("source directory is not the top directory of a git " . - "repository (%s/.git not present), but Format git was " . - "specified"), $srcdir); + error(_g('source directory is not the top directory of a git ' . + 'repository (%s/.git not present), but Format git was ' . + 'specified'), $srcdir); } if (-s "$srcdir/.gitmodules") { - error(_g("git repository %s uses submodules; this is not yet supported"), + error(_g('git repository %s uses submodules; this is not yet supported'), $srcdir); } @@ -107,17 +107,17 @@ sub do_build { # To support dpkg-source -i, get a list of files # equivalent to the ones git status finds, and remove any # ignored files from it. - my @ignores = "--exclude-per-directory=.gitignore"; + my @ignores = '--exclude-per-directory=.gitignore'; my $core_excludesfile = `git config --get core.excludesfile`; chomp $core_excludesfile; if (length $core_excludesfile && -e $core_excludesfile) { push @ignores, "--exclude-from=$core_excludesfile"; } - if (-e ".git/info/exclude") { - push @ignores, "--exclude-from=.git/info/exclude"; + if (-e '.git/info/exclude') { + push @ignores, '--exclude-from=.git/info/exclude'; } - open(my $git_ls_files_fh, '-|', "git", "ls-files", "--modified", "--deleted", - "-z", "--others", @ignores) || subprocerr("git ls-files"); + open(my $git_ls_files_fh, '-|', 'git', 'ls-files', '--modified', '--deleted', + '-z', '--others', @ignores) || subprocerr('git ls-files'); my @files; { local $/ = "\0"; while (<$git_ls_files_fh>) { @@ -128,10 +128,10 @@ sub do_build { } } } - close($git_ls_files_fh) || syserr(_g("git ls-files exited nonzero")); + close($git_ls_files_fh) || syserr(_g('git ls-files exited nonzero')); if (@files) { - error(_g("uncommitted, not-ignored changes in working directory: %s"), - join(" ", @files)); + error(_g('uncommitted, not-ignored changes in working directory: %s'), + join(' ', @files)); } # If a depth was specified, need to create a shallow clone and @@ -146,29 +146,29 @@ sub do_build { my $clone_dir = "$tmp/repo.git"; # file:// is needed to avoid local cloning, which does not # create a shallow clone. - info(_g("creating shallow clone with depth %s"), + info(_g('creating shallow clone with depth %s'), $self->{options}{git_depth}); - system("git", "clone", "--depth=" . $self->{options}{git_depth}, - "--quiet", "--bare", "file://" . abs_path($dir), $clone_dir); - $? && subprocerr("git clone"); + system('git', 'clone', '--depth=' . $self->{options}{git_depth}, + '--quiet', '--bare', 'file://' . abs_path($dir), $clone_dir); + $? && subprocerr('git clone'); chdir($clone_dir) || syserr(_g("unable to chdir to `%s'"), $clone_dir); $shallowfile = "$basenamerev.gitshallow"; - system("cp", "-f", "shallow", "$old_cwd/$shallowfile"); - $? && subprocerr("cp shallow"); + system('cp', '-f', 'shallow', "$old_cwd/$shallowfile"); + $? && subprocerr('cp shallow'); } # Create the git bundle. my $bundlefile = "$basenamerev.git"; - my @bundle_arg = $self->{options}{git_ref} ? - (@{$self->{options}{git_ref}}) : "--all"; - info(_g("bundling: %s"), join(" ", @bundle_arg)); - system("git", "bundle", "create", "$old_cwd/$bundlefile", + my @bundle_arg=$self->{options}{git_ref} ? + (@{$self->{options}{git_ref}}) : '--all'; + info(_g('bundling: %s'), join(' ', @bundle_arg)); + system('git', 'bundle', 'create', "$old_cwd/$bundlefile", @bundle_arg, - "HEAD", # ensure HEAD is included no matter what - "--", # avoids ambiguity error when referring to eg, a debian branch + 'HEAD', # ensure HEAD is included no matter what + '--', # avoids ambiguity error when referring to eg, a debian branch ); - $? && subprocerr("git bundle"); + $? && subprocerr('git bundle'); chdir($old_cwd) || syserr(_g("unable to chdir to `%s'"), $old_cwd); @@ -198,35 +198,35 @@ sub do_extract { if (! defined $bundle) { $bundle = $file; } else { - error(_g("format v3.0 (git) uses only one .git file")); + error(_g('format v3.0 (git) uses only one .git file')); } } elsif ($file =~ /^\Q$basenamerev\E\.gitshallow$/) { if (! defined $shallow) { $shallow = $file; } else { - error(_g("format v3.0 (git) uses only one .gitshallow file")); + error(_g('format v3.0 (git) uses only one .gitshallow file')); } } else { - error(_g("format v3.0 (git) unknown file: %s", $file)); + error(_g('format v3.0 (git) unknown file: %s', $file)); } } if (! defined $bundle) { - error(_g("format v3.0 (git) expected %s"), "$basenamerev.git"); + error(_g('format v3.0 (git) expected %s'), "$basenamerev.git"); } erasedir($newdirectory); # Extract git bundle. - info(_g("cloning %s"), $bundle); - system("git", "clone", "--quiet", $dscdir.$bundle, $newdirectory); - $? && subprocerr("git bundle"); + info(_g('cloning %s'), $bundle); + system('git', 'clone', '--quiet', $dscdir . $bundle, $newdirectory); + $? && subprocerr('git bundle'); if (defined $shallow) { # Move shallow info file into place, so git does not # try to follow parents of shallow refs. - info(_g("setting up shallow clone")); - system("cp", "-f", $dscdir.$shallow, "$newdirectory/.git/shallow"); - $? && subprocerr("cp"); + info(_g('setting up shallow clone')); + system('cp', '-f', $dscdir . $shallow, "$newdirectory/.git/shallow"); + $? && subprocerr('cp'); } sanity_check($newdirectory); diff --git a/scripts/Dpkg/Source/Package/V3/native.pm b/scripts/Dpkg/Source/Package/V3/native.pm index 726bc3905..de706f39a 100644 --- a/scripts/Dpkg/Source/Package/V3/native.pm +++ b/scripts/Dpkg/Source/Package/V3/native.pm @@ -18,7 +18,7 @@ package Dpkg::Source::Package::V3::native; use strict; use warnings; -our $VERSION = "0.01"; +our $VERSION = '0.01'; use base 'Dpkg::Source::Package'; @@ -34,7 +34,7 @@ use Cwd; use File::Basename; use File::Temp qw(tempfile); -our $CURRENT_MINOR_VERSION = "0"; +our $CURRENT_MINOR_VERSION = '0'; sub do_extract { my ($self, $newdirectory) = @_; @@ -48,17 +48,17 @@ sub do_extract { my $tarfile; foreach my $file ($self->get_files()) { if ($file =~ /^\Q$basenamerev\E\.tar\.$compression_re_file_ext$/) { - error(_g("multiple tarfiles in v1.0 source package")) if $tarfile; + error(_g('multiple tarfiles in v1.0 source package')) if $tarfile; $tarfile = $file; } else { - error(_g("unrecognized file for a native source package: %s"), $file); + error(_g('unrecognized file for a native source package: %s'), $file); } } - error(_g("no tarfile in Files field")) unless $tarfile; + error(_g('no tarfile in Files field')) unless $tarfile; erasedir($newdirectory); - info(_g("unpacking %s"), $tarfile); + info(_g('unpacking %s'), $tarfile); my $tar = Dpkg::Source::Archive->new(filename => "$dscdir$tarfile"); $tar->extract($newdirectory); } @@ -81,7 +81,7 @@ sub do_build { my $basenamerev = $self->get_basename(1); my $tarname = "$basenamerev.tar." . $self->{options}{comp_ext}; - info(_g("building %s in %s"), $sourcepackage, $tarname); + info(_g('building %s in %s'), $sourcepackage, $tarname); my ($ntfh, $newtar) = tempfile("$tarname.new.XXXXXX", DIR => getcwd(), UNLINK => 0); diff --git a/scripts/Dpkg/Source/Package/V3/quilt.pm b/scripts/Dpkg/Source/Package/V3/quilt.pm index 7ebee244f..bca916b6b 100644 --- a/scripts/Dpkg/Source/Package/V3/quilt.pm +++ b/scripts/Dpkg/Source/Package/V3/quilt.pm @@ -18,7 +18,7 @@ package Dpkg::Source::Package::V3::quilt; use strict; use warnings; -our $VERSION = "0.01"; +our $VERSION = '0.01'; # Based on wig&pen implementation use base 'Dpkg::Source::Package::V2'; @@ -34,7 +34,7 @@ use Dpkg::Exit; use File::Spec; use File::Copy; -our $CURRENT_MINOR_VERSION = "0"; +our $CURRENT_MINOR_VERSION = '0'; sub init_options { my ($self) = @_; @@ -75,15 +75,15 @@ sub can_build { my $quilt = $self->build_quilt_object($dir); $msg = $quilt->find_problems(); return (0, $msg) if $msg; - return (1, ""); + return (1, ''); } sub get_autopatch_name { my ($self) = @_; if ($self->{options}{single_debian_patch}) { - return "debian-changes"; + return 'debian-changes'; } else { - return "debian-changes-" . $self->{fields}{'Version'}; + return 'debian-changes-' . $self->{fields}{'Version'}; } } @@ -107,8 +107,8 @@ sub apply_patches { # Update debian/patches/series symlink if needed to allow quilt usage my $series = $quilt->get_series_file(); my $basename = (File::Spec->splitpath($series))[2]; - if ($basename ne "series") { - my $dest = $quilt->get_patch_file("series"); + if ($basename ne 'series') { + my $dest = $quilt->get_patch_file('series'); unlink($dest) if -l $dest; unless (-f _) { # Don't overwrite real files symlink($basename, $dest) || @@ -118,18 +118,18 @@ sub apply_patches { return unless scalar($quilt->series()); - if ($opts{usage} eq "preparation" and + if ($opts{usage} eq 'preparation' and $self->{options}{unapply_patches} eq 'auto') { # We're applying the patches in --before-build, remember to unapply # them afterwards in --after-build - my $pc_unapply = $quilt->get_db_file(".dpkg-source-unapply"); - open(my $unapply_fh, ">", $pc_unapply) || - syserr(_g("cannot write %s"), $pc_unapply); + my $pc_unapply = $quilt->get_db_file('.dpkg-source-unapply'); + open(my $unapply_fh, '>', $pc_unapply) || + syserr(_g('cannot write %s'), $pc_unapply); close($unapply_fh); } # Apply patches - my $pc_applied = $quilt->get_db_file("applied-patches"); + my $pc_applied = $quilt->get_db_file('applied-patches'); $opts{timestamp} = fs_time($pc_applied); if ($opts{skip_auto}) { my $auto_patch = $self->get_autopatch_name(); @@ -146,7 +146,7 @@ sub unapply_patches { $opts{verbose} //= 1; - my $pc_applied = $quilt->get_db_file("applied-patches"); + my $pc_applied = $quilt->get_db_file('applied-patches'); my @applied = $quilt->applied(); $opts{timestamp} = fs_time($pc_applied) if @applied; @@ -180,9 +180,9 @@ sub do_build { if (scalar grep { $version eq $_ } @{$self->{options}{allow_version_of_quilt_db}}) { - warning(_g("unsupported version of the quilt metadata: %s"), $version); + warning(_g('unsupported version of the quilt metadata: %s'), $version); } else { - error(_g("unsupported version of the quilt metadata: %s"), $version); + error(_g('unsupported version of the quilt metadata: %s'), $version); } } @@ -192,9 +192,9 @@ sub do_build { sub after_build { my ($self, $dir) = @_; my $quilt = $self->build_quilt_object($dir); - my $pc_unapply = $quilt->get_db_file(".dpkg-source-unapply"); + my $pc_unapply = $quilt->get_db_file('.dpkg-source-unapply'); my $opt_unapply = $self->{options}{unapply_patches}; - if (($opt_unapply eq "auto" and -e $pc_unapply) or $opt_unapply eq "yes") { + if (($opt_unapply eq 'auto' and -e $pc_unapply) or $opt_unapply eq 'yes') { unlink($pc_unapply); $self->unapply_patches($dir); } @@ -207,7 +207,7 @@ sub check_patches_applied { my $next = $quilt->next(); return if not defined $next; - my $first_patch = File::Spec->catfile($dir, "debian", "patches", $next); + my $first_patch = File::Spec->catfile($dir, 'debian', 'patches', $next); my $patch_obj = Dpkg::Source::Patch->new(filename => $first_patch); return unless $patch_obj->check_apply($dir); @@ -217,7 +217,7 @@ sub check_patches_applied { sub _add_line { my ($file, $line) = @_; - open(my $file_fh, ">>", $file) || syserr(_g("cannot write %s"), $file); + open(my $file_fh, '>>', $file) || syserr(_g('cannot write %s'), $file); print $file_fh "$line\n"; close($file_fh); } @@ -225,10 +225,10 @@ sub _add_line { sub _drop_line { my ($file, $re) = @_; - open(my $file_fh, "<", $file) || syserr(_g("cannot read %s"), $file); + open(my $file_fh, '<', $file) || syserr(_g('cannot read %s'), $file); my @lines = <$file_fh>; close($file_fh); - open($file_fh, ">", $file) || syserr(_g("cannot write %s"), $file); + open($file_fh, '>', $file) || syserr(_g('cannot write %s'), $file); print($file_fh $_) foreach grep { not /^\Q$re\E\s*$/ } @lines; close($file_fh); } @@ -241,16 +241,16 @@ sub register_patch { my @patches = $quilt->series(); my $has_patch = (grep { $_ eq $patch_name } @patches) ? 1 : 0; my $series = $quilt->get_series_file(); - my $applied = $quilt->get_db_file("applied-patches"); + my $applied = $quilt->get_db_file('applied-patches'); my $patch = $quilt->get_patch_file($patch_name); if (-s $tmpdiff) { copy($tmpdiff, $patch) || - syserr(_g("failed to copy %s to %s"), $tmpdiff, $patch); + syserr(_g('failed to copy %s to %s'), $tmpdiff, $patch); chmod(0666 & ~ umask(), $patch) || syserr(_g("unable to change permission of `%s'"), $patch); } elsif (-e $patch) { - unlink($patch) || syserr(_g("cannot remove %s"), $patch); + unlink($patch) || syserr(_g('cannot remove %s'), $patch); } if (-e $patch) { |