Add target attribute to Archive tag. It can be used to extract the archive into a sub-directory.
This commit is contained in:
@@ -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*)>
|
||||
|
||||
|
||||
@@ -1309,6 +1309,9 @@
|
||||
<value>binary</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
<optional>
|
||||
<attribute name="target"/>
|
||||
</optional>
|
||||
</group>
|
||||
</define>
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user