[libconfig-model-dpkg-perl] 04/08: test tolerance of bad patch (BDI on libconfig-model-tester 2.048)
dod at debian.org
dod at debian.org
Sun Jun 15 12:43:46 UTC 2014
This is an automated email from the git hooks/post-receive script.
dod pushed a commit to annotated tag debian/2.049
in repository libconfig-model-dpkg-perl.
commit d58621557beebaca1051a00278cbf27ed9ffe4df
Author: Dominique Dumont <dod at debian.org>
Date: Sat Jun 14 14:34:55 2014 +0200
test tolerance of bad patch (BDI on libconfig-model-tester 2.048)
---
debian/control | 2 +-
.../debian-748502/mail-like-patch | 44 ++++++++++++++++++
.../dpkg-patches-examples/debian-748502/series | 2 +
.../debian-748502/tweak-defaults | 53 ++++++++++++++++++++++
t/model_tests.d/dpkg-patches-test-conf.pl | 27 +++++++++++
5 files changed, 127 insertions(+), 1 deletion(-)
diff --git a/debian/control b/debian/control
index 27b2f7b..50f1fbd 100644
--- a/debian/control
+++ b/debian/control
@@ -7,7 +7,7 @@ Build-Depends: debhelper (>= 9),
perl (>= 5.13.11) | libmodule-build-perl (>= 0.380000)
Build-Depends-Indep: libapt-pkg-perl,
libconfig-model-perl (>= 2.055),
- libconfig-model-tester-perl,
+ libconfig-model-tester-perl (>= 2.048),
liblog-log4perl-perl,
libmouse-perl,
libparse-recdescent-perl,
diff --git a/t/model_tests.d/dpkg-patches-examples/debian-748502/mail-like-patch b/t/model_tests.d/dpkg-patches-examples/debian-748502/mail-like-patch
new file mode 100644
index 0000000..d5457ea
--- /dev/null
+++ b/t/model_tests.d/dpkg-patches-examples/debian-748502/mail-like-patch
@@ -0,0 +1,44 @@
+From: =?utf-8?q?David_Pr=C3=A9vot?= <taffit at debian.org>
+Date: Tue, 5 Nov 2013 20:39:36 -0400
+Subject: Adapt Doctrine, Symphony, Patchwork and Pimple path
+MIME-Version: 1.0
+Content-Type: text/plain; charset="utf-8"
+Content-Transfer-Encoding: 8bit
+
+The Debian package depends on the needed classes instead of embedding
+them, i.e. php-doctrine-common, php-symfony-console,
+php-symfony-routing, php-patchwork-utf8 and php-pimple.
+
+php-doctrine-dbal can’t be used currently because upstream made some
+modifications that makes it incompatible with the original one.
+
+Forwarded: not-needed
+Last-Update: 2014-05-26
+
+Gbp: Topic path
+---
+ lib/base.php | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/lib/base.php b/lib/base.php
+index c4824d1..6c6d78e 100644
+--- a/lib/base.php
++++ b/lib/base.php
+@@ -411,12 +411,12 @@ class OC {
+ // register autoloader
+ require_once __DIR__ . '/autoloader.php';
+ self::$loader = new \OC\Autoloader();
+- self::$loader->registerPrefix('Doctrine\\Common', 'doctrine/common/lib');
++ self::$loader->registerPrefix('Doctrine\\Common', '/usr/share/php');
+ self::$loader->registerPrefix('Doctrine\\DBAL', 'doctrine/dbal/lib');
+- self::$loader->registerPrefix('Symfony\\Component\\Routing', 'symfony/routing');
+- self::$loader->registerPrefix('Symfony\\Component\\Console', 'symfony/console');
+- self::$loader->registerPrefix('Patchwork', '3rdparty');
+- self::$loader->registerPrefix('Pimple', '3rdparty/Pimple');
++ self::$loader->registerPrefix('Symfony\\Component\\Routing', '/usr/share/php');
++ self::$loader->registerPrefix('Symfony\\Component\\Console', '/usr/share/php');
++ self::$loader->registerPrefix('Patchwork', '/usr/share/php');
++ self::$loader->registerPrefix('Pimple', '/usr/share/php');
+ spl_autoload_register(array(self::$loader, 'load'));
+
+ // set some stuff
\ No newline at end of file
diff --git a/t/model_tests.d/dpkg-patches-examples/debian-748502/series b/t/model_tests.d/dpkg-patches-examples/debian-748502/series
new file mode 100644
index 0000000..9c62fc1
--- /dev/null
+++ b/t/model_tests.d/dpkg-patches-examples/debian-748502/series
@@ -0,0 +1,2 @@
+mail-like-patch
+tweak-defaults
diff --git a/t/model_tests.d/dpkg-patches-examples/debian-748502/tweak-defaults b/t/model_tests.d/dpkg-patches-examples/debian-748502/tweak-defaults
new file mode 100644
index 0000000..10db00f
--- /dev/null
+++ b/t/model_tests.d/dpkg-patches-examples/debian-748502/tweak-defaults
@@ -0,0 +1,53 @@
+Description:Tweak defaults values for Debian
+ Debian needs some default values slightly different
+ from upstream
+Forwarded:NA
+Author:dod
+--- a/lib/Config/Model/models/LCDd/server.pl
++++ b/lib/Config/Model/models/LCDd/server.pl
+@@ -115,7 +115,27 @@
+ },
+ 'DriverPath',
+ {
+- 'default' => 'server/drivers/',
++ compute => {
++ formula => 'my $triplet = `/usr/bin/dpkg-architecture -qDEB_HOST_MULTIARCH`;
++warn "cannot run dpkg-architecture" unless $triplet ;
++chomp $triplet;
++"/usr/lib/$triplet/lcdproc/";',
++ allow_override => 1,
++ use_eval => 1
++ },
++ warn_unless => {
++ 'dir' => {
++ code => ' defined $_ ? -d : 1' ,
++ msg => 'missing DriverPath dir',
++ fix => 'my $triplet = `/usr/bin/dpkg-architecture -qDEB_HOST_MULTIARCH`;
++warn "cannot run dpkg-architecture" unless $triplet ;
++chomp $triplet;
++my $res = "/usr/lib/$triplet/lcdproc/";
++$_ = $res;
++',
++ }
++ },
++ #'default' => 'server/drivers/',
+ 'description' => 'Where can we find the driver modules ?
+ IMPORTANT: Make sure to change this setting to reflect your
+ specific setup! Otherwise LCDd won\'t be able to find
+@@ -196,7 +216,7 @@
+ {
+ 'description' => 'Should we report to syslog instead of stderr ? ',
+ 'type' => 'leaf',
+- 'upstream_default' => 'no',
++ 'default' => 'yes',
+ 'value_type' => 'boolean',
+ 'write_as' => [
+ 'no',
+@@ -253,7 +273,6 @@
+ },
+ 'User',
+ {
+- 'default' => 'nobody',
+ 'description' => 'User to run as. LCDd will drop its root privileges, if any,
+ and run as this user instead.',
+ 'type' => 'leaf',
diff --git a/t/model_tests.d/dpkg-patches-test-conf.pl b/t/model_tests.d/dpkg-patches-test-conf.pl
new file mode 100644
index 0000000..7ae7c06
--- /dev/null
+++ b/t/model_tests.d/dpkg-patches-test-conf.pl
@@ -0,0 +1,27 @@
+use Data::Dumper;
+use IO::File;
+use File::HomeDir ;
+
+$conf_file_name = '';
+$conf_dir = 'debian/patches';
+
+$model_to_test = "Dpkg::Patches";
+
+eval { require AptPkg::Config; };
+$skip = ( $@ or not -r '/etc/debian_version' ) ? 1 : 0;
+
+ at tests = (
+ {
+ name => 'debian-748502' ,
+ # required to skip the bad patch (non dep-3)
+ load_check => 'no',
+ load_warnings => [ qr/Ignoring patch/ ],
+ load => 'patches:~mail-like-patch',
+ # bad patch is skipped by config-model but is not removed from patch set
+ # hence the 2nd instance must also skip the bad patch
+ load_check2 => 'no',
+ }
+);
+
+
+1;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libconfig-model-dpkg-perl.git
More information about the Pkg-perl-cvs-commits
mailing list