From f394699f199450ccf18e927e8464ccbcdad2d5af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fatih=20A=C5=9F=C4=B1c=C4=B1?= Date: Sat, 20 Feb 2010 20:42:20 +0000 Subject: [PATCH] Add target attribute to Archive tag. It can be used to extract the archive into a sub-directory. --- pisi-spec.dtd | 1 + pisi-spec.rng | 3 +++ pisi/sourcearchive.py | 3 ++- pisi/specfile.py | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pisi-spec.dtd b/pisi-spec.dtd index cf677201..d1892176 100644 --- a/pisi-spec.dtd +++ b/pisi-spec.dtd @@ -50,6 +50,7 @@ + diff --git a/pisi-spec.rng b/pisi-spec.rng index 29e5f4dc..6c1e5f51 100644 --- a/pisi-spec.rng +++ b/pisi-spec.rng @@ -1309,6 +1309,9 @@ binary + + + diff --git a/pisi/sourcearchive.py b/pisi/sourcearchive.py index 6b681d75..7e989277 100644 --- a/pisi/sourcearchive.py +++ b/pisi/sourcearchive.py @@ -120,4 +120,5 @@ class SourceArchive: raise Error, _("unpack: check_file_hash failed") archive = pisi.archive.Archive(self.archiveFile, self.archive.type) - archive.unpack(self.pkg_work_dir, clean_dir) + target_dir = os.path.join(self.pkg_work_dir, self.archive.target or "") + archive.unpack(target_dir, clean_dir) diff --git a/pisi/specfile.py b/pisi/specfile.py index 711dbf0d..1574f9d8 100644 --- a/pisi/specfile.py +++ b/pisi/specfile.py @@ -151,6 +151,7 @@ class Archive: s_uri = [ autoxml.String, autoxml.mandatory ] a_type = [ autoxml.String, autoxml.mandatory ] a_sha1sum =[ autoxml.String, autoxml.mandatory ] + a_target =[ autoxml.String, autoxml.optional ] def decode_hook(self, node, errs, where): self.name = os.path.basename(self.uri)