diff options
author | Mykyta Holubakha <hilobakho@gmail.com> | 2019-06-09 03:43:02 +0300 |
---|---|---|
committer | Mykyta Holubakha <hilobakho@gmail.com> | 2019-06-09 03:43:02 +0300 |
commit | 8dfb6d113a0f4435ab49400be0c9e9760fb110b8 (patch) | |
tree | 7ac39b85dc1ea42b9dcf1a358ec3b3c83c8e96a1 /pomu/repo | |
parent | Some more minor fixes and improvements (diff) | |
download | pomu-8dfb6d113a0f4435ab49400be0c9e9760fb110b8.tar.gz pomu-8dfb6d113a0f4435ab49400be0c9e9760fb110b8.tar.bz2 pomu-8dfb6d113a0f4435ab49400be0c9e9760fb110b8.zip |
Ensure show works with portage
Diffstat (limited to 'pomu/repo')
-rw-r--r-- | pomu/repo/repo.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pomu/repo/repo.py b/pomu/repo/repo.py index db6b607..9b17776 100644 --- a/pomu/repo/repo.py +++ b/pomu/repo/repo.py @@ -129,6 +129,9 @@ class Repository(): with open(path.join(pkgdir, 'BACKEND'), 'r') as f: bname = f.readline().strip() backend = dispatcher.backends[bname].from_meta_dir(pkgdir) + if backend.is_err(): + return backend + backend = backend.ok() with open(path.join(pkgdir, 'VERSION'), 'r') as f: version = f.readline().strip() with open(path.join(pkgdir, 'FILES'), 'r') as f: @@ -139,7 +142,7 @@ class Repository(): patches = [x.strip() for x in f] pkg = Package(name, self.root, backend, category=category, version=version, slot=slot, files=files, patches=[path.join(pkgdir, 'patches', x) for x in patches]) pkg.__class__ = MergedPackage - return pkg + return Result.Ok(pkg) def get_package(self, name, category=None, slot=None): """Get a package by name, category and slot""" @@ -150,7 +153,7 @@ class Repository(): nam, _, slo = nam.partition(':') if (not category or category == cat) and nam == name: if not slot or (slot == '0' and not slo) or slot == slo: - return Result.Ok(self._get_package(category, name, slot or '0')) + return self._get_package(category, name, slot or '0') return Result.Err('Package not found') def get_packages(self): |