From c2fa2ffd7fa791aeae33a22fbf1138e67b95d77a Mon Sep 17 00:00:00 2001 From: Jan-Hendrik Frintrop Date: Tue, 18 Jul 2017 12:06:01 +0200 Subject: [PATCH] Fix setMaintainer (#14) * Fix brackets of maintainer email The email address of the maintainer must use angle brackes as per https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Maintainer Also there should be a space between name and email. * Use variable interpolation for maintainer name Since you already use interpolation for maintainer email you can use it for name too. * Fix default value for maintainer The default value for the maintainer still had the square brackets. * Fix tests for StandardFile The tests still used square brackets. --- src/wdm/debian/control/StandardFile.php | 4 ++-- tests/wdm/debian/control/StandardFileTest.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/wdm/debian/control/StandardFile.php b/src/wdm/debian/control/StandardFile.php index bba1ac7..3c96b1d 100644 --- a/src/wdm/debian/control/StandardFile.php +++ b/src/wdm/debian/control/StandardFile.php @@ -44,7 +44,7 @@ class StandardFile "Recommends" => false, "Suggests" => false, "Installed-Size" => 1024, - "Maintainer" => "name [email]", + "Maintainer" => "name ", "Conflicts" => false, "Replaces" => false, "Provides" => "your-company", @@ -109,7 +109,7 @@ class StandardFile public function setMaintainer($maintainer, $email = false) { $email = ($email) ? $email : "---"; - return $this->_setProperty("Maintainer", $maintainer . "[{$email}]"); + return $this->_setProperty("Maintainer", "{$maintainer} <{$email}>"); } public function setConflicts($conflicts) diff --git a/tests/wdm/debian/control/StandardFileTest.php b/tests/wdm/debian/control/StandardFileTest.php index 81b539a..a26ff32 100644 --- a/tests/wdm/debian/control/StandardFileTest.php +++ b/tests/wdm/debian/control/StandardFileTest.php @@ -21,7 +21,7 @@ Priority: optional Architecture: all Essential: no Installed-Size: 1024 -Maintainer: name [email] +Maintainer: name Provides: your-company Description: Your description @@ -46,7 +46,7 @@ OEF; $this->object["Architecture"] = "x86"; $this->object["Essential"] = "yes"; $this->object["Installed-Size"] = "2048"; - $this->object["Maintainer"] = "Walter Dal Mut [walter.dalmut at gmail dot com]"; + $this->object["Maintainer"] = "Walter Dal Mut "; $this->object["Provides"] = "Corley SRL"; $this->object["Description"] = "My Desc"; $this->object["Depends"] = "php5-cli"; @@ -63,7 +63,7 @@ Essential: yes Depends: php5-cli Recommends: php5-curl Installed-Size: 2048 -Maintainer: Walter Dal Mut [walter.dalmut at gmail dot com] +Maintainer: Walter Dal Mut Provides: Corley SRL Description: My Desc