enable translations.xml support with fetcher support
This commit is contained in:
+11
-4
@@ -128,6 +128,8 @@ class Builder:
|
||||
else:
|
||||
self.specdir = os.path.dirname(self.specuri.get_uri())
|
||||
|
||||
self.read_translations(self.specdir)
|
||||
|
||||
self.sourceArchive = pisi.sourcearchive.SourceArchive(self.spec, self.pkg_work_dir())
|
||||
|
||||
self.set_environment_vars()
|
||||
@@ -141,12 +143,12 @@ class Builder:
|
||||
specuri = pisi.uri.URI(os.path.realpath(specuri.get_uri())) # FIXME: doesn't work for file://
|
||||
self.specuri = specuri
|
||||
spec = pisi.specfile.SpecFile()
|
||||
spec.read(specuri, ctx.config.tmp_dir())
|
||||
# spec.read(self.specuri, ctx.config.tmp_dir())
|
||||
# diruri = os.path.dirname(self.specuri.get_uri())
|
||||
# spec.read_translations(pisi.util.join_path(diruri, "translations.xml"))
|
||||
spec.read(self.specuri, ctx.config.tmp_dir())
|
||||
self.spec = spec
|
||||
|
||||
def read_translations(self, specdir):
|
||||
self.spec.read_translations(pisi.util.join_path(specdir, ctx.const.translations_file))
|
||||
|
||||
# directory accessor functions
|
||||
|
||||
# pkg_x_dir: per package directory for storing info type x
|
||||
@@ -239,6 +241,7 @@ class Builder:
|
||||
#self.location = os.path.dirname(self.url.uri)
|
||||
|
||||
self.fetch_actionsfile()
|
||||
self.fetch_translationsfile()
|
||||
self.fetch_patches()
|
||||
self.fetch_comarfiles()
|
||||
self.fetch_additionalFiles()
|
||||
@@ -249,6 +252,10 @@ class Builder:
|
||||
actionsuri = pisi.util.join_path(self.specdiruri, ctx.const.actions_file)
|
||||
self.download(actionsuri, self.destdir)
|
||||
|
||||
def fetch_translationsfile(self):
|
||||
translationsuri = pisi.util.join_path(self.specdiruri, ctx.const.translations_file)
|
||||
self.download(translationsuri, self.destdir)
|
||||
|
||||
def fetch_patches(self):
|
||||
spec = self.spec
|
||||
for patch in spec.source.patches:
|
||||
|
||||
@@ -73,6 +73,7 @@ class Constants:
|
||||
self.__c.actions_file = "actions.py"
|
||||
self.__c.files_dir = "files"
|
||||
self.__c.metadata_dir = "metadata"
|
||||
self.__c.translations_file = "translations.xml"
|
||||
self.__c.comar_dir = "comar"
|
||||
self.__c.files_xml = "files.xml"
|
||||
self.__c.metadata_xml = "metadata.xml"
|
||||
|
||||
Reference in New Issue
Block a user