From a72b9490cc8e8f92e74cab100004cc9bacc9603f Mon Sep 17 00:00:00 2001 From: Walter Dal Mut Date: Sat, 2 Jun 2012 17:19:33 +0200 Subject: [PATCH 01/54] Fix naming on provides --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3351bf2..f39f6b1 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ $control ->setDepends(array("php5", "php5-cli", "php5-xsl")) ->setInstalledSize(4096) ->setMaintainer("Walter Dal Mut", "walter.dalmut@corley.it") - ->setProvides("Corley S.r.l.") + ->setProvides("my-package-name") ->setDescription("My software description"); ; From 2f2524f496317217bb9760b4d30866b9cd440fc3 Mon Sep 17 00:00:00 2001 From: Walter Dal Mut Date: Sat, 2 Jun 2012 17:20:03 +0200 Subject: [PATCH 02/54] Added PEAR declaration --- src/package.xml | 62 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 src/package.xml diff --git a/src/package.xml b/src/package.xml new file mode 100644 index 0000000..9babf19 --- /dev/null +++ b/src/package.xml @@ -0,0 +1,62 @@ + + + Corley_Deb_Packager + pear.corley.it + Corley DEB packager. + + This library provides mechanisms for generate valid .deb files useful + for software distribution for GNU/Linux Debian based systems. + + + Walter Dal Mut + wdalmut + walter.dalmut at corley.it + yes + + + Gabriele Mittica + gmittica + gabriele.mittica at corley.it + yes + + 2012-06-02 + + + 0.0.1 + 0.0.1 + + + alpha + alpha + + MIT + In this release the first proposal. + + + + + + + + + + + + + + + + + + 5.3.8 + + + 1.4.0 + + + + + \ No newline at end of file From 0b5e388aa167f2714e5481e43ef6035cb78d7a42 Mon Sep 17 00:00:00 2001 From: Walter Dal Mut Date: Sun, 3 Jun 2012 11:08:03 +0300 Subject: [PATCH 03/54] Update src/example.php --- src/example.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/example.php b/src/example.php index 4dc8cc1..00cd7e6 100644 --- a/src/example.php +++ b/src/example.php @@ -9,7 +9,7 @@ $control ->setDepends(array("php5", "php5-cli", "php5-xsl")) ->setInstalledSize(4096) ->setMaintainer("Walter Dal Mut", "walter.dalmut@corley.it") - ->setProvides("Corley S.r.l.") + ->setProvides("my-package-name") ->setDescription("My software description"); ; From e705d0fe8cf295cee563d28e516c0b9921048340 Mon Sep 17 00:00:00 2001 From: Walter Dal Mut Date: Mon, 4 Jun 2012 11:03:35 +0200 Subject: [PATCH 04/54] Added scripts --- src/wdm/debian/Packager.php | 78 +++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/src/wdm/debian/Packager.php b/src/wdm/debian/Packager.php index 3f882ad..8a5024f 100644 --- a/src/wdm/debian/Packager.php +++ b/src/wdm/debian/Packager.php @@ -38,12 +38,65 @@ class Packager private $_mountPoints = array(); private $_outputPath; + private $_preInst; + private $_postInst; + private $_preRM; + private $_postRM; + + /** + * Set the control file + * + * This file contains the base package information + * + * @param StandardFile $control + * @return \wdm\debian\Packager + */ public function setControl(StandardFile $control) { $this->_control = $control; return $this; } + /** + * Pre install script + * + * @param string $path The absolute path of your pre-install script + */ + public function setPreInstallScript($path) + { + $this->_preInst = $path; + } + + /** + * Post install script + * + * @param string $path The absolute path of your post-install script + */ + public function setPostInstallScript($path) + { + $this->_postInst = $path; + } + + /** + * Pre remove script + * + * @param string $path The absolute path of your pre-remove script + */ + public function setPreRemoveScript($path) + { + $this->_preRM = $path; + } + + /** + * Post remove script + * + * @param string $path The absolute path of your post-remove script + */ + public function setPostRemoveScript($path) + { + $this->_postRM = $path; + } + public function mount($sourcePath, $destinationPath) { $this->_mountPoints[$sourcePath] = $destinationPath; @@ -73,8 +126,33 @@ class Packager } mkdir($this->_outputPath . "/DEBIAN", 0777); + file_put_contents($this->_outputPath . "/DEBIAN/control", (string)$this->_control); + if ($this->_preInst) { + $dest = $this->_outputPath . "/DEBIAN/preinst"; + $this->_copy($this->_preInst, $dest); + chmod($dest, 0755); + } + + if ($this->_postInst) { + $dest = $this->_outputPath . "/DEBIAN/postinst"; + $this->_copy($this->_postInst, $dest); + chmod($dest, 0755); + } + + if ($this->_preRM) { + $dest = $this->_outputPath . "/DEBIAN/prerm"; + $this->_copy($this->_preRM, $dest); + chmod($dest, 0755); + } + + if ($this->_postRM) { + $dest = $this->_outputPath . "/DEBIAN/postrm"; + $this->_copy($this->_postRM, $dest); + chmod($dest, 0755); + } + return $this; } From 8a34d98a6599c09fc80ce4230cd147a6e81df696 Mon Sep 17 00:00:00 2001 From: Walter Dal Mut Date: Mon, 4 Jun 2012 11:32:48 +0200 Subject: [PATCH 05/54] Example for scripts --- README.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/README.md b/README.md index f39f6b1..b7a44bc 100644 --- a/README.md +++ b/README.md @@ -33,3 +33,38 @@ $packager->run(); //Creates the Debian package $packager->build(); ``` +## Pre-Post scripts + +Optianally you can add script for different hooks + + * pre-install + * Run pre install + * post-install + * Run post install + * pre-remove + * Run pre package remove + * post-remove + * Run post package remove + +Adding scripts + +```php +$packager->setPreInstallScript(__DIR__ . '/my-pre-install-script.sh'); +$packager->setPostInstallScript(__DIR__ . '/my-post-install-script.sh'); +$packager->setPreRemoveScript(__DIR__ . '/my-pre-remove-script.sh'); +$packager->setPreRemoveScript(__DIR__ . '/my-post-remove-script.sh'); +``` + +See a script example for the post-install hook + +```shell +#!/bin/sh +#postinst script for upcloo + +set -e + +echo "Goodbye Cruel World" + +exit 0 +``` + \ No newline at end of file From 382c97eee7364662555af461937b136639c63f47 Mon Sep 17 00:00:00 2001 From: Walter Dal Mut Date: Mon, 4 Jun 2012 12:41:13 +0200 Subject: [PATCH 06/54] Fix error --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b7a44bc..e016c97 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ require_once 'wdm/debian/Autoloader.php'; $control = new \wdm\debian\control\StandardFile(); $control - ->setPackage("my-package-name") + ->setPackageName("my-package-name") ->setVersion("0.1.1") ->setDepends(array("php5", "php5-cli", "php5-xsl")) ->setInstalledSize(4096) @@ -67,4 +67,4 @@ echo "Goodbye Cruel World" exit 0 ``` - \ No newline at end of file + From 6169031c8017cb7b387f818e85628b49f6ed2e8e Mon Sep 17 00:00:00 2001 From: Walter Dal Mut Date: Mon, 4 Jun 2012 12:46:46 +0200 Subject: [PATCH 07/54] PEAR new release 0.0.2 --- src/package.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/package.xml b/src/package.xml index 9babf19..ba88263 100644 --- a/src/package.xml +++ b/src/package.xml @@ -22,11 +22,11 @@ gabriele.mittica at corley.it yes - 2012-06-02 - + 2012-06-04 + - 0.0.1 - 0.0.1 + 0.0.2 + 0.0.2 alpha @@ -51,7 +51,7 @@ - 5.3.8 + 5.3.3 1.4.0 From 2881c02a6f491ab5b7a5d3d0aa50389779ae266e Mon Sep 17 00:00:00 2001 From: Walter Dal Mut Date: Mon, 4 Jun 2012 12:49:10 +0200 Subject: [PATCH 08/54] more ignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index cf36c9f..b036e5c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ .project .buildpath .settings + +src/*.tgz From 6a8bc311262e81fd650e393236ec043712a81de3 Mon Sep 17 00:00:00 2001 From: Walter Dal Mut Date: Sat, 9 Jun 2012 12:30:23 +0300 Subject: [PATCH 09/54] Update master --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e016c97..4d0c0c7 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ $packager->setPreRemoveScript(__DIR__ . '/my-pre-remove-script.sh'); $packager->setPreRemoveScript(__DIR__ . '/my-post-remove-script.sh'); ``` -See a script example for the post-install hook +See a script example ```shell #!/bin/sh From d027d9e2758decc3cc1b25a7f6e16e0e3daa37e5 Mon Sep 17 00:00:00 2001 From: Walter Dal Mut Date: Tue, 31 Jul 2012 10:29:41 +0200 Subject: [PATCH 10/54] Added composer support --- composer.json | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 composer.json diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..672f53f --- /dev/null +++ b/composer.json @@ -0,0 +1,32 @@ +{ + "name": "wdalmut/php-deb-packager", + "description": "A simple debian packager for PHP applications", + "version":"0.0.2", + "type":"library", + "keywords":["deb","packager","ubuntu","php-deb"], + "time":"2012-07-31", + "license":"MIT", + "authors": [ + { + "name":"Walter Dal Mut", + "email":"walter.dalmut@gmail.com", + "homepage":"http://walterdalmut.com", + "role":"Developer" + } + ], + "support": { + "email":"walter.dalmut@gmail.com" + }, + "require": { + "php": ">=5.3.3" + }, + "autoload": { + "psr-0": ["src/"] + }, + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/wdalmut/php-deb-packager" + } + ] +} \ No newline at end of file From 659ee4d90b9a7ba8ae66d29ee780483647d7e61c Mon Sep 17 00:00:00 2001 From: Walter Dal Mut Date: Mon, 18 Nov 2013 08:03:46 +0100 Subject: [PATCH 11/54] [BUGFIX] missing out folder creation --- .gitignore | 4 ++ composer.json | 6 +- src/wdm/debian/Packager.php | 106 ++++++++++++++++++------------------ 3 files changed, 62 insertions(+), 54 deletions(-) diff --git a/.gitignore b/.gitignore index b036e5c..67cac47 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,8 @@ .buildpath .settings +vendor +*.phar +*.deb + src/*.tgz diff --git a/composer.json b/composer.json index 672f53f..bc11f4b 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,9 @@ "php": ">=5.3.3" }, "autoload": { - "psr-0": ["src/"] + "psr-0": { + "wdm": "src/" + } }, "repositories": [ { @@ -29,4 +31,4 @@ "url": "https://github.com/wdalmut/php-deb-packager" } ] -} \ No newline at end of file +} diff --git a/src/wdm/debian/Packager.php b/src/wdm/debian/Packager.php index 8a5024f..3299e22 100644 --- a/src/wdm/debian/Packager.php +++ b/src/wdm/debian/Packager.php @@ -1,14 +1,14 @@ -_control = $control; return $this; } - + /** * Pre install script - * + * * @param string $path The absolute path of your pre-install script */ public function setPreInstallScript($path) { $this->_preInst = $path; } - + /** * Post install script - * + * * @param string $path The absolute path of your post-install script */ public function setPostInstallScript($path) { $this->_postInst = $path; } - + /** * Pre remove script - * + * * @param string $path The absolute path of your pre-remove script */ public function setPreRemoveScript($path) { $this->_preRM = $path; } - + /** * Post remove script - * + * * @param string $path The absolute path of your post-remove script */ public function setPostRemoveScript($path) { $this->_postRM = $path; } - + public function mount($sourcePath, $destinationPath) { $this->_mountPoints[$sourcePath] = $destinationPath; return $this; } - + public function setOutputPath($path) { $this->_outputPath = $path; return $this; } - + public function run() { if (file_exists($this->_outputPath)) { $iterator = new \DirectoryIterator($this->_outputPath); foreach ($iterator as $path) { - if ($path != '.' || $path != '..'); { + if ($path != '.' || $path != '..') { echo "OUTPUT DIRECTORY MUST BE EMPTY! Something exists, exit immediately!" . PHP_EOL; exit(); } } } - + + mkdir($this->_outputPath, 0777); + foreach ($this->_mountPoints as $path => $dest) { $this->_pathToPath($path, $this->_outputPath . DIRECTORY_SEPARATOR . $dest); } - - mkdir($this->_outputPath . "/DEBIAN", 0777); - + + mkdir($this->_outputPath . "/DEBIAN", 0777); + file_put_contents($this->_outputPath . "/DEBIAN/control", (string)$this->_control); - + if ($this->_preInst) { $dest = $this->_outputPath . "/DEBIAN/preinst"; $this->_copy($this->_preInst, $dest); chmod($dest, 0755); } - + if ($this->_postInst) { - $dest = $this->_outputPath . "/DEBIAN/postinst"; - $this->_copy($this->_postInst, $dest); + $dest = $this->_outputPath . "/DEBIAN/postinst"; + $this->_copy($this->_postInst, $dest); chmod($dest, 0755); } - + if ($this->_preRM) { - $dest = $this->_outputPath . "/DEBIAN/prerm"; - $this->_copy($this->_preRM, $dest); + $dest = $this->_outputPath . "/DEBIAN/prerm"; + $this->_copy($this->_preRM, $dest); chmod($dest, 0755); } - + if ($this->_postRM) { - $dest = $this->_outputPath . "/DEBIAN/postrm"; - $this->_copy($this->_postRM, $dest); + $dest = $this->_outputPath . "/DEBIAN/postrm"; + $this->_copy($this->_postRM, $dest); chmod($dest, 0755); } - + return $this; } - - private function _pathToPath($path, $dest) + + private function _pathToPath($path, $dest) { - if (is_dir($path)) { + if (is_dir($path)) { $iterator = new \DirectoryIterator($path); foreach ($iterator as $element) { if ($element != '.' && $element != '..') { @@ -169,29 +171,29 @@ class Packager $this->_copy($fullPath, $dest . DIRECTORY_SEPARATOR . $element); } } - } - } else if (is_file($path)) { - $this->_copy($path, $dest); + } + } else if (is_file($path)) { + $this->_copy($path, $dest); } } - - private function _copy($source, $dest) + + private function _copy($source, $dest) { - $destFolder = dirname($dest); - if (!file_exists($destFolder)) { - mkdir($destFolder, 0777, true); - } + $destFolder = dirname($dest); + if (!file_exists($destFolder)) { + mkdir($destFolder, 0777, true); + } copy($source, $dest); } - + public function build($debPackageName = false) { if (!$debPackageName) { $debPackageName = basename($this->_outputPath . ".deb"); } - + $command = "dpkg -b {$this->_outputPath} {$debPackageName}" . PHP_EOL; - + echo $command; } -} \ No newline at end of file +} From f05b914d417055bff6d637456019082eab20ea9e Mon Sep 17 00:00:00 2001 From: Walter Dal Mut Date: Mon, 18 Nov 2013 08:09:26 +0100 Subject: [PATCH 12/54] Bumped 0.0.3 version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index bc11f4b..008e4e5 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "wdalmut/php-deb-packager", "description": "A simple debian packager for PHP applications", - "version":"0.0.2", + "version":"0.0.3", "type":"library", "keywords":["deb","packager","ubuntu","php-deb"], "time":"2012-07-31", From 979b11423024600aa733d4122a486d1c40874dd4 Mon Sep 17 00:00:00 2001 From: Walter Dal Mut Date: Mon, 18 Nov 2013 08:12:00 +0100 Subject: [PATCH 13/54] Bumped pear package version --- src/package.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/package.xml b/src/package.xml index ba88263..a701ff0 100644 --- a/src/package.xml +++ b/src/package.xml @@ -25,8 +25,8 @@ 2012-06-04 - 0.0.2 - 0.0.2 + 0.0.3 + 0.0.3 alpha @@ -59,4 +59,4 @@ - \ No newline at end of file + From 485118b8f0b71d0a1f1323231d485fa86506729a Mon Sep 17 00:00:00 2001 From: Gianluca Arbezzano Date: Mon, 1 Dec 2014 22:11:06 +0100 Subject: [PATCH 14/54] Fixed #4 It doesn't print line if control value is empty --- src/wdm/debian/control/StandardFile.php | 72 +++++++++++++------------ 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/src/wdm/debian/control/StandardFile.php b/src/wdm/debian/control/StandardFile.php index 71dcf8c..89767e2 100644 --- a/src/wdm/debian/control/StandardFile.php +++ b/src/wdm/debian/control/StandardFile.php @@ -1,12 +1,12 @@ - '', + 'Package' => false, 'Version' => '0.1', "Section" => "web", "Priority" => "optional", "Architecture" => "all", "Essential" => "no", - "Depends" => "", - "Pre-Depends" => "", - "Recommends" => "", - "Suggests" => "", + "Depends" => false, + "Pre-Depends" => false, + "Recommends" => false, + "Suggests" => false, "Installed-Size" => 1024, "Maintainer" => "name [email]", - "Conflicts" => "", - "Replaces" => "", + "Conflicts" => false, + "Replaces" => false, "Provides" => "your-company", "Description" => "Your description" ); - + public function setPackageName($name) { return $this->_setProperty("Package", $name); } - + public function setVersion($version) { return $this->_setProperty("Version", $version); } - + public function setSection($section) { return $this->_setProperty("Section", $section); } - + public function setPriority($priority) { return $this->_setProperty($this["Priority"], $priority); } - + public function setArchitecture($arch) { return $this->_setProperty("Architecture", $arch); } - + public function setEssential($essential) { return $this->_setProperty("Essential", $essential); } - + public function setDepends($depends) { return $this->_setProperty("Depends", $this->_transformList($depends)); } - + public function setPreDepends($depends) { return $this->_setProperty("Pre-Depends", $this->_transformList($depends)); @@ -95,43 +95,43 @@ class StandardFile { return $this->_setProperty("Reccommends", $depends); } - + public function setSuggests($depends) { return $this->_setProperty("Suggests", $this->_transformList($depends)); } - + public function setInstalledSize($size) { return $this->_setProperty("Installed-Size", $size); } - + public function setMaintainer($maintainer, $email = false) { $email = ($email) ? $email : "---"; return $this->_setProperty("Maintainer", $maintainer . "[{$email}]"); } - + public function setConflicts($conflicts) { return $this->_setProperty("Conflicts", $this->_transformList($conflicts)); } - + public function setReplaces($replaces) { return $this->_setProperty("Conflicts", $this->_transformList($replaces)); } - + public function setProvides($provides) { return $this->_setProperty("Provides", $provides); } - + public function setDescription($description) { return $this->_setProperty("Description", $description); } - + private function _transformList($depends) { if (is_array($depends)) { @@ -139,16 +139,16 @@ class StandardFile } else { $depends = $depends; } - + return $depends; } - + private function _setProperty($key, $value) { $this[$key] = $value; return $this; } - + public function offsetExists ($offset) { return array_key_exists($offset, $this->_keys); } @@ -173,19 +173,21 @@ class StandardFile unset($this->_keys[$offset]); } } - + /** * Control file string representation. - * + * * @return string The control file */ public function __toString() { $control = ''; foreach ($this->_keys as $key => $value) { - $control .= "{$key}: {$value}" . PHP_EOL; + if($value){ + $control .= "{$key}: {$value}" . PHP_EOL; + } } - + return $control; } -} \ No newline at end of file +} From dab5976eb3b1df20ad39911a40d58f1800525d3c Mon Sep 17 00:00:00 2001 From: Walter Dal Mut Date: Wed, 3 Dec 2014 22:38:07 +0100 Subject: [PATCH 15/54] Added standard control file test case --- .gitignore | 2 + .travis.yml | 11 + composer.json | 5 +- composer.lock | 762 ++++++++++++++++++ tests/wdm/debian/control/StandardFileTest.php | 31 + 5 files changed, 810 insertions(+), 1 deletion(-) create mode 100644 .travis.yml create mode 100644 composer.lock create mode 100644 tests/wdm/debian/control/StandardFileTest.php diff --git a/.gitignore b/.gitignore index 67cac47..ff6c051 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ vendor *.deb src/*.tgz + +tags diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..37191d5 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,11 @@ +language: php +php: + - 5.6 + - 5.5 + - 5.4 + - 5.3 + +install: + - composer install + +script: vendor/bin/phpunit tests diff --git a/composer.json b/composer.json index 008e4e5..5d6f090 100644 --- a/composer.json +++ b/composer.json @@ -20,9 +20,12 @@ "require": { "php": ">=5.3.3" }, + "require-dev": { + "phpunit/phpunit": "~4" + }, "autoload": { "psr-0": { - "wdm": "src/" + "wdm": ["src/", "tests/"] } }, "repositories": [ diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..fe52725 --- /dev/null +++ b/composer.lock @@ -0,0 +1,762 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "hash": "b89ac83d7c4abbd18d2ada4d5e2eeae7", + "packages": [], + "packages-dev": [ + { + "name": "doctrine/instantiator", + "version": "1.0.4", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "f976e5de371104877ebc89bd8fecb0019ed9c119" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/f976e5de371104877ebc89bd8fecb0019ed9c119", + "reference": "f976e5de371104877ebc89bd8fecb0019ed9c119", + "shasum": "" + }, + "require": { + "php": ">=5.3,<8.0-DEV" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "2.0.*@ALPHA" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Instantiator\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2014-10-13 12:58:55" + }, + { + "name": "phpunit/php-code-coverage", + "version": "2.0.13", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "0e7d2eec5554f869fa7a4ec2d21e4b37af943ea5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/0e7d2eec5554f869fa7a4ec2d21e4b37af943ea5", + "reference": "0e7d2eec5554f869fa7a4ec2d21e4b37af943ea5", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "phpunit/php-file-iterator": "~1.3", + "phpunit/php-text-template": "~1.2", + "phpunit/php-token-stream": "~1.3", + "sebastian/environment": "~1.0", + "sebastian/version": "~1.0" + }, + "require-dev": { + "ext-xdebug": ">=2.1.4", + "phpunit/phpunit": "~4.1" + }, + "suggest": { + "ext-dom": "*", + "ext-xdebug": ">=2.2.1", + "ext-xmlwriter": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2014-12-03 06:41:44" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.3.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/acd690379117b042d1c8af1fafd61bde001bf6bb", + "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "File/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2013-10-10 15:34:57" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", + "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "Text/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2014-01-30 17:20:04" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/19689d4354b295ee3d8c54b4f42c3efb69cbc17c", + "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "PHP/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2013-08-02 07:42:54" + }, + { + "name": "phpunit/php-token-stream", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "f8d5d08c56de5cfd592b3340424a81733259a876" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/f8d5d08c56de5cfd592b3340424a81733259a876", + "reference": "f8d5d08c56de5cfd592b3340424a81733259a876", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2014-08-31 06:12:13" + }, + { + "name": "phpunit/phpunit", + "version": "4.3.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "2dab9d593997db4abcf58d0daf798eb4e9cecfe1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2dab9d593997db4abcf58d0daf798eb4e9cecfe1", + "reference": "2dab9d593997db4abcf58d0daf798eb4e9cecfe1", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=5.3.3", + "phpunit/php-code-coverage": "~2.0", + "phpunit/php-file-iterator": "~1.3.2", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "~1.0.2", + "phpunit/phpunit-mock-objects": "~2.3", + "sebastian/comparator": "~1.0", + "sebastian/diff": "~1.1", + "sebastian/environment": "~1.0", + "sebastian/exporter": "~1.0", + "sebastian/version": "~1.0", + "symfony/yaml": "~2.0" + }, + "suggest": { + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "", + "../../symfony/yaml/" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "http://www.phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2014-11-11 10:11:09" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "2.3.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "c63d2367247365f688544f0d500af90a11a44c65" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/c63d2367247365f688544f0d500af90a11a44c65", + "reference": "c63d2367247365f688544f0d500af90a11a44c65", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "~1.0,>=1.0.1", + "php": ">=5.3.3", + "phpunit/php-text-template": "~1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.3" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2014-10-03 05:12:11" + }, + { + "name": "sebastian/comparator", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "e54a01c0da1b87db3c5a3c4c5277ddf331da4aef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/e54a01c0da1b87db3c5a3c4c5277ddf331da4aef", + "reference": "e54a01c0da1b87db3c5a3c4c5277ddf331da4aef", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.1", + "sebastian/exporter": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2014-05-11 23:00:21" + }, + { + "name": "sebastian/diff", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "5843509fed39dee4b356a306401e9dd1a931fec7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/5843509fed39dee4b356a306401e9dd1a931fec7", + "reference": "5843509fed39dee4b356a306401e9dd1a931fec7", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "http://www.github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2014-08-15 10:29:00" + }, + { + "name": "sebastian/environment", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "6e6c71d918088c251b181ba8b3088af4ac336dd7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6e6c71d918088c251b181ba8b3088af4ac336dd7", + "reference": "6e6c71d918088c251b181ba8b3088af4ac336dd7", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2014-10-25 08:00:45" + }, + { + "name": "sebastian/exporter", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "c7d59948d6e82818e1bdff7cadb6c34710eb7dc0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/c7d59948d6e82818e1bdff7cadb6c34710eb7dc0", + "reference": "c7d59948d6e82818e1bdff7cadb6c34710eb7dc0", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "time": "2014-09-10 00:51:36" + }, + { + "name": "sebastian/version", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43", + "reference": "b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43", + "shasum": "" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2014-03-07 15:35:33" + }, + { + "name": "symfony/yaml", + "version": "v2.6.1", + "target-dir": "Symfony/Component/Yaml", + "source": { + "type": "git", + "url": "https://github.com/symfony/Yaml.git", + "reference": "3346fc090a3eb6b53d408db2903b241af51dcb20" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/3346fc090a3eb6b53d408db2903b241af51dcb20", + "reference": "3346fc090a3eb6b53d408db2903b241af51dcb20", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Yaml\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Yaml Component", + "homepage": "http://symfony.com", + "time": "2014-12-02 20:19:20" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "platform": { + "php": ">=5.3.3" + }, + "platform-dev": [] +} diff --git a/tests/wdm/debian/control/StandardFileTest.php b/tests/wdm/debian/control/StandardFileTest.php new file mode 100644 index 0000000..4b6e5ec --- /dev/null +++ b/tests/wdm/debian/control/StandardFileTest.php @@ -0,0 +1,31 @@ +object = new StandardFile(); + } + + public function testMinimumFile() + { + $conf = (string)$this->object; + + $expected = <<assertEquals($expected, $conf); + } +} From 0dfd2369255045423d1cffdb40c009042019d7cc Mon Sep 17 00:00:00 2001 From: Walter Dal Mut Date: Wed, 3 Dec 2014 22:39:53 +0100 Subject: [PATCH 16/54] Removed window file new lines and extra spaces --- src/wdm/debian/control/StandardFile.php | 30 ++++++++++++------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/wdm/debian/control/StandardFile.php b/src/wdm/debian/control/StandardFile.php index 89767e2..2843904 100644 --- a/src/wdm/debian/control/StandardFile.php +++ b/src/wdm/debian/control/StandardFile.php @@ -91,9 +91,9 @@ class StandardFile return $this->_setProperty("Pre-Depends", $this->_transformList($depends)); } - public function setRecommends($depends) - { - return $this->_setProperty("Reccommends", $depends); + public function setRecommends($depends) + { + return $this->_setProperty("Reccommends", $depends); } public function setSuggests($depends) @@ -134,10 +134,10 @@ class StandardFile private function _transformList($depends) { - if (is_array($depends)) { - $depends = implode(", ", $depends); - } else { - $depends = $depends; + if (is_array($depends)) { + $depends = implode(", ", $depends); + } else { + $depends = $depends; } return $depends; @@ -150,28 +150,28 @@ class StandardFile } public function offsetExists ($offset) { - return array_key_exists($offset, $this->_keys); - } + return array_key_exists($offset, $this->_keys); + } public function offsetGet ($offset) { if ($this->offsetExists($offset)) { return $this->_keys[$offset]; } else { return null; - } - } - + } + } + public function offsetSet ($offset, $value) { if (!$this->offsetExists($offset)) { throw new \Exception("Invalid property for this control file."); } - $this->_keys[$offset] = $value; - } + $this->_keys[$offset] = $value; + } public function offsetUnset ($offset) { if ($this->offsetExists($offset)) { unset($this->_keys[$offset]); - } + } } /** From 529a529185d7d6bf38578e18d79807b70bf53014 Mon Sep 17 00:00:00 2001 From: Walter Dal Mut Date: Wed, 3 Dec 2014 22:41:32 +0100 Subject: [PATCH 17/54] Cover filter out extra properties --- src/wdm/debian/control/StandardFile.php | 2 +- tests/wdm/debian/control/StandardFileTest.php | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/wdm/debian/control/StandardFile.php b/src/wdm/debian/control/StandardFile.php index 2843904..cf61145 100644 --- a/src/wdm/debian/control/StandardFile.php +++ b/src/wdm/debian/control/StandardFile.php @@ -163,7 +163,7 @@ class StandardFile public function offsetSet ($offset, $value) { if (!$this->offsetExists($offset)) { - throw new \Exception("Invalid property for this control file."); + throw new \InvalidArgumentException("Invalid property for this control file."); } $this->_keys[$offset] = $value; } diff --git a/tests/wdm/debian/control/StandardFileTest.php b/tests/wdm/debian/control/StandardFileTest.php index 4b6e5ec..e85c1dd 100644 --- a/tests/wdm/debian/control/StandardFileTest.php +++ b/tests/wdm/debian/control/StandardFileTest.php @@ -28,4 +28,12 @@ Description: Your description OEF; $this->assertEquals($expected, $conf); } + + /** + * @expectedException InvalidArgumentException + */ + public function testFilterMissingOrInvalidProperties() + { + $this->object["MyPersonalSection"] = "Test"; + } } From f097b8cf31201621c15b9ecbee1e1f172179674b Mon Sep 17 00:00:00 2001 From: Walter Dal Mut Date: Wed, 3 Dec 2014 22:48:17 +0100 Subject: [PATCH 18/54] Cover base configuration overwrite --- src/wdm/debian/control/StandardFile.php | 2 +- tests/wdm/debian/control/StandardFileTest.php | 34 +++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/src/wdm/debian/control/StandardFile.php b/src/wdm/debian/control/StandardFile.php index cf61145..7092840 100644 --- a/src/wdm/debian/control/StandardFile.php +++ b/src/wdm/debian/control/StandardFile.php @@ -163,7 +163,7 @@ class StandardFile public function offsetSet ($offset, $value) { if (!$this->offsetExists($offset)) { - throw new \InvalidArgumentException("Invalid property for this control file."); + throw new \InvalidArgumentException("Invalid property '{$offset}' for this control file."); } $this->_keys[$offset] = $value; } diff --git a/tests/wdm/debian/control/StandardFileTest.php b/tests/wdm/debian/control/StandardFileTest.php index e85c1dd..81b539a 100644 --- a/tests/wdm/debian/control/StandardFileTest.php +++ b/tests/wdm/debian/control/StandardFileTest.php @@ -31,9 +31,43 @@ OEF; /** * @expectedException InvalidArgumentException + * @expectedExceptionMessage Invalid property 'MyPersonalSection' for this control file. */ public function testFilterMissingOrInvalidProperties() { $this->object["MyPersonalSection"] = "Test"; } + + public function testOverwriteConfiguration() + { + $this->object["Version"] = "1.0.1"; + $this->object["Section"] = "Software"; + $this->object["Priority"] = "security"; + $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["Provides"] = "Corley SRL"; + $this->object["Description"] = "My Desc"; + $this->object["Depends"] = "php5-cli"; + $this->object["Recommends"] = "php5-curl"; + + $conf = (string)$this->object; + + $expected = <<assertEquals($expected, $conf); + } } From 0c2ba5071d54345d767d35d5b6d9cdab75db6c9a Mon Sep 17 00:00:00 2001 From: Walter Dal Mut Date: Wed, 3 Dec 2014 23:24:42 +0100 Subject: [PATCH 19/54] BC Break packager - Simplifies packager maintenance --- CHANGELOG-0.0.4.md | 3 ++ README.md | 15 ++++++-- src/example.php => example.php | 4 +- src/package.xml | 62 ------------------------------- src/wdm/debian/Packager.php | 4 +- tests/wdm/debian/PackagerTest.php | 17 +++++++++ 6 files changed, 35 insertions(+), 70 deletions(-) create mode 100644 CHANGELOG-0.0.4.md rename src/example.php => example.php (91%) delete mode 100644 src/package.xml create mode 100644 tests/wdm/debian/PackagerTest.php diff --git a/CHANGELOG-0.0.4.md b/CHANGELOG-0.0.4.md new file mode 100644 index 0000000..8b53ee2 --- /dev/null +++ b/CHANGELOG-0.0.4.md @@ -0,0 +1,3 @@ +# BC Breaks + +* Build will returns the dpkg command instead print it to the user diff --git a/README.md b/README.md index 4d0c0c7..71bab00 100644 --- a/README.md +++ b/README.md @@ -30,9 +30,16 @@ $packager->mount("/path/to/docs", "/usr/share/docs"); //Creates folders using mount points $packager->run(); -//Creates the Debian package -$packager->build(); +//Get the Debian package command +echo $packager->build(); ``` + +**Create the Package** + +``` +$(php pack.php) +``` + ## Pre-Post scripts Optianally you can add script for different hooks @@ -45,7 +52,7 @@ Optianally you can add script for different hooks * Run pre package remove * post-remove * Run post package remove - + Adding scripts ```php @@ -67,4 +74,4 @@ echo "Goodbye Cruel World" exit 0 ``` - + diff --git a/src/example.php b/example.php similarity index 91% rename from src/example.php rename to example.php index 00cd7e6..61e952b 100644 --- a/src/example.php +++ b/example.php @@ -23,5 +23,5 @@ $packager->mount(__DIR__ . "/../../diff", "/my-differ"); //Creates folders using mount points $packager->run(); -//Creates the Debian package -$packager->build(); \ No newline at end of file +//Get the Debian package command +echo $packager->build(); diff --git a/src/package.xml b/src/package.xml deleted file mode 100644 index a701ff0..0000000 --- a/src/package.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - Corley_Deb_Packager - pear.corley.it - Corley DEB packager. - - This library provides mechanisms for generate valid .deb files useful - for software distribution for GNU/Linux Debian based systems. - - - Walter Dal Mut - wdalmut - walter.dalmut at corley.it - yes - - - Gabriele Mittica - gmittica - gabriele.mittica at corley.it - yes - - 2012-06-04 - - - 0.0.3 - 0.0.3 - - - alpha - alpha - - MIT - In this release the first proposal. - - - - - - - - - - - - - - - - - - 5.3.3 - - - 1.4.0 - - - - - diff --git a/src/wdm/debian/Packager.php b/src/wdm/debian/Packager.php index 3299e22..9f2a40b 100644 --- a/src/wdm/debian/Packager.php +++ b/src/wdm/debian/Packager.php @@ -192,8 +192,8 @@ class Packager $debPackageName = basename($this->_outputPath . ".deb"); } - $command = "dpkg -b {$this->_outputPath} {$debPackageName}" . PHP_EOL; + $command = "dpkg -b {$this->_outputPath} {$debPackageName}"; - echo $command; + return $command; } } diff --git a/tests/wdm/debian/PackagerTest.php b/tests/wdm/debian/PackagerTest.php new file mode 100644 index 0000000..8c6bb0e --- /dev/null +++ b/tests/wdm/debian/PackagerTest.php @@ -0,0 +1,17 @@ +object = new Packager(); + } + + public function testRetrieveTheBuildCommand() + { + $this->object->setOutputPath("/tmp"); + + $this->assertEquals("dpkg -b /tmp my.deb", $this->object->build("my.deb")); + } +} From 71be07b1fea65a620be187064ff8524a03c1c183 Mon Sep 17 00:00:00 2001 From: Walter Dal Mut Date: Wed, 3 Dec 2014 23:32:13 +0100 Subject: [PATCH 20/54] Removed custom autoloader, use composer instead --- src/wdm/debian/Autoloader.php | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 src/wdm/debian/Autoloader.php diff --git a/src/wdm/debian/Autoloader.php b/src/wdm/debian/Autoloader.php deleted file mode 100644 index 8b0d270..0000000 --- a/src/wdm/debian/Autoloader.php +++ /dev/null @@ -1,4 +0,0 @@ - Date: Wed, 3 Dec 2014 23:32:58 +0100 Subject: [PATCH 21/54] Removed IPacakger interface (not useful) --- src/wdm/debian/IPackager.php | 57 ------------------------------------ src/wdm/debian/Packager.php | 29 ------------------ 2 files changed, 86 deletions(-) delete mode 100644 src/wdm/debian/IPackager.php diff --git a/src/wdm/debian/IPackager.php b/src/wdm/debian/IPackager.php deleted file mode 100644 index 25ac960..0000000 --- a/src/wdm/debian/IPackager.php +++ /dev/null @@ -1,57 +0,0 @@ - Date: Wed, 3 Dec 2014 23:35:36 +0100 Subject: [PATCH 22/54] Added travis-ci badge --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 71bab00..f38200d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # Debian packager (PHP) + * Develop: [![Build Status](https://travis-ci.org/wdalmut/php-deb-packager.svg?branch=develop)](https://travis-ci.org/wdalmut/php-deb-packager) + * Master : [![Build Status](https://travis-ci.org/wdalmut/php-deb-packager.svg?branch=master)](https://travis-ci.org/wdalmut/php-deb-packager) + A simple debian packager for PHP applications ```php From adac0738cdd2321c2ee632435df5e065c5a78bae Mon Sep 17 00:00:00 2001 From: Walter Dal Mut Date: Thu, 4 Dec 2014 07:52:23 +0100 Subject: [PATCH 23/54] Fixes missing autoloader class --- README.md | 2 +- example.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f38200d..4f8b676 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ A simple debian packager for PHP applications ```php Date: Thu, 4 Dec 2014 08:00:46 +0100 Subject: [PATCH 24/54] Updated change log --- CHANGELOG-0.0.4.md | 1 + README.md | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/CHANGELOG-0.0.4.md b/CHANGELOG-0.0.4.md index 8b53ee2..1e6c826 100644 --- a/CHANGELOG-0.0.4.md +++ b/CHANGELOG-0.0.4.md @@ -1,3 +1,4 @@ # BC Breaks * Build will returns the dpkg command instead print it to the user +* Removed internal autoloader -> use composer as a default diff --git a/README.md b/README.md index 4f8b676..5cc8951 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,20 @@ A simple debian packager for PHP applications +Get composer: + +``` +curl -sS http://getcomposer.org/installer | php +``` + +Install dependencies and autoloader + +``` +php composer.phar install +``` + +Use it: + ```php Date: Sun, 12 Apr 2015 10:36:11 +0200 Subject: [PATCH 25/54] Removed version property from composer --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index 5d6f090..13bad22 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,6 @@ { "name": "wdalmut/php-deb-packager", "description": "A simple debian packager for PHP applications", - "version":"0.0.3", "type":"library", "keywords":["deb","packager","ubuntu","php-deb"], "time":"2012-07-31", From 3a89e04031261d09703c17a3a12fbb1afe055aea Mon Sep 17 00:00:00 2001 From: Walter Dal Mut Date: Sun, 12 Apr 2015 10:37:17 +0200 Subject: [PATCH 26/54] Bumped version 0.0.8 --- VERSION | 1 + 1 file changed, 1 insertion(+) create mode 100644 VERSION diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..d169b2f --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.0.8 From 664cff2bf032fb1703461d040cb01391391ee5ab Mon Sep 17 00:00:00 2001 From: Walter Dal Mut Date: Sun, 12 Apr 2015 11:27:56 +0200 Subject: [PATCH 27/54] Added `getControl` method In order to retrive the actual control file i have added a new getter method for the control file --- composer.json | 11 +- composer.lock | 405 +++++++++++++++++++++++------- src/wdm/debian/Packager.php | 10 + tests/wdm/debian/PackagerTest.php | 8 + 4 files changed, 330 insertions(+), 104 deletions(-) diff --git a/composer.json b/composer.json index 13bad22..0e1877c 100644 --- a/composer.json +++ b/composer.json @@ -2,8 +2,7 @@ "name": "wdalmut/php-deb-packager", "description": "A simple debian packager for PHP applications", "type":"library", - "keywords":["deb","packager","ubuntu","php-deb"], - "time":"2012-07-31", + "keywords":["deb","packager","ubuntu","php-deb", "debian"], "license":"MIT", "authors": [ { @@ -26,11 +25,5 @@ "psr-0": { "wdm": ["src/", "tests/"] } - }, - "repositories": [ - { - "type": "vcs", - "url": "https://github.com/wdalmut/php-deb-packager" - } - ] + } } diff --git a/composer.lock b/composer.lock index fe52725..977e079 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "b89ac83d7c4abbd18d2ada4d5e2eeae7", + "hash": "42aa3f85b9b2e12726c3a920256505a0", "packages": [], "packages-dev": [ { @@ -62,17 +62,126 @@ "time": "2014-10-13 12:58:55" }, { - "name": "phpunit/php-code-coverage", - "version": "2.0.13", + "name": "phpdocumentor/reflection-docblock", + "version": "2.0.4", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "0e7d2eec5554f869fa7a4ec2d21e4b37af943ea5" + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/0e7d2eec5554f869fa7a4ec2d21e4b37af943ea5", - "reference": "0e7d2eec5554f869fa7a4ec2d21e4b37af943ea5", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", + "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "suggest": { + "dflydev/markdown": "~1.0", + "erusev/parsedown": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "phpDocumentor": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "mike.vanriel@naenius.com" + } + ], + "time": "2015-02-03 12:10:50" + }, + { + "name": "phpspec/prophecy", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "8724cd239f8ef4c046f55a3b18b4d91cc7f3e4c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/8724cd239f8ef4c046f55a3b18b4d91cc7f3e4c5", + "reference": "8724cd239f8ef4c046f55a3b18b4d91cc7f3e4c5", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "phpdocumentor/reflection-docblock": "~2.0", + "sebastian/comparator": "~1.1" + }, + "require-dev": { + "phpspec/phpspec": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "psr-0": { + "Prophecy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "time": "2015-03-27 19:31:25" + }, + { + "name": "phpunit/php-code-coverage", + "version": "2.0.16", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "934fd03eb6840508231a7f73eb8940cf32c3b66c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/934fd03eb6840508231a7f73eb8940cf32c3b66c", + "reference": "934fd03eb6840508231a7f73eb8940cf32c3b66c", "shasum": "" }, "require": { @@ -85,7 +194,7 @@ }, "require-dev": { "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~4.1" + "phpunit/phpunit": "~4" }, "suggest": { "ext-dom": "*", @@ -104,9 +213,6 @@ ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], @@ -124,35 +230,37 @@ "testing", "xunit" ], - "time": "2014-12-03 06:41:44" + "time": "2015-04-11 04:35:00" }, { "name": "phpunit/php-file-iterator", - "version": "1.3.4", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb" + "reference": "a923bb15680d0089e2316f7a4af8f437046e96bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/acd690379117b042d1c8af1fafd61bde001bf6bb", - "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a923bb15680d0089e2316f7a4af8f437046e96bb", + "reference": "a923bb15680d0089e2316f7a4af8f437046e96bb", "shasum": "" }, "require": { "php": ">=5.3.3" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, "autoload": { "classmap": [ - "File/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], @@ -169,7 +277,7 @@ "filesystem", "iterator" ], - "time": "2013-10-10 15:34:57" + "time": "2015-04-02 05:19:05" }, { "name": "phpunit/php-text-template", @@ -261,16 +369,16 @@ }, { "name": "phpunit/php-token-stream", - "version": "1.3.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "f8d5d08c56de5cfd592b3340424a81733259a876" + "reference": "eab81d02569310739373308137284e0158424330" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/f8d5d08c56de5cfd592b3340424a81733259a876", - "reference": "f8d5d08c56de5cfd592b3340424a81733259a876", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/eab81d02569310739373308137284e0158424330", + "reference": "eab81d02569310739373308137284e0158424330", "shasum": "" }, "require": { @@ -283,7 +391,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.4-dev" } }, "autoload": { @@ -306,20 +414,20 @@ "keywords": [ "tokenizer" ], - "time": "2014-08-31 06:12:13" + "time": "2015-04-08 04:46:07" }, { "name": "phpunit/phpunit", - "version": "4.3.5", + "version": "4.6.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "2dab9d593997db4abcf58d0daf798eb4e9cecfe1" + "reference": "163232991e652e6efed2f8470326fffa61e848e2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2dab9d593997db4abcf58d0daf798eb4e9cecfe1", - "reference": "2dab9d593997db4abcf58d0daf798eb4e9cecfe1", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/163232991e652e6efed2f8470326fffa61e848e2", + "reference": "163232991e652e6efed2f8470326fffa61e848e2", "shasum": "" }, "require": { @@ -329,17 +437,19 @@ "ext-reflection": "*", "ext-spl": "*", "php": ">=5.3.3", - "phpunit/php-code-coverage": "~2.0", - "phpunit/php-file-iterator": "~1.3.2", + "phpspec/prophecy": "~1.3,>=1.3.1", + "phpunit/php-code-coverage": "~2.0,>=2.0.11", + "phpunit/php-file-iterator": "~1.4", "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "~1.0.2", + "phpunit/php-timer": "~1.0", "phpunit/phpunit-mock-objects": "~2.3", - "sebastian/comparator": "~1.0", - "sebastian/diff": "~1.1", - "sebastian/environment": "~1.0", - "sebastian/exporter": "~1.0", + "sebastian/comparator": "~1.1", + "sebastian/diff": "~1.2", + "sebastian/environment": "~1.2", + "sebastian/exporter": "~1.2", + "sebastian/global-state": "~1.0", "sebastian/version": "~1.0", - "symfony/yaml": "~2.0" + "symfony/yaml": "~2.1|~3.0" }, "suggest": { "phpunit/php-invoker": "~1.1" @@ -350,7 +460,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3.x-dev" + "dev-master": "4.6.x-dev" } }, "autoload": { @@ -359,10 +469,6 @@ ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "", - "../../symfony/yaml/" - ], "license": [ "BSD-3-Clause" ], @@ -374,35 +480,35 @@ } ], "description": "The PHP Unit Testing framework.", - "homepage": "http://www.phpunit.de/", + "homepage": "https://phpunit.de/", "keywords": [ "phpunit", "testing", "xunit" ], - "time": "2014-11-11 10:11:09" + "time": "2015-04-11 05:23:21" }, { "name": "phpunit/phpunit-mock-objects", - "version": "2.3.0", + "version": "2.3.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "c63d2367247365f688544f0d500af90a11a44c65" + "reference": "74ffb87f527f24616f72460e54b595f508dccb5c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/c63d2367247365f688544f0d500af90a11a44c65", - "reference": "c63d2367247365f688544f0d500af90a11a44c65", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/74ffb87f527f24616f72460e54b595f508dccb5c", + "reference": "74ffb87f527f24616f72460e54b595f508dccb5c", "shasum": "" }, "require": { - "doctrine/instantiator": "~1.0,>=1.0.1", + "doctrine/instantiator": "~1.0,>=1.0.2", "php": ">=5.3.3", "phpunit/php-text-template": "~1.2" }, "require-dev": { - "phpunit/phpunit": "~4.3" + "phpunit/phpunit": "~4.4" }, "suggest": { "ext-soap": "*" @@ -435,34 +541,34 @@ "mock", "xunit" ], - "time": "2014-10-03 05:12:11" + "time": "2015-04-02 05:36:41" }, { "name": "sebastian/comparator", - "version": "1.0.1", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "e54a01c0da1b87db3c5a3c4c5277ddf331da4aef" + "reference": "1dd8869519a225f7f2b9eb663e225298fade819e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/e54a01c0da1b87db3c5a3c4c5277ddf331da4aef", - "reference": "e54a01c0da1b87db3c5a3c4c5277ddf331da4aef", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1dd8869519a225f7f2b9eb663e225298fade819e", + "reference": "1dd8869519a225f7f2b9eb663e225298fade819e", "shasum": "" }, "require": { "php": ">=5.3.3", - "sebastian/diff": "~1.1", - "sebastian/exporter": "~1.0" + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2" }, "require-dev": { - "phpunit/phpunit": "~4.1" + "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { @@ -499,20 +605,20 @@ "compare", "equality" ], - "time": "2014-05-11 23:00:21" + "time": "2015-01-29 16:28:08" }, { "name": "sebastian/diff", - "version": "1.2.0", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "5843509fed39dee4b356a306401e9dd1a931fec7" + "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/5843509fed39dee4b356a306401e9dd1a931fec7", - "reference": "5843509fed39dee4b356a306401e9dd1a931fec7", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/863df9687835c62aa423a22412d26fa2ebde3fd3", + "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3", "shasum": "" }, "require": { @@ -524,7 +630,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.3-dev" } }, "autoload": { @@ -551,32 +657,32 @@ "keywords": [ "diff" ], - "time": "2014-08-15 10:29:00" + "time": "2015-02-22 15:13:53" }, { "name": "sebastian/environment", - "version": "1.2.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "6e6c71d918088c251b181ba8b3088af4ac336dd7" + "reference": "5a8c7d31914337b69923db26c4221b81ff5a196e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6e6c71d918088c251b181ba8b3088af4ac336dd7", - "reference": "6e6c71d918088c251b181ba8b3088af4ac336dd7", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5a8c7d31914337b69923db26c4221b81ff5a196e", + "reference": "5a8c7d31914337b69923db26c4221b81ff5a196e", "shasum": "" }, "require": { "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "~4.3" + "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { @@ -601,32 +707,33 @@ "environment", "hhvm" ], - "time": "2014-10-25 08:00:45" + "time": "2015-01-01 10:01:08" }, { "name": "sebastian/exporter", - "version": "1.0.2", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "c7d59948d6e82818e1bdff7cadb6c34710eb7dc0" + "reference": "84839970d05254c73cde183a721c7af13aede943" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/c7d59948d6e82818e1bdff7cadb6c34710eb7dc0", - "reference": "c7d59948d6e82818e1bdff7cadb6c34710eb7dc0", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/84839970d05254c73cde183a721c7af13aede943", + "reference": "84839970d05254c73cde183a721c7af13aede943", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.3.3", + "sebastian/recursion-context": "~1.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -666,20 +773,124 @@ "export", "exporter" ], - "time": "2014-09-10 00:51:36" + "time": "2015-01-27 07:23:06" }, { - "name": "sebastian/version", - "version": "1.0.3", + "name": "sebastian/global-state", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43" + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43", - "reference": "b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/c7428acdb62ece0a45e6306f1ae85e1c05b09c01", + "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2014-10-06 09:23:50" + }, + { + "name": "sebastian/recursion-context", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "3989662bbb30a29d20d9faa04a846af79b276252" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/3989662bbb30a29d20d9faa04a846af79b276252", + "reference": "3989662bbb30a29d20d9faa04a846af79b276252", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2015-01-24 09:48:32" + }, + { + "name": "sebastian/version", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "ab931d46cd0d3204a91e1b9a40c4bc13032b58e4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/ab931d46cd0d3204a91e1b9a40c4bc13032b58e4", + "reference": "ab931d46cd0d3204a91e1b9a40c4bc13032b58e4", "shasum": "" }, "type": "library", @@ -701,26 +912,29 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2014-03-07 15:35:33" + "time": "2015-02-24 06:35:25" }, { "name": "symfony/yaml", - "version": "v2.6.1", + "version": "v2.6.6", "target-dir": "Symfony/Component/Yaml", "source": { "type": "git", "url": "https://github.com/symfony/Yaml.git", - "reference": "3346fc090a3eb6b53d408db2903b241af51dcb20" + "reference": "174f009ed36379a801109955fc5a71a49fe62dd4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/3346fc090a3eb6b53d408db2903b241af51dcb20", - "reference": "3346fc090a3eb6b53d408db2903b241af51dcb20", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/174f009ed36379a801109955fc5a71a49fe62dd4", + "reference": "174f009ed36379a801109955fc5a71a49fe62dd4", "shasum": "" }, "require": { "php": ">=5.3.3" }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, "type": "library", "extra": { "branch-alias": { @@ -748,13 +962,14 @@ ], "description": "Symfony Yaml Component", "homepage": "http://symfony.com", - "time": "2014-12-02 20:19:20" + "time": "2015-03-30 15:54:10" } ], "aliases": [], "minimum-stability": "stable", "stability-flags": [], "prefer-stable": false, + "prefer-lowest": false, "platform": { "php": ">=5.3.3" }, diff --git a/src/wdm/debian/Packager.php b/src/wdm/debian/Packager.php index 1451287..a76e22d 100644 --- a/src/wdm/debian/Packager.php +++ b/src/wdm/debian/Packager.php @@ -28,6 +28,16 @@ class Packager return $this; } + /** + * Return the actual control file + * + * @return StandardFile + */ + public function getControl() + { + return $this->_control; + } + /** * Pre install script * diff --git a/tests/wdm/debian/PackagerTest.php b/tests/wdm/debian/PackagerTest.php index 8c6bb0e..657872d 100644 --- a/tests/wdm/debian/PackagerTest.php +++ b/tests/wdm/debian/PackagerTest.php @@ -14,4 +14,12 @@ class PackagerTest extends \PHPUnit_Framework_TestCase $this->assertEquals("dpkg -b /tmp my.deb", $this->object->build("my.deb")); } + + public function testRetriveControlFile() + { + $control = new control\StandardFile(); + $this->object->setControl($control); + + $this->assertSame($control, $this->object->getControl()); + } } From 1b296a55acc5eb2bf9e312938173e209bc422990 Mon Sep 17 00:00:00 2001 From: Walter Dal Mut Date: Sun, 12 Apr 2015 11:29:29 +0200 Subject: [PATCH 28/54] Bumped version 0.0.9 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index d169b2f..c5d54ec 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.0.8 +0.0.9 From 5251337b385a26ca5bff296bc2fe1ac78c21cbed Mon Sep 17 00:00:00 2001 From: Walter Dal Mut Date: Sun, 12 Apr 2015 13:12:26 +0200 Subject: [PATCH 29/54] Use getters for the output path --- CHANGELOG-0.0.10.md | 5 +++++ src/wdm/debian/Packager.php | 37 +++++++++++++++++++++++++------------ 2 files changed, 30 insertions(+), 12 deletions(-) create mode 100644 CHANGELOG-0.0.10.md diff --git a/CHANGELOG-0.0.10.md b/CHANGELOG-0.0.10.md new file mode 100644 index 0000000..f135a1d --- /dev/null +++ b/CHANGELOG-0.0.10.md @@ -0,0 +1,5 @@ +# BC Breaks + +# Deprecations + + * Method `mount` will be replaced by method `addMount` in the future diff --git a/src/wdm/debian/Packager.php b/src/wdm/debian/Packager.php index a76e22d..a515a73 100644 --- a/src/wdm/debian/Packager.php +++ b/src/wdm/debian/Packager.php @@ -78,7 +78,15 @@ class Packager $this->_postRM = $path; } + /** + * @deprecated See addMount instead + */ public function mount($sourcePath, $destinationPath) + { + return $this->addMount($sourcePath, $destinationPath); + } + + public function addMount($sourcePath, $destinationPath) { $this->_mountPoints[$sourcePath] = $destinationPath; return $this; @@ -90,10 +98,15 @@ class Packager return $this; } + public function getOutputPath() + { + return $this->_outputPath; + } + public function run() { - if (file_exists($this->_outputPath)) { - $iterator = new \DirectoryIterator($this->_outputPath); + if (file_exists($this->getOutputPath())) { + $iterator = new \DirectoryIterator($this->getOutputPath()); foreach ($iterator as $path) { if ($path != '.' || $path != '..') { echo "OUTPUT DIRECTORY MUST BE EMPTY! Something exists, exit immediately!" . PHP_EOL; @@ -102,36 +115,36 @@ class Packager } } - mkdir($this->_outputPath, 0777); + mkdir($this->getOutputPath(), 0777); foreach ($this->_mountPoints as $path => $dest) { - $this->_pathToPath($path, $this->_outputPath . DIRECTORY_SEPARATOR . $dest); + $this->_pathToPath($path, $this->getOutputPath() . DIRECTORY_SEPARATOR . $dest); } - mkdir($this->_outputPath . "/DEBIAN", 0777); + mkdir($this->getOutputPath() . "/DEBIAN", 0777); - file_put_contents($this->_outputPath . "/DEBIAN/control", (string)$this->_control); + file_put_contents($this->getOutputPath() . "/DEBIAN/control", (string)$this->_control); if ($this->_preInst) { - $dest = $this->_outputPath . "/DEBIAN/preinst"; + $dest = $this->getOutputPath() . "/DEBIAN/preinst"; $this->_copy($this->_preInst, $dest); chmod($dest, 0755); } if ($this->_postInst) { - $dest = $this->_outputPath . "/DEBIAN/postinst"; + $dest = $this->getOutputPath() . "/DEBIAN/postinst"; $this->_copy($this->_postInst, $dest); chmod($dest, 0755); } if ($this->_preRM) { - $dest = $this->_outputPath . "/DEBIAN/prerm"; + $dest = $this->getOutputPath() . "/DEBIAN/prerm"; $this->_copy($this->_preRM, $dest); chmod($dest, 0755); } if ($this->_postRM) { - $dest = $this->_outputPath . "/DEBIAN/postrm"; + $dest = $this->getOutputPath() . "/DEBIAN/postrm"; $this->_copy($this->_postRM, $dest); chmod($dest, 0755); } @@ -170,10 +183,10 @@ class Packager public function build($debPackageName = false) { if (!$debPackageName) { - $debPackageName = basename($this->_outputPath . ".deb"); + $debPackageName = basename($this->getOutputPath() . ".deb"); } - $command = "dpkg -b {$this->_outputPath} {$debPackageName}"; + $command = "dpkg -b {$this->getOutputPath()} {$debPackageName}"; return $command; } From fc0640f9bc8df978766893884ec5a941f62685c8 Mon Sep 17 00:00:00 2001 From: Walter Dal Mut Date: Sun, 12 Apr 2015 13:13:17 +0200 Subject: [PATCH 30/54] Bumped version 0.0.10 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index c5d54ec..7c1886b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.0.9 +0.0.10 From 592dd77f856c47abd5188b631993a904aebc3c35 Mon Sep 17 00:00:00 2001 From: Walter Dal Mut Date: Sun, 12 Apr 2015 17:37:25 +0200 Subject: [PATCH 31/54] Added describe project link --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 5cc8951..a10061f 100644 --- a/README.md +++ b/README.md @@ -92,3 +92,7 @@ echo "Goodbye Cruel World" exit 0 ``` +## Use Yaml files instead the library directly + +Just take a look to [wdalmut/php-deb-describe](https://github.com/wdalmut/php-deb-describe) + From 14d67be8d82508c36f4c9a06bef987be895a2a8a Mon Sep 17 00:00:00 2001 From: wapmorgan Date: Thu, 21 May 2015 20:07:23 +0300 Subject: [PATCH 32/54] Add preserving original file permissions --- src/wdm/debian/Packager.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wdm/debian/Packager.php b/src/wdm/debian/Packager.php index a515a73..f7482f5 100644 --- a/src/wdm/debian/Packager.php +++ b/src/wdm/debian/Packager.php @@ -178,6 +178,8 @@ class Packager mkdir($destFolder, 0777, true); } copy($source, $dest); + if (fileperms($source) != fileperms($dest)) + chmod($dest, fileperms($source)); } public function build($debPackageName = false) From b4f5905d7283c60cb8a333d64b497f6bd77de3dd Mon Sep 17 00:00:00 2001 From: wapmorgan Date: Thu, 21 May 2015 20:07:23 +0300 Subject: [PATCH 33/54] Add preserving original file permissions --- src/wdm/debian/Packager.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wdm/debian/Packager.php b/src/wdm/debian/Packager.php index a515a73..f7482f5 100644 --- a/src/wdm/debian/Packager.php +++ b/src/wdm/debian/Packager.php @@ -178,6 +178,8 @@ class Packager mkdir($destFolder, 0777, true); } copy($source, $dest); + if (fileperms($source) != fileperms($dest)) + chmod($dest, fileperms($source)); } public function build($debPackageName = false) From 3fea36764b5b8e7c15b1f285fca2689233b9e7fd Mon Sep 17 00:00:00 2001 From: Walter Dal Mut Date: Thu, 21 May 2015 22:07:43 +0200 Subject: [PATCH 34/54] Bumped version 0.0.11 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 7c1886b..2cfabea 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.0.10 +0.0.11 From 0dc9ace16882ff22ba540d38f1eceaa6662838c1 Mon Sep 17 00:00:00 2001 From: wapmorgan Date: Tue, 26 May 2015 04:55:20 +0300 Subject: [PATCH 35/54] Fix for incorrent errors about non-empty output directory --- src/wdm/debian/Packager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wdm/debian/Packager.php b/src/wdm/debian/Packager.php index f7482f5..634f597 100644 --- a/src/wdm/debian/Packager.php +++ b/src/wdm/debian/Packager.php @@ -108,7 +108,7 @@ class Packager if (file_exists($this->getOutputPath())) { $iterator = new \DirectoryIterator($this->getOutputPath()); foreach ($iterator as $path) { - if ($path != '.' || $path != '..') { + if ($path != '.' && $path != '..') { echo "OUTPUT DIRECTORY MUST BE EMPTY! Something exists, exit immediately!" . PHP_EOL; exit(); } From e03d099610b009d423f55e9195a780235cc57ef0 Mon Sep 17 00:00:00 2001 From: Walter Dal Mut Date: Tue, 26 May 2015 08:37:01 +0200 Subject: [PATCH 36/54] Bumped version 0.0.12 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 2cfabea..8cbf02c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.0.11 +0.0.12 From 9ccde2227ada95e3c6fe37c70ab4201bfb89ee2a Mon Sep 17 00:00:00 2001 From: Walter Dal Mut Date: Tue, 26 May 2015 10:15:42 +0200 Subject: [PATCH 37/54] Added functional test * The packager will throws exceptions when the output folder exists --- composer.json | 3 +- composer.lock | 92 ++++++++++++++++++++++--------- src/wdm/debian/Packager.php | 8 ++- tests/wdm/debian/PackagerTest.php | 68 +++++++++++++++++++++++ 4 files changed, 140 insertions(+), 31 deletions(-) diff --git a/composer.json b/composer.json index 0e1877c..2a85ed5 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,8 @@ "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "~4" + "phpunit/phpunit": "~4", + "mikey179/vfsStream": "1.4.*" }, "autoload": { "psr-0": { diff --git a/composer.lock b/composer.lock index 977e079..101f0e2 100644 --- a/composer.lock +++ b/composer.lock @@ -1,10 +1,10 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "42aa3f85b9b2e12726c3a920256505a0", + "hash": "452e33232d90b29107daa9bb4740b3ea", "packages": [], "packages-dev": [ { @@ -61,6 +61,44 @@ ], "time": "2014-10-13 12:58:55" }, + { + "name": "mikey179/vfsStream", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/mikey179/vfsStream.git", + "reference": "61b12172292cf539685507aa65b076c1530e83c1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mikey179/vfsStream/zipball/61b12172292cf539685507aa65b076c1530e83c1", + "reference": "61b12172292cf539685507aa65b076c1530e83c1", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "psr-0": { + "org\\bovigo\\vfs\\": "src/main/php" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD" + ], + "homepage": "http://vfs.bovigo.org/", + "time": "2014-09-14 10:18:53" + }, { "name": "phpdocumentor/reflection-docblock", "version": "2.0.4", @@ -112,16 +150,16 @@ }, { "name": "phpspec/prophecy", - "version": "1.4.0", + "version": "v1.4.1", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "8724cd239f8ef4c046f55a3b18b4d91cc7f3e4c5" + "reference": "3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/8724cd239f8ef4c046f55a3b18b4d91cc7f3e4c5", - "reference": "8724cd239f8ef4c046f55a3b18b4d91cc7f3e4c5", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373", + "reference": "3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373", "shasum": "" }, "require": { @@ -168,20 +206,20 @@ "spy", "stub" ], - "time": "2015-03-27 19:31:25" + "time": "2015-04-27 22:15:08" }, { "name": "phpunit/php-code-coverage", - "version": "2.0.16", + "version": "2.0.17", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "934fd03eb6840508231a7f73eb8940cf32c3b66c" + "reference": "c4e8e7725e351184a76544634855b8a9c405a6e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/934fd03eb6840508231a7f73eb8940cf32c3b66c", - "reference": "934fd03eb6840508231a7f73eb8940cf32c3b66c", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c4e8e7725e351184a76544634855b8a9c405a6e3", + "reference": "c4e8e7725e351184a76544634855b8a9c405a6e3", "shasum": "" }, "require": { @@ -230,7 +268,7 @@ "testing", "xunit" ], - "time": "2015-04-11 04:35:00" + "time": "2015-05-25 05:11:59" }, { "name": "phpunit/php-file-iterator", @@ -418,16 +456,16 @@ }, { "name": "phpunit/phpunit", - "version": "4.6.4", + "version": "4.6.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "163232991e652e6efed2f8470326fffa61e848e2" + "reference": "57bf06dd4eebe2a5ced79a8de71509e7d5c18b25" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/163232991e652e6efed2f8470326fffa61e848e2", - "reference": "163232991e652e6efed2f8470326fffa61e848e2", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/57bf06dd4eebe2a5ced79a8de71509e7d5c18b25", + "reference": "57bf06dd4eebe2a5ced79a8de71509e7d5c18b25", "shasum": "" }, "require": { @@ -486,7 +524,7 @@ "testing", "xunit" ], - "time": "2015-04-11 05:23:21" + "time": "2015-05-25 05:18:18" }, { "name": "phpunit/phpunit-mock-objects", @@ -916,17 +954,17 @@ }, { "name": "symfony/yaml", - "version": "v2.6.6", + "version": "v2.6.7", "target-dir": "Symfony/Component/Yaml", "source": { "type": "git", "url": "https://github.com/symfony/Yaml.git", - "reference": "174f009ed36379a801109955fc5a71a49fe62dd4" + "reference": "f157ab074e453ecd4c0fa775f721f6e67a99d9e2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/174f009ed36379a801109955fc5a71a49fe62dd4", - "reference": "174f009ed36379a801109955fc5a71a49fe62dd4", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/f157ab074e453ecd4c0fa775f721f6e67a99d9e2", + "reference": "f157ab074e453ecd4c0fa775f721f6e67a99d9e2", "shasum": "" }, "require": { @@ -951,18 +989,18 @@ "MIT" ], "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, { "name": "Fabien Potencier", "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], "description": "Symfony Yaml Component", - "homepage": "http://symfony.com", - "time": "2015-03-30 15:54:10" + "homepage": "https://symfony.com", + "time": "2015-05-02 15:18:45" } ], "aliases": [], diff --git a/src/wdm/debian/Packager.php b/src/wdm/debian/Packager.php index 634f597..7d0dd9a 100644 --- a/src/wdm/debian/Packager.php +++ b/src/wdm/debian/Packager.php @@ -1,6 +1,7 @@ getOutputPath()); foreach ($iterator as $path) { if ($path != '.' && $path != '..') { - echo "OUTPUT DIRECTORY MUST BE EMPTY! Something exists, exit immediately!" . PHP_EOL; - exit(); + throw new RuntimeException("OUTPUT DIRECTORY MUST BE EMPTY! Something exists, exit immediately!"); } } } - mkdir($this->getOutputPath(), 0777); + if (!file_exists($this->getOutputPath())) { + mkdir($this->getOutputPath(), 0777); + } foreach ($this->_mountPoints as $path => $dest) { $this->_pathToPath($path, $this->getOutputPath() . DIRECTORY_SEPARATOR . $dest); diff --git a/tests/wdm/debian/PackagerTest.php b/tests/wdm/debian/PackagerTest.php index 657872d..c10f4ca 100644 --- a/tests/wdm/debian/PackagerTest.php +++ b/tests/wdm/debian/PackagerTest.php @@ -1,6 +1,8 @@ assertSame($control, $this->object->getControl()); } + + /** + * @expectedException RuntimeException + * @expectedExceptionMessage OUTPUT DIRECTORY MUST BE EMPTY! Something exists, exit immediately! + */ + public function testOutputFolderIsNotEmpty() + { + $root = vfsStream::setup('root'); + + mkdir(vfsStream::url('root/tmp')); + file_put_contents(vfsStream::url('root/tmp/ciao.txt'), "ciao"); + + $this->object->setOutputPath(vfsStream::url('root/tmp')); + + $control = new control\StandardFile(); + $this->object->setControl($control); + + $this->object->run(); + } + + public function testOutputFolderExistsButIsEmpty() + { + $root = vfsStream::setup('root'); + + mkdir(vfsStream::url('root/tmp')); + + $this->object->setOutputPath(vfsStream::url('root/tmp')); + + $control = new control\StandardFile(); + $this->object->setControl($control); + + $this->object->run(); + $command = $this->object->build(); + + $this->assertEquals("dpkg -b vfs://root/tmp tmp.deb", $command); + } + + public function testCreateDebWhenOutputFolderIsMissing() + { + $root = vfsStream::setup('root'); + + $this->object->setOutputPath(vfsStream::url('root/tmp')); + + $control = new control\StandardFile(); + $this->object->setControl($control); + + $this->object->run(); + $command = $this->object->build(); + + $this->assertEquals("dpkg -b vfs://root/tmp tmp.deb", $command); + } + + public function testCreateDebPackageWithAnotherName() + { + $root = vfsStream::setup('root'); + + $this->object->setOutputPath(vfsStream::url('root/tmp')); + + $control = new control\StandardFile(); + $this->object->setControl($control); + + $this->object->run(); + $command = $this->object->build("myname.deb"); + + $this->assertEquals("dpkg -b vfs://root/tmp myname.deb", $command); + } } From e05f29d86c7acc1e845424c5ba1769751b988e24 Mon Sep 17 00:00:00 2001 From: Walter Dal Mut Date: Tue, 26 May 2015 10:35:00 +0200 Subject: [PATCH 38/54] Moved to a single changelog file --- CHANGELOG-0.0.10.md | 5 ----- CHANGELOG-0.0.4.md | 4 ---- CHANGELOG.md | 22 ++++++++++++++++++++++ 3 files changed, 22 insertions(+), 9 deletions(-) delete mode 100644 CHANGELOG-0.0.10.md delete mode 100644 CHANGELOG-0.0.4.md create mode 100644 CHANGELOG.md diff --git a/CHANGELOG-0.0.10.md b/CHANGELOG-0.0.10.md deleted file mode 100644 index f135a1d..0000000 --- a/CHANGELOG-0.0.10.md +++ /dev/null @@ -1,5 +0,0 @@ -# BC Breaks - -# Deprecations - - * Method `mount` will be replaced by method `addMount` in the future diff --git a/CHANGELOG-0.0.4.md b/CHANGELOG-0.0.4.md deleted file mode 100644 index 1e6c826..0000000 --- a/CHANGELOG-0.0.4.md +++ /dev/null @@ -1,4 +0,0 @@ -# BC Breaks - -* Build will returns the dpkg command instead print it to the user -* Removed internal autoloader -> use composer as a default diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..ba61e8c --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,22 @@ +# 0.0.13 + +## BC Breaks + + * The packager will throws a RuntimeException if the output folder already + exists and it is not empty. + +# 0.0.10 + +## BC Breaks + +## Deprecations + + * Method `mount` will be replaced by method `addMount` in the future + +# 0.0.4 + +## BC Breaks + +* Build will returns the dpkg command instead print it to the user +* Removed internal autoloader -> use composer as a default + From 0b11235a627c462443628b97011a172ee3985d29 Mon Sep 17 00:00:00 2001 From: Walter Dal Mut Date: Wed, 27 May 2015 00:02:33 +0200 Subject: [PATCH 39/54] Bumped version 0.0.13 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 8cbf02c..43b2961 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.0.12 +0.0.13 From 4d5ec6074e15810cfc5c153cbb735781cfc4f79b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Utku=20Ayd=C4=B1n?= Date: Mon, 6 Jul 2015 16:23:39 +0300 Subject: [PATCH 40/54] Minor correction in readme file --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a10061f..1a88d82 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ Adding scripts $packager->setPreInstallScript(__DIR__ . '/my-pre-install-script.sh'); $packager->setPostInstallScript(__DIR__ . '/my-post-install-script.sh'); $packager->setPreRemoveScript(__DIR__ . '/my-pre-remove-script.sh'); -$packager->setPreRemoveScript(__DIR__ . '/my-post-remove-script.sh'); +$packager->setPostRemoveScript(__DIR__ . '/my-post-remove-script.sh'); ``` See a script example From 84d9e7f8d7e42d68487e16eba27007beaab150f7 Mon Sep 17 00:00:00 2001 From: Ashley Fraser Date: Tue, 14 Jun 2016 14:34:11 +0200 Subject: [PATCH 41/54] Added support for copying symbolic links --- src/wdm/debian/Packager.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/wdm/debian/Packager.php b/src/wdm/debian/Packager.php index 7d0dd9a..da78062 100644 --- a/src/wdm/debian/Packager.php +++ b/src/wdm/debian/Packager.php @@ -179,7 +179,11 @@ class Packager if (!file_exists($destFolder)) { mkdir($destFolder, 0777, true); } - copy($source, $dest); + if (is_link($source)){ + symlink(readlink($source), $dest); + } else { + copy($source, $dest); + } if (fileperms($source) != fileperms($dest)) chmod($dest, fileperms($source)); } From eafedc1c8f25a43f4d27dc3c7c715d751b56e298 Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Tue, 21 Jun 2016 13:19:46 +0100 Subject: [PATCH 42/54] Fix indentation --- src/wdm/debian/Packager.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/wdm/debian/Packager.php b/src/wdm/debian/Packager.php index da78062..97ef609 100644 --- a/src/wdm/debian/Packager.php +++ b/src/wdm/debian/Packager.php @@ -179,13 +179,14 @@ class Packager if (!file_exists($destFolder)) { mkdir($destFolder, 0777, true); } - if (is_link($source)){ - symlink(readlink($source), $dest); - } else { + if (is_link($source)) { + symlink(readlink($source), $dest); + } else { copy($source, $dest); - } - if (fileperms($source) != fileperms($dest)) + } + if (fileperms($source) != fileperms($dest)) { chmod($dest, fileperms($source)); + } } public function build($debPackageName = false) From e5be8eac402746c4c83b4f0a27fc718b58fbafb3 Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Tue, 21 Jun 2016 13:22:27 +0100 Subject: [PATCH 43/54] check retval from copy(src,dest) --- src/wdm/debian/Packager.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wdm/debian/Packager.php b/src/wdm/debian/Packager.php index 97ef609..84612fd 100644 --- a/src/wdm/debian/Packager.php +++ b/src/wdm/debian/Packager.php @@ -182,7 +182,10 @@ class Packager if (is_link($source)) { symlink(readlink($source), $dest); } else { - copy($source, $dest); + if(!copy($source, $dest)) { + echo "Error: failed to copy: $source -> $dest \m"; + return; + } } if (fileperms($source) != fileperms($dest)) { chmod($dest, fileperms($source)); From d04b3e44fa31faa549a926a88c40a3adfa81c40d Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Tue, 21 Jun 2016 13:33:34 +0100 Subject: [PATCH 44/54] don't continue and try to set permissions on a symlink - that'll be covered by something else in this package, or is outside our scope and part of the O/S or another package --- src/wdm/debian/Packager.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/wdm/debian/Packager.php b/src/wdm/debian/Packager.php index 84612fd..8d3f89b 100644 --- a/src/wdm/debian/Packager.php +++ b/src/wdm/debian/Packager.php @@ -181,6 +181,7 @@ class Packager } if (is_link($source)) { symlink(readlink($source), $dest); + return; // don't set perms on symlink targets } else { if(!copy($source, $dest)) { echo "Error: failed to copy: $source -> $dest \m"; From 7f65a0aa8671dd0a9587a5f34d23effc06c8c11b Mon Sep 17 00:00:00 2001 From: Tony133 Date: Wed, 19 Apr 2017 12:12:32 +0200 Subject: [PATCH 45/54] Fix indentation --- src/wdm/debian/Packager.php | 2 +- src/wdm/debian/control/StandardFile.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wdm/debian/Packager.php b/src/wdm/debian/Packager.php index 8d3f89b..1eee342 100644 --- a/src/wdm/debian/Packager.php +++ b/src/wdm/debian/Packager.php @@ -183,7 +183,7 @@ class Packager symlink(readlink($source), $dest); return; // don't set perms on symlink targets } else { - if(!copy($source, $dest)) { + if (!copy($source, $dest)) { echo "Error: failed to copy: $source -> $dest \m"; return; } diff --git a/src/wdm/debian/control/StandardFile.php b/src/wdm/debian/control/StandardFile.php index 7092840..ee8b459 100644 --- a/src/wdm/debian/control/StandardFile.php +++ b/src/wdm/debian/control/StandardFile.php @@ -183,7 +183,7 @@ class StandardFile { $control = ''; foreach ($this->_keys as $key => $value) { - if($value){ + if ($value) { $control .= "{$key}: {$value}" . PHP_EOL; } } From 5616cfaedd92c6d5765b6abb6aacc92e25586682 Mon Sep 17 00:00:00 2001 From: Tony133 Date: Tue, 27 Jun 2017 15:10:25 +0200 Subject: [PATCH 46/54] Fix identation --- src/wdm/debian/control/StandardFile.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/wdm/debian/control/StandardFile.php b/src/wdm/debian/control/StandardFile.php index ee8b459..253642e 100644 --- a/src/wdm/debian/control/StandardFile.php +++ b/src/wdm/debian/control/StandardFile.php @@ -149,11 +149,13 @@ class StandardFile return $this; } - public function offsetExists ($offset) { + public function offsetExists ($offset) + { return array_key_exists($offset, $this->_keys); } - public function offsetGet ($offset) { + public function offsetGet ($offset) + { if ($this->offsetExists($offset)) { return $this->_keys[$offset]; } else { @@ -161,14 +163,16 @@ class StandardFile } } - public function offsetSet ($offset, $value) { + public function offsetSet ($offset, $value) + { if (!$this->offsetExists($offset)) { throw new \InvalidArgumentException("Invalid property '{$offset}' for this control file."); } $this->_keys[$offset] = $value; } - public function offsetUnset ($offset) { + public function offsetUnset ($offset) + { if ($this->offsetExists($offset)) { unset($this->_keys[$offset]); } From 72f6bf643d109c7897f8342a5e3f1209c7febebe Mon Sep 17 00:00:00 2001 From: Jan-Hendrik Frintrop Date: Tue, 18 Jul 2017 08:46:05 +0200 Subject: [PATCH 47/54] Fix spelling mistake in property name Property "Reccommends" does not exist. It is "Recommends" --- src/wdm/debian/control/StandardFile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wdm/debian/control/StandardFile.php b/src/wdm/debian/control/StandardFile.php index 253642e..dd3ac9d 100644 --- a/src/wdm/debian/control/StandardFile.php +++ b/src/wdm/debian/control/StandardFile.php @@ -93,7 +93,7 @@ class StandardFile public function setRecommends($depends) { - return $this->_setProperty("Reccommends", $depends); + return $this->_setProperty("Recommends", $depends); } public function setSuggests($depends) From 9f0e89de59a7372d7aede1ed3b83e9869b8f8d98 Mon Sep 17 00:00:00 2001 From: Jan-Hendrik Frintrop Date: Tue, 18 Jul 2017 08:50:11 +0200 Subject: [PATCH 48/54] Recommended packages can be a list The field "Recommends" needs to accept a list of recommended packages. --- src/wdm/debian/control/StandardFile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wdm/debian/control/StandardFile.php b/src/wdm/debian/control/StandardFile.php index dd3ac9d..3c18ee8 100644 --- a/src/wdm/debian/control/StandardFile.php +++ b/src/wdm/debian/control/StandardFile.php @@ -93,7 +93,7 @@ class StandardFile public function setRecommends($depends) { - return $this->_setProperty("Recommends", $depends); + return $this->_setProperty("Recommends", $this->_transformList($depends)); } public function setSuggests($depends) From 26deac007cd6624d0cff1b1da9db49a8072d0f89 Mon Sep 17 00:00:00 2001 From: Jan-Hendrik Frintrop Date: Tue, 18 Jul 2017 09:03:50 +0200 Subject: [PATCH 49/54] Fix setPriority `setPriority` used `$this["Priority"]` as key which should be just `"Priority"`. --- src/wdm/debian/control/StandardFile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wdm/debian/control/StandardFile.php b/src/wdm/debian/control/StandardFile.php index 253642e..641496c 100644 --- a/src/wdm/debian/control/StandardFile.php +++ b/src/wdm/debian/control/StandardFile.php @@ -68,7 +68,7 @@ class StandardFile public function setPriority($priority) { - return $this->_setProperty($this["Priority"], $priority); + return $this->_setProperty("Priority", $priority); } public function setArchitecture($arch) From c31de5be5fbadda1b692ca6e59c2e4b4132a4d24 Mon Sep 17 00:00:00 2001 From: Jan-Hendrik Frintrop Date: Tue, 18 Jul 2017 09:05:56 +0200 Subject: [PATCH 50/54] Fix setProvides Provided packages can also be a list of packages. --- src/wdm/debian/control/StandardFile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wdm/debian/control/StandardFile.php b/src/wdm/debian/control/StandardFile.php index 253642e..fd62f79 100644 --- a/src/wdm/debian/control/StandardFile.php +++ b/src/wdm/debian/control/StandardFile.php @@ -124,7 +124,7 @@ class StandardFile public function setProvides($provides) { - return $this->_setProperty("Provides", $provides); + return $this->_setProperty("Provides", $this->_transformList($provides)); } public function setDescription($description) From f02de6e4f021ea46bdb8ecaec52aa947f3e6a66e Mon Sep 17 00:00:00 2001 From: Jan-Hendrik Frintrop Date: Tue, 18 Jul 2017 09:07:36 +0200 Subject: [PATCH 51/54] Fix setReplaces `setReplaces` used `"Conflicts"` as key which should be `"Replaces"`. --- src/wdm/debian/control/StandardFile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wdm/debian/control/StandardFile.php b/src/wdm/debian/control/StandardFile.php index 253642e..47058c9 100644 --- a/src/wdm/debian/control/StandardFile.php +++ b/src/wdm/debian/control/StandardFile.php @@ -119,7 +119,7 @@ class StandardFile public function setReplaces($replaces) { - return $this->_setProperty("Conflicts", $this->_transformList($replaces)); + return $this->_setProperty("Replaces", $this->_transformList($replaces)); } public function setProvides($provides) From 9f73b61e7ea75bc8661f1c2395b9096415e65c49 Mon Sep 17 00:00:00 2001 From: Jan-Hendrik Frintrop Date: Tue, 18 Jul 2017 09:14:45 +0200 Subject: [PATCH 52/54] Fix spacing in method names Some method names were followed by spaces. --- src/wdm/debian/control/StandardFile.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wdm/debian/control/StandardFile.php b/src/wdm/debian/control/StandardFile.php index 253642e..ea2e808 100644 --- a/src/wdm/debian/control/StandardFile.php +++ b/src/wdm/debian/control/StandardFile.php @@ -149,12 +149,12 @@ class StandardFile return $this; } - public function offsetExists ($offset) + public function offsetExists($offset) { return array_key_exists($offset, $this->_keys); } - public function offsetGet ($offset) + public function offsetGet($offset) { if ($this->offsetExists($offset)) { return $this->_keys[$offset]; @@ -163,7 +163,7 @@ class StandardFile } } - public function offsetSet ($offset, $value) + public function offsetSet($offset, $value) { if (!$this->offsetExists($offset)) { throw new \InvalidArgumentException("Invalid property '{$offset}' for this control file."); @@ -171,7 +171,7 @@ class StandardFile $this->_keys[$offset] = $value; } - public function offsetUnset ($offset) + public function offsetUnset($offset) { if ($this->offsetExists($offset)) { unset($this->_keys[$offset]); From c2fa2ffd7fa791aeae33a22fbf1138e67b95d77a Mon Sep 17 00:00:00 2001 From: Jan-Hendrik Frintrop Date: Tue, 18 Jul 2017 12:06:01 +0200 Subject: [PATCH 53/54] 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 From 22b2fcf74207220c65ae57125548dfb4c55ac646 Mon Sep 17 00:00:00 2001 From: Jan-Hendrik Frintrop Date: Tue, 18 Jul 2017 12:07:15 +0200 Subject: [PATCH 54/54] Change default deb package name (#19) * Change default deb package name Changed default deb package name to `"{$name}_{$version}_{$arch}.deb"` since this is what normally would be generated. * Fix tests for default deb name The tests with default package name still expected the old version of the name. * Fixed tests Tests tried to get the Control via `$this->getControl()` which obviously failed. --- src/wdm/debian/Packager.php | 6 +++++- tests/wdm/debian/PackagerTest.php | 16 ++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/wdm/debian/Packager.php b/src/wdm/debian/Packager.php index 1eee342..b291e63 100644 --- a/src/wdm/debian/Packager.php +++ b/src/wdm/debian/Packager.php @@ -196,7 +196,11 @@ class Packager public function build($debPackageName = false) { if (!$debPackageName) { - $debPackageName = basename($this->getOutputPath() . ".deb"); + $control = $this->getControl(); + $name = $control['Package']; + $version = $control['Version']; + $arch = $control['Architecture']; + $debPackageName = "{$name}_{$version}_{$arch}.deb"; } $command = "dpkg -b {$this->getOutputPath()} {$debPackageName}"; diff --git a/tests/wdm/debian/PackagerTest.php b/tests/wdm/debian/PackagerTest.php index c10f4ca..6490775 100644 --- a/tests/wdm/debian/PackagerTest.php +++ b/tests/wdm/debian/PackagerTest.php @@ -57,8 +57,14 @@ class PackagerTest extends \PHPUnit_Framework_TestCase $this->object->run(); $command = $this->object->build(); + + $control = $this->object->getControl(); + $name = $control['Package']; + $version = $control['Version']; + $arch = $control['Architecture']; + $debPackageName = "{$name}_{$version}_{$arch}.deb"; - $this->assertEquals("dpkg -b vfs://root/tmp tmp.deb", $command); + $this->assertEquals("dpkg -b vfs://root/tmp {$debPackageName}", $command); } public function testCreateDebWhenOutputFolderIsMissing() @@ -72,8 +78,14 @@ class PackagerTest extends \PHPUnit_Framework_TestCase $this->object->run(); $command = $this->object->build(); + + $control = $this->object->getControl(); + $name = $control['Package']; + $version = $control['Version']; + $arch = $control['Architecture']; + $debPackageName = "{$name}_{$version}_{$arch}.deb"; - $this->assertEquals("dpkg -b vfs://root/tmp tmp.deb", $command); + $this->assertEquals("dpkg -b vfs://root/tmp {$debPackageName}", $command); } public function testCreateDebPackageWithAnotherName()