fix: restore tar fallback when makepkg is not available

Commit 32f04ae removed the tar fallback in Tgz::build(), requiring
/sbin/makepkg (Slackware-specific) for --to-tgz conversion. This broke
alien on all non-Slackware systems.

Restore the fallback using the same method as the original makepkg
script.

Fixes: https://github.com/Project-OSS-Revival/alien/issues/4
This commit is contained in:
Anton Farygin
2025-12-23 11:50:04 +03:00
committed by Syed Shahrukh Hussain
parent 04a9c4fa04
commit 8bba6dfdc5

View File

@@ -489,7 +489,10 @@ sub build {
$Alien::Package::verbose=$v;
}
else {
die "Sorry, I cannot generate the .tgz file because /sbin/makepkg is not present.\n"
# Fallback to plain tar when makepkg is not available
# Use same method as makepkg: strip ./ prefix via sed to match Slackware format
$this->do("cd ".$this->unpacked_tree."; find ./ | LC_COLLATE=C sort | sed '2,\$s,^\\./,,' | tar --no-recursion -T - -czf ../$tgz")
or die "Package build failed";
}
return $tgz;
}