Update default repositories

This commit is contained in:
Dimitris Zlatanidis 2015-09-23 11:11:29 +03:00
parent 4241fd7510
commit 9e09de72d3
5 changed files with 42 additions and 120 deletions

View file

@ -38,6 +38,7 @@ class RepoInit(object):
def __init__(self, repo): def __init__(self, repo):
self.repo = repo self.repo = repo
self.meta = _meta_ self.meta = _meta_
self.def_repo_dict = Repo().default_repository()
self.mirror = "" self.mirror = ""
def fetch(self): def fetch(self):
@ -57,7 +58,7 @@ class RepoInit(object):
self.mirror = mirrors(name="", location="") self.mirror = mirrors(name="", location="")
def _init_rlw(self): def _init_rlw(self):
self.mirror = "{0}{1}/".format(Repo().rlw(), slack_ver()) self.mirror = "{0}{1}/".format(self.def_repo_dict["rlw"], slack_ver())
def _init_alien(self): def _init_alien(self):
ver = slack_ver() ver = slack_ver()
@ -66,21 +67,22 @@ class RepoInit(object):
arch = "x86_64" arch = "x86_64"
if self.meta.slack_rel == "current": if self.meta.slack_rel == "current":
ver = self.meta.slack_rel ver = self.meta.slack_rel
self.mirror = "{0}{1}/{2}/".format(Repo().alien(), ver, arch) self.mirror = "{0}{1}/{2}/".format(self.def_repo_dict["alien"],
ver, arch)
def _init_slacky(self): def _init_slacky(self):
arch = "" arch = ""
if self.meta.arch == "x86_64": if self.meta.arch == "x86_64":
arch = "64" arch = "64"
self.mirror = "{0}slackware{1}-{2}/".format(Repo().slacky(), arch, self.mirror = "{0}slackware{1}-{2}/".format(
slack_ver()) self.def_repo_dict["slacky"], arch, slack_ver())
def _init_studio(self): def _init_studio(self):
arch = "" arch = ""
if self.meta.arch == "x86_64": if self.meta.arch == "x86_64":
arch = "64" arch = "64"
self.mirror = "{0}slackware{1}-{2}/".format(Repo().studioware(), self.mirror = "{0}slackware{1}-{2}/".format(
arch, slack_ver()) self.def_repo_dict["studio"], arch, slack_ver())
def _init_slackr(self): def _init_slackr(self):
self.mirror = Repo().slackers() self.mirror = Repo().slackers()
@ -92,35 +94,38 @@ class RepoInit(object):
arch = "{0}-x86_64".format(ver) arch = "{0}-x86_64".format(ver)
if self.meta.slack_rel == "current": if self.meta.slack_rel == "current":
arch = "{0}-x86_64".format(self.meta.slack_rel) arch = "{0}-x86_64".format(self.meta.slack_rel)
self.mirror = "{0}{1}/".format(Repo().slackonly(), arch) self.mirror = "{0}{1}/".format(self.def_repo_dict["slonly"], arch)
def _init_ktown(self): def _init_ktown(self):
self.mirror = Repo().ktown() self.mirror = self.def_repo_dict["ktown"]
def _init_multi(self): def _init_multi(self):
ver = slack_ver() ver = slack_ver()
if self.meta.slack_rel == "current": if self.meta.slack_rel == "current":
ver = self.meta.slack_rel ver = self.meta.slack_rel
self.mirror = Repo().multi() + ver + "/" self.mirror = self.def_repo_dict["multi"] + ver + "/"
def _init_slacke(self): def _init_slacke(self):
arch = "" arch = ""
if self.meta.arch == "x86_64": if self.meta.arch == "x86_64":
arch = "64" arch = "64"
self.mirror = "{0}slacke{1}/slackware{2}-{3}/".format( self.mirror = "{0}slacke{1}/slackware{2}-{3}/".format(
Repo().slacke(), self.meta.slacke_sub_repo[1:-1], arch, slack_ver()) self.def_repo_dict["slacke"], self.meta.slacke_sub_repo[1:-1],
arch, slack_ver())
def _init_salix(self): def _init_salix(self):
arch = "i486" arch = "i486"
if self.meta.arch == "x86_64": if self.meta.arch == "x86_64":
arch = "x86_64" arch = "x86_64"
self.mirror = "{0}{1}/{2}/".format(Repo().salix(), arch, slack_ver()) self.mirror = "{0}{1}/{2}/".format(self.def_repo_dict["salix"],
arch, slack_ver())
def _init_slackl(self): def _init_slackl(self):
arch = "i486" arch = "i486"
if self.meta.arch == "x86_64": if self.meta.arch == "x86_64":
arch = "x86_64" arch = "x86_64"
self.mirror = "{0}{1}/current/".format(Repo().slackel(), arch) self.mirror = "{0}{1}/current/".format(self.def_repo_dict["slackl"],
arch)
def _init_rested(self): def _init_rested(self):
self.mirror = Repo().restricted() self.mirror = Repo().restricted()
@ -130,4 +135,5 @@ class RepoInit(object):
if self.meta.arch == "x86_64": if self.meta.arch == "x86_64":
arch = "x86_64" arch = "x86_64"
self.mirror = "{0}{1}/{2}/{3}/".format( self.mirror = "{0}{1}/{2}/{3}/".format(
Repo().msb(), slack_ver(), self.meta.msb_sub_repo[1:-1], arch) self.def_repo_dict["msb"], slack_ver(),
self.meta.msb_sub_repo[1:-1], arch)

View file

@ -42,6 +42,7 @@ class Initialization(object):
def __init__(self, check): def __init__(self, check):
self.check = check self.check = check
self.meta = _meta_ self.meta = _meta_
self.def_repos_dict = Repo().default_repository()
self.conf_path = self.meta.conf_path self.conf_path = self.meta.conf_path
self.log_path = self.meta.log_path self.log_path = self.meta.log_path
self.lib_path = self.meta.lib_path self.lib_path = self.meta.lib_path
@ -139,7 +140,7 @@ class Initialization(object):
def sbo(self): def sbo(self):
"""Creating sbo local library """Creating sbo local library
""" """
repo = Repo().sbo() repo = self.def_repos_dict["sbo"]
log = self.log_path + "sbo/" log = self.log_path + "sbo/"
lib = self.lib_path + "sbo_repo/" lib = self.lib_path + "sbo_repo/"
repo_name = log[:-1].split("/")[-1] repo_name = log[:-1].split("/")[-1]
@ -165,7 +166,7 @@ class Initialization(object):
def rlw(self): def rlw(self):
"""Creating rlw local library """Creating rlw local library
""" """
repo = Repo().rlw() repo = self.def_repos_dict["rlw"]
log = self.log_path + "rlw/" log = self.log_path + "rlw/"
lib = self.lib_path + "rlw_repo/" lib = self.lib_path + "rlw_repo/"
repo_name = log[:-1].split("/")[-1] repo_name = log[:-1].split("/")[-1]
@ -195,7 +196,7 @@ class Initialization(object):
ar = "x86" ar = "x86"
ver = slack_ver() ver = slack_ver()
arch = self.meta.arch arch = self.meta.arch
repo = Repo().alien() repo = self.def_repos_dict["alien"]
log = self.log_path + "alien/" log = self.log_path + "alien/"
lib = self.lib_path + "alien_repo/" lib = self.lib_path + "alien_repo/"
repo_name = log[:-1].split("/")[-1] repo_name = log[:-1].split("/")[-1]
@ -228,7 +229,7 @@ class Initialization(object):
""" """
ar = "" ar = ""
arch = self.meta.arch arch = self.meta.arch
repo = Repo().slacky() repo = self.def_repos_dict["slacky"]
log = self.log_path + "slacky/" log = self.log_path + "slacky/"
lib = self.lib_path + "slacky_repo/" lib = self.lib_path + "slacky_repo/"
repo_name = log[:-1].split("/")[-1] repo_name = log[:-1].split("/")[-1]
@ -263,7 +264,7 @@ class Initialization(object):
""" """
ar = "" ar = ""
arch = self.meta.arch arch = self.meta.arch
repo = Repo().studioware() repo = self.def_repos_dict["studio"]
log = self.log_path + "studio/" log = self.log_path + "studio/"
lib = self.lib_path + "studio_repo/" lib = self.lib_path + "studio_repo/"
repo_name = log[:-1].split("/")[-1] repo_name = log[:-1].split("/")[-1]
@ -295,7 +296,7 @@ class Initialization(object):
def slackr(self): def slackr(self):
"""Creating slackers local library """Creating slackers local library
""" """
repo = Repo().slackers() repo = self.def_repos_dict["slackr"]
log = self.log_path + "slackr/" log = self.log_path + "slackr/"
lib = self.lib_path + "slackr_repo/" lib = self.lib_path + "slackr_repo/"
repo_name = log[:-1].split("/")[-1] repo_name = log[:-1].split("/")[-1]
@ -325,7 +326,7 @@ class Initialization(object):
ver = slack_ver() ver = slack_ver()
ar = "{0}-x86".format(ver) ar = "{0}-x86".format(ver)
arch = self.meta.arch arch = self.meta.arch
repo = Repo().slackonly() repo = self.def_repos_dict["slonly"]
log = self.log_path + "slonly/" log = self.log_path + "slonly/"
lib = self.lib_path + "slonly_repo/" lib = self.lib_path + "slonly_repo/"
repo_name = log[:-1].split("/")[-1] repo_name = log[:-1].split("/")[-1]
@ -358,7 +359,7 @@ class Initialization(object):
def ktown(self): def ktown(self):
"""Creating alien ktown local library """Creating alien ktown local library
""" """
repo = Repo().ktown() repo = self.def_repos_dict["ktown"]
log = self.log_path + "ktown/" log = self.log_path + "ktown/"
lib = self.lib_path + "ktown_repo/" lib = self.lib_path + "ktown_repo/"
repo_name = log[:-1].split("/")[-1] repo_name = log[:-1].split("/")[-1]
@ -386,7 +387,7 @@ class Initialization(object):
"""Creating alien multilib local library """Creating alien multilib local library
""" """
ver = slack_ver() ver = slack_ver()
repo = Repo().multi() repo = self.def_repos_dict["multi"]
log = self.log_path + "multi/" log = self.log_path + "multi/"
lib = self.lib_path + "multi_repo/" lib = self.lib_path + "multi_repo/"
repo_name = log[:-1].split("/")[-1] repo_name = log[:-1].split("/")[-1]
@ -417,7 +418,7 @@ class Initialization(object):
""" """
ar = "" ar = ""
arch = self.meta.arch arch = self.meta.arch
repo = Repo().slacke() repo = self.def_repos_dict["slacke"]
log = self.log_path + "slacke/" log = self.log_path + "slacke/"
lib = self.lib_path + "slacke_repo/" lib = self.lib_path + "slacke_repo/"
repo_name = log[:-1].split("/")[-1] repo_name = log[:-1].split("/")[-1]
@ -451,7 +452,7 @@ class Initialization(object):
""" """
ar = "i486" ar = "i486"
arch = self.meta.arch arch = self.meta.arch
repo = Repo().salix() repo = self.def_repos_dict["salix"]
log = self.log_path + "salix/" log = self.log_path + "salix/"
lib = self.lib_path + "salix_repo/" lib = self.lib_path + "salix_repo/"
repo_name = log[:-1].split("/")[-1] repo_name = log[:-1].split("/")[-1]
@ -482,7 +483,7 @@ class Initialization(object):
""" """
ar = "i486" ar = "i486"
arch = self.meta.arch arch = self.meta.arch
repo = Repo().slackel() repo = self.def_repos_dict["slackl"]
log = self.log_path + "slackl/" log = self.log_path + "slackl/"
lib = self.lib_path + "slackl_repo/" lib = self.lib_path + "slackl_repo/"
repo_name = log[:-1].split("/")[-1] repo_name = log[:-1].split("/")[-1]
@ -511,7 +512,7 @@ class Initialization(object):
def rested(self): def rested(self):
"""Creating alien restricted local library """Creating alien restricted local library
""" """
repo = Repo().restricted() repo = self.def_repos_dict["rested"]
log = self.log_path + "rested/" log = self.log_path + "rested/"
lib = self.lib_path + "rested_repo/" lib = self.lib_path + "rested_repo/"
repo_name = log[:-1].split("/")[-1] repo_name = log[:-1].split("/")[-1]
@ -540,7 +541,7 @@ class Initialization(object):
""" """
ar = "x86" ar = "x86"
arch = self.meta.arch arch = self.meta.arch
repo = Repo().msb() repo = self.def_repos_dict["msb"]
log = self.log_path + "msb/" log = self.log_path + "msb/"
lib = self.lib_path + "msb_repo/" lib = self.lib_path + "msb_repo/"
repo_name = log[:-1].split("/")[-1] repo_name = log[:-1].split("/")[-1]

View file

@ -46,7 +46,7 @@ class RepoInfo(object):
"Total uncompressed packages:": "" "Total uncompressed packages:": ""
} }
self.meta = _meta_ self.meta = _meta_
self.all_repos = RepoList().all_repos self.all_repos = Repo().default_repository()
self.all_repos.update(Repo().custom_repository()) self.all_repos.update(Repo().custom_repository())
del RepoList().all_repos del RepoList().all_repos

View file

@ -35,23 +35,7 @@ class RepoList(object):
def __init__(self): def __init__(self):
self.meta = _meta_ self.meta = _meta_
self.msg = Msg() self.msg = Msg()
self.all_repos = { self.all_repos = Repo().default_repository()
"slack": Repo().slack(),
"sbo": Repo().sbo(),
"rlw": Repo().rlw(),
"alien": Repo().alien(),
"slacky": Repo().slacky(),
"studio": Repo().studioware(),
"slackr": Repo().slackers(),
"slonly": Repo().slackonly(),
"ktown": Repo().ktown(),
"multi": Repo().multi(),
"slacke": Repo().slacke(),
"salix": Repo().salix(),
"slackl": Repo().slackel(),
"rested": Repo().restricted(),
"msb": Repo().msb()
}
self.all_repos.update(Repo().custom_repository()) self.all_repos.update(Repo().custom_repository())
def repos(self): def repos(self):

View file

@ -33,7 +33,6 @@ class Repo(object):
""" """
def __init__(self): def __init__(self):
self.meta = _meta_ self.meta = _meta_
self.default_dict_repo = {}
self.custom_repo_file = "/etc/slpkg/custom-repositories" self.custom_repo_file = "/etc/slpkg/custom-repositories"
self.default_repo_file = "/etc/slpkg/default-repositories" self.default_repo_file = "/etc/slpkg/default-repositories"
self.custom_repositories_list = Utils().read_file(self.custom_repo_file) self.custom_repositories_list = Utils().read_file(self.custom_repo_file)
@ -89,20 +88,22 @@ class Repo(object):
def custom_repository(self): def custom_repository(self):
"""Return dictionary with repo name and url (used external) """Return dictionary with repo name and url (used external)
""" """
dict_repo = {} custom_dict_repo = {}
for line in self.custom_repositories_list.splitlines(): for line in self.custom_repositories_list.splitlines():
line = line.lstrip() line = line.lstrip()
if not line.startswith("#"): if not line.startswith("#"):
dict_repo[line.split()[0]] = line.split()[1] custom_dict_repo[line.split()[0]] = line.split()[1]
return dict_repo return custom_dict_repo
def default_repository(self): def default_repository(self):
"""Return dictionary with default repo name and url """Return dictionary with default repo name and url
""" """
default_dict_repo = {}
for line in self.default_repositories_list.splitlines(): for line in self.default_repositories_list.splitlines():
line = line.lstrip() line = line.lstrip()
if not line.startswith("#"): if not line.startswith("#"):
self.default_dict_repo[line.split()[0]] = line.split()[1] default_dict_repo[line.split()[0]] = line.split()[1]
return default_dict_repo
def slack(self): def slack(self):
"""Official slackware repository """Official slackware repository
@ -120,73 +121,3 @@ class Repo(object):
if not default.endswith("/"): if not default.endswith("/"):
default += "/" default += "/"
return default return default
def sbo(self):
"""SlackBuilds.org repository
"""
return self.default_dict_repo["sbo"]
def rlw(self):
"""Robby"s repoisitory
"""
return self.default_dict_repo["rlw"]
def alien(self):
"""Alien"s slackbuilds repository
"""
return self.default_dict_repo["alien"]
def slacky(self):
"""Slacky.eu repository
"""
return self.default_dict_repo["slacky"]
def studioware(self):
"""Studioware repository
"""
return self.default_dict_repo["studio"]
def slackers(self):
"""Slackers.it repository
"""
return self.default_dict_repo["slackr"]
def slackonly(self):
"""Slackonly.com repository
"""
return self.default_dict_repo["slonly"]
def ktown(self):
"""Alien"s ktown repository
"""
return self.default_dict_repo["ktown"]
def multi(self):
"""Alien"s multilib repository
"""
return self.default_dict_repo["multi"]
def slacke(self):
"""Slacke slacke{17|18} repository
"""
return self.default_dict_repo["slacke"]
def salix(self):
"""SalixOS salix repository
"""
return self.default_dict_repo["salix"]
def slackel(self):
"""Slackel.gr slackel repository
"""
return self.default_dict_repo["slackl"]
def restricted(self):
"""Slackel.gr slackel repository
"""
return self.default_dict_repo["rested"]
def msb(self):
"""MSB mate repository
"""
return self.default_dict_repo["msb"]