more pythonic and more simple as we like it to be.
This commit is contained in:
+5
-5
@@ -145,12 +145,12 @@ class PisiBuild:
|
|||||||
def pkgSrcDir(self):
|
def pkgSrcDir(self):
|
||||||
"""Returns the real path of WorkDir for an unpacked archive."""
|
"""Returns the real path of WorkDir for an unpacked archive."""
|
||||||
join = os.path.join
|
join = os.path.join
|
||||||
if 'WorkDir' in self.actionGlobals:
|
try:
|
||||||
path = join(self.ctx.pkg_work_dir(),self.actionGlobals['WorkDir'])
|
srcdir = self.actionGlobals['WorkDir']
|
||||||
else:
|
except KeyError:
|
||||||
path = join(self.ctx.pkg_work_dir(),
|
srcdir = self.spec.source.name + "-" + self.spec.source.version
|
||||||
self.spec.source.name + "-" + self.spec.source.version)
|
|
||||||
|
|
||||||
|
path = join(self.ctx.pkg_work_dir(), srcdir)
|
||||||
if not os.path.exists(path):
|
if not os.path.exists(path):
|
||||||
ui.error ("No such file or directory: %s\n" % e)
|
ui.error ("No such file or directory: %s\n" % e)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|||||||
Reference in New Issue
Block a user