aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMykyta Holubakha <hilobakho@gmail.com>2017-07-05 20:53:10 +0300
committerMykyta Holubakha <hilobakho@gmail.com>2017-07-05 20:53:10 +0300
commit89ea936652960049bf6ad307df83f52733819683 (patch)
tree13a6d07b3a27d0e31bbe7dd63a2b6a1fc189c31a /pomu/source
parentAdded the manpage (diff)
downloadpomu-89ea936652960049bf6ad307df83f52733819683.tar.gz
pomu-89ea936652960049bf6ad307df83f52733819683.tar.bz2
pomu-89ea936652960049bf6ad307df83f52733819683.zip
Some fixes
Diffstat (limited to 'pomu/source')
-rw-r--r--pomu/source/file.py10
-rw-r--r--pomu/source/portage.py6
2 files changed, 10 insertions, 6 deletions
diff --git a/pomu/source/file.py b/pomu/source/file.py
index ffd7c07..f42474d 100644
--- a/pomu/source/file.py
+++ b/pomu/source/file.py
@@ -31,8 +31,8 @@ class LocalEbuild():
) : self.path})
@staticmethod
- def from_data_file(path):
- with open(path, 'r') as f:
+ def from_data_dir(pkgdir):
+ with open(path.join(pkgdir, 'FS_ORIG_PATH'), 'r') as f:
return LocalEbuildSource.parse_ebuild_path(f.readline()).unwrap()
def write_meta(self, pkgdir):
@@ -66,4 +66,8 @@ class LocalEbuildSource():
def parse_full(uri):
if not uri.startswith('fs:'):
return Result.Err()
- return LocalEbuildSource.parse_ebuild_path(uri)
+ return LocalEbuildSource.parse_ebuild_path(uri[3:])
+
+ @classmethod
+ def from_meta_dir(cls, metadir):
+ return LocalEbuild.from_data_dir(cls, metadir)
diff --git a/pomu/source/portage.py b/pomu/source/portage.py
index 1dc740b..f4f112c 100644
--- a/pomu/source/portage.py
+++ b/pomu/source/portage.py
@@ -39,9 +39,9 @@ class PortagePackage():
f.write(self.slot + '\n')
@staticmethod
- def from_data_file(path):
+ def from_data_dir(pkgdir):
try:
- lines = [x.strip() for x in open(path, 'r')]
+ lines = [x.strip() for x in open(path.join(pkgdir, 'PORTAGE_DATA'), 'r')]
except:
return Result.Err('Could not read data file')
if len(lines) < 5:
@@ -125,7 +125,7 @@ class PortageSource():
@classmethod
def from_meta_dir(cls, metadir):
- return PortagePackage.from_data_dir(cls, path.join(metadir, 'PORTAGE_DATA'))
+ return PortagePackage.from_data_dir(cls, metadir)
def sanity_check(repo, category, name, vernum, suff, rev, slot, ver=None):