[dpkg] 126/192: scripts/t: Switch from IO::String to native open support

Ximin Luo infinity0 at debian.org
Tue Oct 17 11:04:09 UTC 2017


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch pu/reproducible_builds
in repository dpkg.

commit 943ebbb0b991b993fddad71b824965c530251c51
Author: Guillem Jover <guillem at debian.org>
Date:   Sun Sep 24 17:55:03 2017 +0200

    scripts/t: Switch from IO::String to native open support
    
    We can also remove the versioned dpkg-dev Build-Depends now that we
    do not use any build profile anymore.
---
 README                   |  1 -
 debian/changelog         |  3 +++
 debian/control           |  3 ---
 scripts/t/Dpkg_Control.t | 15 ++++++++-------
 scripts/t/Dpkg_Shlibs.t  | 21 +++++++++++----------
 5 files changed, 22 insertions(+), 21 deletions(-)

diff --git a/README b/README
index 38288d1..12ec253 100644
--- a/README
+++ b/README
@@ -79,7 +79,6 @@ To enable optional functionality or programs, this software might be needed:
 
 To run the test suite («make check»):
 
-  IO-String perl module (optional)
   Test::MinimumVersion perl module (optional, author)
   Test::Pod perl module (optional)
   Test::Spelling perl module (optional, author)
diff --git a/debian/changelog b/debian/changelog
index 78fbec3..c996a1c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -103,6 +103,8 @@ dpkg (1.19.0) UNRELEASED; urgency=medium
   * Packaging:
     - Remove preinst maintainer scripts for dselect and dpkg-dev, for an
       ancient /usr/share/doc symlink to directory switch. Closes: #867327
+    - Remove now unused libio-string-perl Build-Depends, and versioned
+      dpkg-dev as we do not use build profiles any more.
   * Test suite:
     - Enable perlcritic Documentation::RequirePodSections and
       Miscellanea::ProhibitTies.
@@ -113,6 +115,7 @@ dpkg (1.19.0) UNRELEASED; urgency=medium
     - Use Module::Metadata instead of grepping for $VERSION in pod-coverage.
     - Avoid many function arguments in Dpkg_Changelog.t check_options().
     - Add a new unit test for Dpkg::Control::FieldsCore.
+    - Switch from IO::String to native open() scalar support.
 
   [ Updated programs translations ]
   * German (Sven Joachim).
diff --git a/debian/control b/debian/control
index f2cd117..3db5365 100644
--- a/debian/control
+++ b/debian/control
@@ -10,8 +10,6 @@ Vcs-Browser: https://anonscm.debian.org/cgit/dpkg/dpkg.git
 Vcs-Git: https://anonscm.debian.org/git/dpkg/dpkg.git
 Standards-Version: 3.9.8
 Build-Depends:
-# Needed for build profile usage below.
- dpkg-dev (>= 1.17.14),
  debhelper (>= 9.20141010),
  pkg-config,
 # Needed for --add-location.
@@ -23,7 +21,6 @@ Build-Depends:
  liblzma-dev,
  libselinux1-dev [linux-any],
  libncursesw5-dev,
- libio-string-perl <!nocheck>,
 
 Package: dpkg
 Architecture: any
diff --git a/scripts/t/Dpkg_Control.t b/scripts/t/Dpkg_Control.t
index 40b9d33..0f808fb 100644
--- a/scripts/t/Dpkg_Control.t
+++ b/scripts/t/Dpkg_Control.t
@@ -20,8 +20,6 @@ use Test::More;
 use Test::Dpkg qw(:needs :paths);
 
 BEGIN {
-    test_needs_module('IO::String');
-
     plan tests => 24;
 
     use_ok('Dpkg::Control');
@@ -44,9 +42,12 @@ sub parse_dsc {
 
 my $c = Dpkg::Control::Info->new("$datadir/control-1");
 
-my $io = IO::String->new();
+my $io_data;
+my $io;
+
+open $io, '>', \$io_data or die "canno open io string\n";;
+
 $c->output($io);
-my $value = ${$io->string_ref()};
 my $expected = 'Source: mysource
 Numeric-Field: 0
 My-Field-One: myvalue1
@@ -75,7 +76,7 @@ Description: short one
  long one
  very long one
 ';
-is($value, $expected, "Dump of $datadir/control-1");
+is($io_data, $expected, "Dump of $datadir/control-1");
 
 my $src = $c->get_source();
 is($src, $c->[0], 'array representation of Dpkg::Control::Info 1/2');
@@ -100,10 +101,10 @@ is($pkg->{package}, 'mypackage3', 'Name of third package');
 is($pkg->{Depends}, 'hello', 'Name of third package');
 
 $pkg = $c->get_pkg_by_idx(2);
-$io = IO::String->new();
+open $io, '>', \$io_data or die "canno open io string\n";;
 $pkg->output($io);
 
-is(${$io->string_ref()},
+is($io_data,
 'Package: mypackage2
 Architecture: all
 Depends: hello
diff --git a/scripts/t/Dpkg_Shlibs.t b/scripts/t/Dpkg_Shlibs.t
index 775d15e..39163d7 100644
--- a/scripts/t/Dpkg_Shlibs.t
+++ b/scripts/t/Dpkg_Shlibs.t
@@ -21,8 +21,6 @@ use Test::Dpkg qw(:needs :paths);
 
 use Cwd;
 
-test_needs_module('IO::String');
-
 plan tests => 148;
 
 use Dpkg::Path qw(find_command);
@@ -328,10 +326,13 @@ is_deeply($sym, Dpkg::Shlibs::Symbol->new(symbol => 'symbol1_fake2 at Base',
 is($sym_file->get_smallest_version('libfake.so.1'), '1.0',
    'get_smallest_version');
 
+my $io_data;
+my $io;
+
 # Check dump output
-my $io = IO::String->new();
+open $io, '>', \$io_data or die "cannot open io string\n";
 $sym_file->output($io, package => 'libfake1');
-is(${$io->string_ref()},
+is($io_data,
 'libfake.so.1 libfake1 #MINVER#
 | libvirtualfake
 * Build-Depends-Package: libfake-dev
@@ -403,9 +404,9 @@ $sym_file = Dpkg::Shlibs::SymbolFile->new(file => "$datadir/basictags.symbols",
 save_load_test($sym_file, 'template save -> load', template_mode => 1);
 
 # Dumping in non-template mode (amd64) (test for arch tags)
-$io = IO::String->new();
+open $io, '>', \$io_data or die "cannot open io string\n";
 $sym_file->output($io);
-is(${$io->string_ref()},
+is($io_data,
 'libbasictags.so.1 libbasictags1 #MINVER#
 | libbasictags1 (>= 1.1)
  symbol11_optional at Base 1.1 1
@@ -417,10 +418,10 @@ is(${$io->string_ref()},
 ', 'template vs. non-template on amd64');
 
 # Dumping in non-template mode (mips) (test for arch tags)
-$io = IO::String->new();
+open $io, '>', \$io_data or die "cannot open io string\n";
 $sym_file = Dpkg::Shlibs::SymbolFile->new(file => "$datadir/basictags.symbols", arch => 'mips');
 $sym_file->output($io);
-is(${$io->string_ref()},
+is($io_data,
 'libbasictags.so.1 libbasictags1 #MINVER#
 | libbasictags1 (>= 1.1)
  symbol11_optional at Base 1.1 1
@@ -433,11 +434,11 @@ is(${$io->string_ref()},
 ', 'template vs. non-template on mips');
 
 # Dumping in non-template mode (i386) (test for arch tags)
-$io = IO::String->new();
+open $io, '>', \$io_data or die "cannot open io string\n";
 $sym_file = Dpkg::Shlibs::SymbolFile->new(file => "$datadir/basictags.symbols", arch => 'i386');
 $sym_file_dup = Dpkg::Shlibs::SymbolFile->new(file => "$datadir/basictags.symbols", arch => 'i386');
 $sym_file->output($io);
-is(${$io->string_ref()},
+is($io_data,
 'libbasictags.so.1 libbasictags1 #MINVER#
 | libbasictags1 (>= 1.1)
  symbol11_optional at Base 1.1 1

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list