Update slackpkg ChangeLog.txt for ARM

This commit is contained in:
Dimitris Zlatanidis 2015-08-11 05:29:10 +03:00
parent 10f9e92521
commit cf0dfa9a0c

View file

@ -228,23 +228,29 @@ class Patches(object):
This replace slackpkg ChangeLog.txt file with new This replace slackpkg ChangeLog.txt file with new
from Slackware official mirrors after update distribution. from Slackware official mirrors after update distribution.
""" """
log_mirror, arch = "", ""
changelog_txt = "ChangeLog.txt" changelog_txt = "ChangeLog.txt"
changelog_old = changelog_txt + ".old" changelog_old = changelog_txt + ".old"
arch = "64" if self.meta.arch == "x86_64" else "" arch = ("64" if self.meta.arch == "x86_64" else
"arm" if self.meta.arch.startswith("arm") else "")
slackware_mirror = self.utils.read_config(self.utils.read_file( slackware_mirror = self.utils.read_config(self.utils.read_file(
self.meta.conf_path + "slackware-changelogs-mirror")) self.meta.conf_path + "slackware-changelogs-mirror"))
slackpkg_mirror = self.utils.read_config( slackpkg_mirror = self.utils.read_config(
self.utils.read_file("{0}{1}".format(self.meta.slackpkg_conf, self.utils.read_file("{0}{1}".format(self.meta.slackpkg_conf,
"mirrors"))) "mirrors")))
if slackpkg_mirror and "current" in slackpkg_mirror: if slackpkg_mirror:
log_mirror = "{0}slackware{1}-current/{2}".format(slackware_mirror, if arch.startswith("arm") and "-current" in slackpkg_mirror:
arch, log_mirror = "{0}slackware{1}-{2}/{3}".format(
changelog_txt) slackware_mirror, arch, self.meta.slack_rel, changelog_txt)
else: elif arch.startswith("arm"):
log_mirror = "{0}slackware{1}-{2}/{3}".format(slackware_mirror, log_mirror = "{0}slackware{1}-{2}/{3}".format(
arch, slackware_mirror, arch, slack_ver()[1], changelog_txt)
slack_ver(), elif "-current" in slackpkg_mirror:
changelog_txt) log_mirror = "{0}slackware{1}-{2}/{3}".format(
slackware_mirror, arch, self.meta.slack_rel, changelog_txt)
elif slackpkg_mirror:
log_mirror = "{0}slackware{1}-{2}/{3}".format(
slackware_mirror, arch, slack_ver(), changelog_txt)
slackware_log = URL(log_mirror).reading() slackware_log = URL(log_mirror).reading()
if os.path.isfile(self.meta.slackpkg_lib_path + changelog_txt): if os.path.isfile(self.meta.slackpkg_lib_path + changelog_txt):
if os.path.isfile(self.meta.slackpkg_lib_path + changelog_old): if os.path.isfile(self.meta.slackpkg_lib_path + changelog_old):
@ -252,6 +258,7 @@ class Patches(object):
shutil.copy2(self.meta.slackpkg_lib_path + changelog_txt, shutil.copy2(self.meta.slackpkg_lib_path + changelog_txt,
self.meta.slackpkg_lib_path + changelog_old) self.meta.slackpkg_lib_path + changelog_old)
os.remove(self.meta.slackpkg_lib_path + changelog_txt) os.remove(self.meta.slackpkg_lib_path + changelog_txt)
with open(self.meta.slackpkg_lib_path + changelog_txt, "w") as log: with open(self.meta.slackpkg_lib_path + changelog_txt,
"w") as log:
log.write(slackware_log) log.write(slackware_log)
log.close() log.close()