From 0de964780997ed7212507dbc4a8ac0af1f10b14c Mon Sep 17 00:00:00 2001 From: "J. KIng" Date: Fri, 21 May 2021 22:03:40 -0400 Subject: [PATCH] Add compat file --- RoboFile.php | 18 ++++++++---------- dist/debian/compat | 1 + 2 files changed, 9 insertions(+), 10 deletions(-) create mode 100644 dist/debian/compat diff --git a/RoboFile.php b/RoboFile.php index dbffa4c..8cd5f58 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -248,29 +248,27 @@ class RoboFile extends \Robo\Tasks { /** Packages a release tarball into a Debian package */ public function packageDeb(string $tarball): Result { + $t = $this->collectionBuilder(); + $dir = $t->workDir("/home/jking/temp").\DIRECTORY_SEPARATOR; // determine the "upstream" (tagged) version - if (preg_match('/^arsse-(\d+(?:\.\d+)*)/', basename($tarball, $m))) { + if (preg_match('/^arsse-(\d+(?:\.\d+)*)/', basename($tarball), $m)) { $version = $m[1]; $base = $dir."arsse-$version"; } else { throw new \Exception("Tarball is not named correctly"); } - $t = $this->collectionBuilder(); - $dir = $t->workDir("~/temp2").\DIRECTORY_SEPARATOR; - // copy the tarball - $t->addTask($this->taskFilesystemStack()->copy($tarball, $orig)); // extract the tarball - $t->addCode(function() use ($tarball, $dir) { + $t->addCode(function() use ($tarball, $dir, $base) { // Robo's extract task is broken, so we do it manually (new \Archive_Tar($tarball))->extract($dir, false); - // "temp.orig" is a special directory name to Debian's "quilt" format - return $this->taskFilesystemStack()->rename($dir."arsse", $dir."temp.orig")->run(); + // "$package-$version.orig" is a special directory name to Debian's "quilt" format + return $this->taskFilesystemStack()->rename($dir."arsse", "$base.orig")->run(); }); // create a directory with the package name and "upstream" version; this is also special to Debian $t->addTask($this->taskFilesystemStack()->mkdir($base)); // copy relevant files to the directory - $t->addTask($this->taskFilesystemStack()->mirror($dir."temp.orig/dist", $base)); - $t->addTask($this->taskExec("deber")->dir($dir)); + $t->addTask($this->taskFilesystemStack()->mirror("$base.orig/dist", $base)); + //$t->addTask($this->taskExec("deber")->dir($dir)); return $t->run(); } diff --git a/dist/debian/compat b/dist/debian/compat new file mode 100644 index 0000000..f599e28 --- /dev/null +++ b/dist/debian/compat @@ -0,0 +1 @@ +10