more pythonic and more simple as we like it to be.

This commit is contained in:
Barış Metin
2005-07-04 16:12:42 +00:00
parent e82fcf4382
commit 4d5a4ae2d9
+5 -5
View File
@@ -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)