mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2024-12-22 13:12:41 +00:00
Add compat file
This commit is contained in:
parent
e653fb3f73
commit
0de9647809
2 changed files with 9 additions and 10 deletions
18
RoboFile.php
18
RoboFile.php
|
@ -248,29 +248,27 @@ class RoboFile extends \Robo\Tasks {
|
||||||
|
|
||||||
/** Packages a release tarball into a Debian package */
|
/** Packages a release tarball into a Debian package */
|
||||||
public function packageDeb(string $tarball): Result {
|
public function packageDeb(string $tarball): Result {
|
||||||
|
$t = $this->collectionBuilder();
|
||||||
|
$dir = $t->workDir("/home/jking/temp").\DIRECTORY_SEPARATOR;
|
||||||
// determine the "upstream" (tagged) version
|
// 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];
|
$version = $m[1];
|
||||||
$base = $dir."arsse-$version";
|
$base = $dir."arsse-$version";
|
||||||
} else {
|
} else {
|
||||||
throw new \Exception("Tarball is not named correctly");
|
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
|
// 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
|
// Robo's extract task is broken, so we do it manually
|
||||||
(new \Archive_Tar($tarball))->extract($dir, false);
|
(new \Archive_Tar($tarball))->extract($dir, false);
|
||||||
// "temp.orig" is a special directory name to Debian's "quilt" format
|
// "$package-$version.orig" is a special directory name to Debian's "quilt" format
|
||||||
return $this->taskFilesystemStack()->rename($dir."arsse", $dir."temp.orig")->run();
|
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
|
// create a directory with the package name and "upstream" version; this is also special to Debian
|
||||||
$t->addTask($this->taskFilesystemStack()->mkdir($base));
|
$t->addTask($this->taskFilesystemStack()->mkdir($base));
|
||||||
// copy relevant files to the directory
|
// copy relevant files to the directory
|
||||||
$t->addTask($this->taskFilesystemStack()->mirror($dir."temp.orig/dist", $base));
|
$t->addTask($this->taskFilesystemStack()->mirror("$base.orig/dist", $base));
|
||||||
$t->addTask($this->taskExec("deber")->dir($dir));
|
//$t->addTask($this->taskExec("deber")->dir($dir));
|
||||||
return $t->run();
|
return $t->run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
1
dist/debian/compat
vendored
Normal file
1
dist/debian/compat
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
10
|
Loading…
Reference in a new issue