added salix repository

This commit is contained in:
Dimitris Zlatanidis 2014-12-25 18:40:30 +02:00
parent db35b68213
commit 1f34e1c1b3
8 changed files with 76 additions and 55 deletions

View file

@ -46,7 +46,8 @@ repositories = [
'slonly',
'ktown{latest}',
'multi',
'slacke{18}'
'slacke{18}',
'salix'
]

View file

@ -341,7 +341,7 @@ class Initialization(object):
def slacke(self):
'''
Creating alien multilib local library
Creating Slacke local library
'''
ar = ""
arch = os.uname()[4]
@ -373,6 +373,35 @@ class Initialization(object):
self.remote(log, log_file, changelog_txt, lib, lib_file, packages_txt,
md5_file, checksums_md5, lst_file, filelist_txt)
def salix(self):
'''
Creating SalixOS local library
'''
ar = "i486"
arch = os.uname()[4]
repo = Repo().salix()
log = log_path + "salix/"
lib = lib_path + "salix_repo/"
lib_file = "PACKAGES.TXT"
lst_file = ""
md5_file = "CHECKSUMS.md5"
log_file = "ChangeLog.txt"
if not os.path.exists(log):
os.mkdir(log)
if not os.path.exists(lib):
os.mkdir(lib)
if arch == "x86_64":
ar = "x86_64"
packages_txt = "{0}{1}/{2}/{3}".format(repo, ar, slack_ver(), lib_file)
filelist_txt = ""
checksums_md5 = "{0}{1}/{2}/{3}".format(repo, ar, slack_ver(), md5_file)
changelog_txt = "{0}{1}/{2}/{3}".format(repo, ar, slack_ver(), log_file)
self.write(lib, lib_file, packages_txt)
self.write(lib, md5_file, checksums_md5)
self.write(log, log_file, changelog_txt)
self.remote(log, log_file, changelog_txt, lib, lib_file, packages_txt,
md5_file, checksums_md5, lst_file, filelist_txt)
@staticmethod
def write(path, data_file, file_url):
'''
@ -489,7 +518,8 @@ class Update(object):
'slonly': Initialization().slackonly,
'ktown': Initialization().ktown,
'multi': Initialization().multi,
'slacke': Initialization().slacke
'slacke': Initialization().slacke,
'salix': Initialization().salix
}
def repository(self):

View file

@ -99,6 +99,9 @@ class Case(object):
def slacke_install(self):
OthersInstall(self.package, "slacke", self.release).start()
def salix_install(self):
OthersInstall(self.package, "salix", self.release).start()
def sbo_upgrade(self):
SBoCheck().start()
@ -211,7 +214,8 @@ def main():
'slonly': pkg.slackonly_install,
'ktown': pkg.ktown_install,
'multi': pkg.multi_install,
'slacke': pkg.slacke_install
'slacke': pkg.slacke_install,
'salix': pkg.salix_install
}
if args[1] in repositories:
install[args[1]]()

View file

@ -77,7 +77,7 @@ def repo_data(PACKAGES_TXT, step, repo, version):
rsize,
runsize
) = multi_filter(name, location, size, unsize, version)
elif repo in ["slacky", "studio", "slackr", "slonly", "slacke"]:
elif repo in ["slacky", "studio", "slackr", "slonly", "slacke", "salix"]:
rname, rlocation, rsize, runsize = name, location, size, unsize
return [rname, rlocation, rsize, runsize]
@ -186,11 +186,12 @@ class Requires(object):
'''
Grap package requirements from repositories
'''
if self.repo in ["alien", "slacky", "slackr"]:
if self.repo in ["alien", "slacky", "slackr", "salix"]:
lib = {
'alien': lib_path + 'alien_repo/PACKAGES.TXT',
'slacky': lib_path + 'slacky_repo/PACKAGES.TXT',
'slackr': lib_path + 'slackr_repo/PACKAGES.TXT'
'slackr': lib_path + 'slackr_repo/PACKAGES.TXT',
'salix': lib_path + 'salix_repo/PACKAGES.TXT'
}
f = open(lib[self.repo], "r")
PACKAGES_TXT = f.read()
@ -205,8 +206,8 @@ class Requires(object):
if line.startswith("PACKAGE REQUIRED: "):
if pkg_name == self.name:
if line[17:].strip():
if self.repo == "slacky":
return self.slacky_req_fix(line)
if self.repo in ["slacky", "salix"]:
return self._req_fix(line)
elif self.repo == "alien":
return line[18:].strip().split(",")
else:
@ -228,17 +229,17 @@ class Requires(object):
else:
return ""
def slacky_req_fix(self, line):
def _req_fix(self, line):
'''
Fix slacky requirements because many dependencies splitting
Fix slacky and salix requirements because many dependencies splitting
with ',' and others with '|'
'''
slacky_deps = []
deps = []
for dep in line[18:].strip().split(","):
dep = dep.split("|")
if len(dep) > 1:
for d in dep:
slacky_deps.append(d.split()[0])
deps.append(d.split()[0])
dep = "".join(dep)
slacky_deps.append(dep.split()[0])
return slacky_deps
deps.append(dep.split()[0])
return deps

View file

@ -77,7 +77,8 @@ class OthersInstall(object):
'slonly': self._init_slonly,
'ktown': self._init_ktown,
'multi': self._init_multi,
'slacke': self._init_slacke
'slacke': self._init_slacke,
'salix': self._init_salix
}
init_repos[self.repo]()
@ -147,6 +148,14 @@ class OthersInstall(object):
Repo().slacke(), slacke_sub_repo[1:-1], arch, slack_ver())
self.step = self.step * 2
def _init_salix(self):
arch = "i486"
if os.uname()[4] == "x86_64":
arch = "x86_64"
self.lib = lib_path + "salix_repo/PACKAGES.TXT"
self.mirror = "{0}{1}/{2}/".format(Repo().salix(), arch, slack_ver())
self.step = self.step * 2
def start(self):
'''
Install packages from official Slackware distribution
@ -255,7 +264,8 @@ def views(install_all, comp_sum, repository, dependencies):
'slonly': '',
'ktown': ' ',
'multi': ' ',
'slacke': ''
'slacke': '',
'salix': ' '
}
repository += align[repository]
for pkg, comp in zip(install_all, comp_sum):

View file

@ -46,7 +46,8 @@ class RepoList(object):
'slonly': Repo().slackonly(),
'ktown': Repo().ktown(),
'multi': Repo().multi(),
'slacke': Repo().slacke()
'slacke': Repo().slacke(),
'salix': Repo().salix()
}
def repos(self):

View file

@ -104,3 +104,9 @@ class Repo(object):
Slacke slacke{17|18} repository
'''
return "http://ngc891.blogdns.net/pub/"
def salix(self):
'''
SalixOS salix repository
'''
return "http://download.salixos.org/"

View file

@ -21,8 +21,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from slack.slack_version import slack_ver
def split_package(package):
'''
@ -30,43 +28,13 @@ def split_package(package):
arch and build tag.
'''
split = package.split("-")
sbo = "_SBo"
slack = "_slack{0}".format(slack_ver())
rlw = "_rlw"
alien = "alien"
slacky = "sl"
studio = "se"
slackr = "cf"
slonly = "_slack"
# ktown = alien
# multi = alien
compat = "compat32"
slacke = "jp"
build = split[-1]
build_a, build_b = '', ''
build_a = build[:1]
if build[1:2].isdigit():
build_b = build[1:2]
if build.endswith(sbo):
build = split[-1][:-4] # and remove .t?z extension
if build.endswith(slack):
build = split[-1][:-len(slack)]
elif build.endswith(rlw):
build = split[-1][:-len(rlw)]
elif build.endswith(alien):
build = split[-1][:-len(alien)]
elif build.endswith(slacky):
build = split[-1][:-len(slacky)]
elif build.endswith(studio):
build = split[-1][:-len(studio)]
elif build.endswith(slackr):
build = split[-1][:-len(slackr)]
elif build.endswith(slonly):
build = split[-1][:-len(slonly)]
elif (slack + compat) in build:
build = split[-1][:-len(slack + compat)]
elif build.endswith(compat):
build = split[-1][:-len(compat)]
elif build.endswith(slacke):
build = split[-1][:-len(slacke)]
build = build_a + build_b
arch = split[-2]
ver = split[-3]
name = "-".join(split[:-3])