Add target attribute to Archive tag. It can be used to extract the archive into a sub-directory.

This commit is contained in:
Fatih Aşıcı
2010-02-20 20:42:20 +00:00
parent 4996e645fc
commit f394699f19
4 changed files with 7 additions and 1 deletions
+1
View File
@@ -50,6 +50,7 @@
<!ATTLIST Archive sha1sum CDATA #REQUIRED>
<!-- NOTE: we can limit possible types here to the ones that pisi know -->
<!ATTLIST Archive type CDATA #REQUIRED>
<!ATTLIST Archive target CDATA #IMPLIED>
<!ELEMENT BuildDependencies (Dependency*)>
+3
View File
@@ -1309,6 +1309,9 @@
<value>binary</value>
</choice>
</attribute>
<optional>
<attribute name="target"/>
</optional>
</group>
</define>
+2 -1
View File
@@ -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)
+1
View File
@@ -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)