Dpkg

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

      the "<bar baz> <blub>" syntax into "bar,baz+blub".
    - Include a temporary compatibility mapping with the old way to write
      the Build-Profiles field in binary packages which can be removed once
      all affected source packages have moved to the new syntax.
    Thanks to Johannes Schauer <j.schauer@email.de>. Closes: #760158
  * Normalize instdir in dpkg by removing trailing «/» and «/.». This gets
    rid of several inconsistencies and doubled «/» in syscalls and output
    messages.
  * Never try to remove the root directory or its backups. There's no point in
    it, and makes life more difficult for a read-only root with a read-write
    overlay or a symlink farm. Requested by sepero111@gmx.com.
  * Remove arbitrary filename limit from dpkg-deb, which was lifted some
    time ago when the code switched to a dynamic string via varbuf.
  * Do not pipe the files to sign from dpkg-buildpackage to GnuPG. When GnuPG
    uses the gpg-agent it is unable to detect the correct tty configuration
    if stdin is a pipe instead of the current terminal. Closes: #762391
  * Add a new --hash option to enable generating only specific file checksums
    in dpkg-scanpackages. Requested by Thorsten Glaser <tg@debian.org>.
  * Add architecture restriction options for dpkg-architecture -L. This allows
    selecting specific subsets of all valid known architectures, matching by
    wildcard (-W), endianness (-E) or bits (-B). The restricting options can

t/Dpkg_Source_Archive.t  view on Meta::CPAN

use Dpkg;
use Dpkg::File;

my $tmpdir = test_get_temp_path();

sub test_path_escape
{
    my $name = shift;

    my $treedir = File::Spec->rel2abs("$tmpdir/$name-tree");
    my $overdir = File::Spec->rel2abs("$tmpdir/$name-overlay");
    my $outdir = "$tmpdir/$name-out";
    my $expdir = "$tmpdir/$name-exp";

    # This is the base directory, where we are going to be extracting stuff
    # into, which include traps.
    make_path("$treedir/subdir-a");
    file_touch("$treedir/subdir-a/file-a");
    file_touch("$treedir/subdir-a/file-pre-a");
    make_path("$treedir/subdir-b");
    file_touch("$treedir/subdir-b/file-b");
    file_touch("$treedir/subdir-b/file-pre-b");
    symlink File::Spec->abs2rel($outdir, $treedir), "$treedir/symlink-escape";
    symlink File::Spec->abs2rel("$outdir/nonexistent", $treedir), "$treedir/symlink-nonexistent";
    symlink "$treedir/file", "$treedir/symlink-within";
    file_touch("$treedir/supposed-dir");

    # This is the overlay directory, which we'll pack and extract over the
    # base directory.
    make_path($overdir);
    make_path("$overdir/subdir-a/aa");
    file_dump("$overdir/subdir-a/aa/file-aa", 'aa');
    file_dump("$overdir/subdir-a/file-a", 'a');
    make_path("$overdir/subdir-b/bb");
    file_dump("$overdir/subdir-b/bb/file-bb", 'bb');
    file_dump("$overdir/subdir-b/file-b", 'b');
    make_path("$overdir/symlink-escape");
    file_dump("$overdir/symlink-escape/escaped-file", 'escaped');
    file_dump("$overdir/symlink-nonexistent", 'nonexistent');
    make_path("$overdir/symlink-within");
    make_path("$overdir/supposed-dir");
    file_dump("$overdir/supposed-dir/supposed-file", 'something');

    # Generate overlay tar.
    system($Dpkg::PROGTAR, '-cf', "$overdir.tar", '-C', $overdir, qw(
        subdir-a subdir-b
        symlink-escape/escaped-file symlink-nonexistent symlink-within
        supposed-dir
        )) == 0
        or die "cannot create overlay tar archive\n";

   # This is the expected directory, which we'll be comparing against.
    make_path($expdir);
    system('cp', '-a', $overdir, $expdir) == 0
        or die "cannot copy overlay hierarchy into expected directory\n";

    # Store the expected and out reference directories into a tar to compare
    # its structure against the result reference.
    system($Dpkg::PROGTAR, '-cf', "$expdir.tar", '-C', $overdir, qw(
        subdir-a subdir-b
        symlink-escape/escaped-file symlink-nonexistent symlink-within
        supposed-dir
        ), '-C', $treedir, qw(
        subdir-a/file-pre-a
        subdir-b/file-pre-b



( run in 0.344 second using v1.01-cache-2.11-cpan-49f99fa48dc )