Skip to content

Commit

Permalink
Call pkgdev manifest automatically
Browse files Browse the repository at this point in the history
Signed-off-by: Michał Górny <mgorny@gentoo.org>
  • Loading branch information
mgorny committed Dec 24, 2023
1 parent 1ad618b commit b8e8960
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pycargoebuild/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import lzma
import os.path
import shutil
import subprocess
import sys
import tarfile
import tempfile
Expand Down Expand Up @@ -78,6 +79,10 @@ def main(prog_name: str, *argv: str) -> int:
action="store_true",
help="Do not include LICENSEs (e.g. when crates are "
"only used at build time")
argp.add_argument("-M", "--no-manifest",
action="store_true",
help="Do not call `pkgdev manifest` (called only if "
"Manifest exists)")
argp.add_argument("-o", "--output",
help="Ebuild file to write (default: INPUT if --input "
"is specified, {name}-{version}.ebuild otherwise)")
Expand Down Expand Up @@ -347,6 +352,12 @@ def repack_crates(tar_out: tarfile.TarFile,
raise
Path(outf.name).rename(outfile)

if not args.no_manifest and (outfile.parent / "Manifest").exists():
try:
subprocess.call(["pkgdev", "manifest"], cwd=outfile.parent)
except FileNotFoundError:
logging.warning("pkgdev not found, Manifest will not be updated")

print(f"{outfile}")
return 0

Expand Down

0 comments on commit b8e8960

Please sign in to comment.