From d51fe13dd0f0dbb33b0587fc1cc388c21818c554 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=2E=C3=87a=C4=9Flar=20Onur?= Date: Tue, 21 Jun 2005 21:27:16 +0000 Subject: [PATCH] =?UTF-8?q?WorkDir=20isminde=20bir=20tag=20daha=20ekleyeli?= =?UTF-8?q?m=20spec=20dosyas=C4=B1na=20[=20ismi=20ne=20olursa=20ya=20da=20?= =?UTF-8?q?],=20set=20edilmi=C5=9Fse=20kaynak=20paketten=20=C3=A7=C4=B1kan?= =?UTF-8?q?=20kals=C3=B6r=20ismi=20olarak=20o=20kullan=C4=B1lsun=20(=20kio?= =?UTF-8?q?=5Fslp-1=5F5=20gibi=20)=20edilmemi=C5=9Fse=20paketismi-versiyon?= =?UTF-8?q?=20kullan=C4=B1ls=C4=B1n.=20Elimizdeki=20depoda=20buna=20uymaya?= =?UTF-8?q?n=20paket=20yok?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pisi/build.py | 6 +----- pisi/context.py | 8 +++++++- pisi/specfile.py | 1 + 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/pisi/build.py b/pisi/build.py index d3401cab..e72eb839 100644 --- a/pisi/build.py +++ b/pisi/build.py @@ -53,11 +53,7 @@ class PisiBuild: #finished its work in the work_dir curDir = os.getcwd() - # FIXME: It's wrong to assume that unpacked archive - # will create a name-version top-level directory. - # Archive module should give the exact location. - # (from the assumption is evil dept.) - os.chdir(self.ctx.pkg_work_dir() + "/" + self.spec.source.name + "-" + self.spec.source.version) + os.chdir(self.ctx.pkg_src_dir()) locals = globals = {} try: diff --git a/pisi/context.py b/pisi/context.py index 81948a60..836d6198 100644 --- a/pisi/context.py +++ b/pisi/context.py @@ -76,7 +76,13 @@ class Context(object): return self.destdir + self.const.tmp_dir_suffix \ + '/' + packageDir - + + def pkg_src_dir(self): + if self.spec.source.workdir is None: + return self.pkg_work_dir() + '/' + self.spec.source.name + '-' + self.spec.source.version + else: + return self.pkg_work_dir() + '/' + self.spec.source.workdir + def pkg_work_dir(self): return self.pkg_dir() + self.const.work_dir_suffix diff --git a/pisi/specfile.py b/pisi/specfile.py index 31c09beb..14a01c9f 100644 --- a/pisi/specfile.py +++ b/pisi/specfile.py @@ -60,6 +60,7 @@ class SpecFile(XmlFile): self.source = SourceInfo() self.source.name = self.getChildText("Source/Name") + self.source.workdir = self.getChildText("Source/WorkDir") archiveNode = self.getNode("Source/Archive") self.source.archiveUri = getNodeText(archiveNode).strip() self.source.archiveName = basename(self.source.archiveUri)