Bugfix slack repo #122

This commit is contained in:
Dimitris Zlatanidis 2020-02-13 19:57:25 +01:00
parent 28ff31ac29
commit 90a5649ad5
3 changed files with 40 additions and 23 deletions

View file

@ -1,3 +1,8 @@
3.8.1 - 13/02/2020
FIxed:
- Bugfix double install packages from slack regular repo
and patches directory #122
3.8.0 - 05/02/2020
Added:
- Many changes happen in this version, a big part of code has been rewritten

View file

@ -38,6 +38,7 @@ def repo_data(PACKAGES_TXT, repo, flag):
for line in PACKAGES_TXT.splitlines():
if _meta_.rsl_deps in ["on", "ON"] and "--resolve-off" not in flag:
status(0.000005)
if line.startswith("PACKAGE NAME:"):
name.append(line[15:].strip())
if line.startswith("PACKAGE LOCATION:"):
@ -46,7 +47,14 @@ def repo_data(PACKAGES_TXT, repo, flag):
size.append(line[28:-2].strip())
if line.startswith("PACKAGE SIZE (uncompressed):"):
unsize.append(line[30:-2].strip())
if repo == "rlw":
if repo == "slack":
(rname,
rlocation,
rsize,
runsize
) = slack_filter(name, location, size, unsize, flag)
elif repo == "rlw":
(rname,
rlocation,
rsize,
@ -75,6 +83,30 @@ def repo_data(PACKAGES_TXT, repo, flag):
return [rname, rlocation, rsize, runsize]
def slack_filter(name, location, size, unsize, flag):
"""Slackware filter seperate packages from patches/ directory
"""
(fname, flocation, fsize, funsize) = ([] for i in range(4))
if "--patches" not in flag:
for n, l, s, u in zip(name, location, size, unsize):
if f"_slack{slack_ver()}" not in n:
fname.append(n)
flocation.append(l)
fsize.append(s)
funsize.append(u)
if "--patches" in flag:
for n, l, s, u in zip(name, location, size, unsize):
if f"_slack{slack_ver()}" in n:
fname.append(n)
flocation.append(l)
fsize.append(s)
funsize.append(u)
return [fname, flocation, fsize, funsize]
def rlw_filter(name, location, size, unsize):
"""Filter rlw repository data
"""

View file

@ -331,6 +331,7 @@ class BinaryInstall:
install.append(pk)
comp_sum.append(comp)
uncomp_sum.append(uncomp)
if not install:
for pkg in packages:
for pk, loc, comp, uncomp in zip(self.data[0], self.data[1],
@ -346,26 +347,5 @@ class BinaryInstall:
install.reverse()
comp_sum.reverse()
uncomp_sum.reverse()
if self.repo == "slack":
dwn, install, comp_sum, uncomp_sum = self.patches(dwn, install,
comp_sum,
uncomp_sum)
return [dwn, install, comp_sum, uncomp_sum]
def patches(self, dwn, install, comp_sum, uncomp_sum):
"""Seperates packages from patches/ directory
"""
dwnp, installp, comp_sump, uncomp_sump = ([] for i in range(4))
for d, i, c, u in zip(dwn, install, comp_sum, uncomp_sum):
if "_slack" + slack_ver() in i:
dwnp.append(d)
dwn.remove(d)
installp.append(i)
install.remove(i)
comp_sump.append(c)
comp_sum.remove(c)
uncomp_sump.append(u)
uncomp_sum.remove(u)
if "--patches" in self.flag:
return dwnp, installp, comp_sump, uncomp_sump
return dwn, install, comp_sum, uncomp_sum
return [dwn, install, comp_sum, uncomp_sum]