diff options
author | Mykyta Holubakha <hilobakho@gmail.com> | 2017-06-22 05:20:52 +0300 |
---|---|---|
committer | Mykyta Holubakha <hilobakho@gmail.com> | 2017-06-22 05:20:52 +0300 |
commit | 6bfa49b84f7d5bcfc63b9e97938d7069c9288465 (patch) | |
tree | 7a4a39538c8643d9dc2f557e49f55a2d9c6ce8c8 /pomu/package.py | |
parent | Numerous improvements and fixes (diff) | |
download | pomu-6bfa49b84f7d5bcfc63b9e97938d7069c9288465.tar.gz pomu-6bfa49b84f7d5bcfc63b9e97938d7069c9288465.tar.bz2 pomu-6bfa49b84f7d5bcfc63b9e97938d7069c9288465.zip |
Initial manifest generation using repoman cli
Diffstat (limited to 'pomu/package.py')
-rw-r--r-- | pomu/package.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/pomu/package.py b/pomu/package.py index 7b7ec55..803320b 100644 --- a/pomu/package.py +++ b/pomu/package.py @@ -7,6 +7,8 @@ A package is supposed to be created by a package source from a set of files. from os import path, walk, makedirs from shutil import copy2 +import subprocess + from pomu.util.fs import strip_prefix from pomu.util.result import Result @@ -65,6 +67,25 @@ class Package(): return Result.Err('You do not have enough permissions') return Result.Ok() + def gen_manifests(self, dst): + """ + Generate manifests for the installed package. + TODO: use portage APIs instead of calling repoman. + """ + dirs = [x for wd, f in self.files if y.endswith('.ebuild')] + dirs = list(set(dirs)) + res = [] + for d_ in dirs: + d = path.join(dst, d) + ret = subprocess.run(['repoman', 'manifest'], + stdout=subprocess.PIPE, stderr=subprocess.PIPE, + cwd=d) + if r != 0: + return Result.Err('Failed to generate manifest at', d) + if path.exists(path.join(d, 'Manifest')): + res.append(path.join(d, 'Manifest')) + return Result.Ok(res) + def __str__(self): s = '' |