mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-02-06 08:46:21 +01:00
Added default repositories file
This commit is contained in:
parent
7cfe04fe41
commit
f787fb0ffa
2 changed files with 94 additions and 58 deletions
42
conf/default-repositories
Normal file
42
conf/default-repositories
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
# List File Repositories:
|
||||||
|
#
|
||||||
|
# default-repositories file is part of slpkg.
|
||||||
|
#
|
||||||
|
# Copyright 2014-2015 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Slpkg is a user-friendly package manager for Slackware installations.
|
||||||
|
#
|
||||||
|
# https://github.com/dslackw/slpkg
|
||||||
|
#
|
||||||
|
# Slpkg is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
# END OF LEGAL NOTICE
|
||||||
|
#
|
||||||
|
# Default repositories
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# NAME URL
|
||||||
|
sbo http://slackbuilds.org/slackbuilds/
|
||||||
|
rlw http://rlworkman.net/pkgs/
|
||||||
|
alien http://taper.alienbase.nl/mirrors/people/alien/sbrepos/
|
||||||
|
slacky http://repository.slacky.eu/
|
||||||
|
studio http://studioware.org/files/packages/
|
||||||
|
slackr http://ponce.cc/slackers/repository/
|
||||||
|
slonly https://slackonly.com/pub/packages/
|
||||||
|
ktown http://alien.slackbook.org/ktown/
|
||||||
|
multi http://www.slackware.com/~alien/multilib/
|
||||||
|
slacke http://ngc891.blogdns.net/pub/
|
||||||
|
salix http://download.salixos.org/
|
||||||
|
slackl http://www.slackel.gr/repo/
|
||||||
|
rested http://taper.alienbase.nl/mirrors/people/alien/restricted_slackbuilds/
|
||||||
|
msb http://slackware.org.uk/msb/
|
|
@ -33,17 +33,21 @@ class Repo(object):
|
||||||
"""
|
"""
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.meta = _meta_
|
self.meta = _meta_
|
||||||
self.repo_file = "/etc/slpkg/custom-repositories"
|
self.default_dict_repo = {}
|
||||||
self.repositories_list = Utils().read_file(self.repo_file)
|
self.custom_repo_file = "/etc/slpkg/custom-repositories"
|
||||||
|
self.default_repo_file = "/etc/slpkg/default-repositories"
|
||||||
|
self.custom_repositories_list = Utils().read_file(self.custom_repo_file)
|
||||||
|
self.default_repositories_list = Utils().read_file(
|
||||||
|
self.default_repo_file)
|
||||||
|
self.default_repository()
|
||||||
|
|
||||||
def add(self, repo, url):
|
def add(self, repo, url):
|
||||||
"""
|
"""Write custom repository name and url in a file
|
||||||
Write custom repository name and url in a file
|
|
||||||
"""
|
"""
|
||||||
repo_name = []
|
repo_name = []
|
||||||
if not url.endswith("/"):
|
if not url.endswith("/"):
|
||||||
url = url + "/"
|
url = url + "/"
|
||||||
for line in self.repositories_list.splitlines():
|
for line in self.custom_repositories_list.splitlines():
|
||||||
line = line.lstrip()
|
line = line.lstrip()
|
||||||
if line and not line.startswith("#"):
|
if line and not line.startswith("#"):
|
||||||
repo_name.append(line.split()[0])
|
repo_name.append(line.split()[0])
|
||||||
|
@ -57,7 +61,7 @@ class Repo(object):
|
||||||
print("\nMaximum repository name length must be six (6) "
|
print("\nMaximum repository name length must be six (6) "
|
||||||
"characters\n")
|
"characters\n")
|
||||||
raise SystemExit()
|
raise SystemExit()
|
||||||
with open(self.repo_file, "a") as repos:
|
with open(self.custom_repo_file, "a") as repos:
|
||||||
new_line = " {0}{1}{2}\n".format(repo, " " * (10 - len(repo)), url)
|
new_line = " {0}{1}{2}\n".format(repo, " " * (10 - len(repo)), url)
|
||||||
repos.write(new_line)
|
repos.write(new_line)
|
||||||
repos.close()
|
repos.close()
|
||||||
|
@ -65,12 +69,11 @@ class Repo(object):
|
||||||
raise SystemExit()
|
raise SystemExit()
|
||||||
|
|
||||||
def remove(self, repo):
|
def remove(self, repo):
|
||||||
"""
|
"""Remove custom repository
|
||||||
Remove custom repository
|
|
||||||
"""
|
"""
|
||||||
rem_repo = False
|
rem_repo = False
|
||||||
with open(self.repo_file, "w") as repos:
|
with open(self.custom_repo_file, "w") as repos:
|
||||||
for line in self.repositories_list.splitlines():
|
for line in self.custom_repositories_list.splitlines():
|
||||||
repo_name = line.split()[0]
|
repo_name = line.split()[0]
|
||||||
if repo_name != repo:
|
if repo_name != repo:
|
||||||
repos.write(line + "\n")
|
repos.write(line + "\n")
|
||||||
|
@ -84,19 +87,25 @@ class Repo(object):
|
||||||
raise SystemExit()
|
raise SystemExit()
|
||||||
|
|
||||||
def custom_repository(self):
|
def custom_repository(self):
|
||||||
"""
|
"""Return dictionary with repo name and url (used external)
|
||||||
Return dictionary with repo name and url
|
|
||||||
"""
|
"""
|
||||||
dict_repo = {}
|
dict_repo = {}
|
||||||
for line in self.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]
|
dict_repo[line.split()[0]] = line.split()[1]
|
||||||
return dict_repo
|
return dict_repo
|
||||||
|
|
||||||
def slack(self):
|
def default_repository(self):
|
||||||
|
"""Return dictionary with default repo name and url
|
||||||
"""
|
"""
|
||||||
Official slackware repository
|
for line in self.default_repositories_list.splitlines():
|
||||||
|
line = line.lstrip()
|
||||||
|
if not line.startswith("#"):
|
||||||
|
self.default_dict_repo[line.split()[0]] = line.split()[1]
|
||||||
|
|
||||||
|
def slack(self):
|
||||||
|
"""Official slackware repository
|
||||||
"""
|
"""
|
||||||
default = "http://mirrors.slackware.com/slackware/"
|
default = "http://mirrors.slackware.com/slackware/"
|
||||||
if self.meta.arch.startswith("arm"):
|
if self.meta.arch.startswith("arm"):
|
||||||
|
@ -113,86 +122,71 @@ class Repo(object):
|
||||||
return default
|
return default
|
||||||
|
|
||||||
def sbo(self):
|
def sbo(self):
|
||||||
|
"""SlackBuilds.org repository
|
||||||
"""
|
"""
|
||||||
SlackBuilds.org repository
|
return self.default_dict_repo["sbo"]
|
||||||
"""
|
|
||||||
return "http://slackbuilds.org/slackbuilds/"
|
|
||||||
|
|
||||||
def rlw(self):
|
def rlw(self):
|
||||||
|
"""Robby"s repoisitory
|
||||||
"""
|
"""
|
||||||
Robby"s repoisitory
|
return self.default_dict_repo["rlw"]
|
||||||
"""
|
|
||||||
return "http://rlworkman.net/pkgs/"
|
|
||||||
|
|
||||||
def alien(self):
|
def alien(self):
|
||||||
|
"""Alien"s slackbuilds repository
|
||||||
"""
|
"""
|
||||||
Alien"s slackbuilds repository
|
return self.default_dict_repo["alien"]
|
||||||
"""
|
|
||||||
return "http://taper.alienbase.nl/mirrors/people/alien/sbrepos/"
|
|
||||||
|
|
||||||
def slacky(self):
|
def slacky(self):
|
||||||
|
"""Slacky.eu repository
|
||||||
"""
|
"""
|
||||||
Slacky.eu repository
|
return self.default_dict_repo["slacky"]
|
||||||
"""
|
|
||||||
return "http://repository.slacky.eu/"
|
|
||||||
|
|
||||||
def studioware(self):
|
def studioware(self):
|
||||||
|
"""Studioware repository
|
||||||
"""
|
"""
|
||||||
Studioware repository
|
return self.default_dict_repo["studio"]
|
||||||
"""
|
|
||||||
return "http://studioware.org/files/packages/"
|
|
||||||
|
|
||||||
def slackers(self):
|
def slackers(self):
|
||||||
|
"""Slackers.it repository
|
||||||
"""
|
"""
|
||||||
Slackers.it repository
|
return self.default_dict_repo["slackr"]
|
||||||
"""
|
|
||||||
return "http://ponce.cc/slackers/repository/"
|
|
||||||
|
|
||||||
def slackonly(self):
|
def slackonly(self):
|
||||||
|
"""Slackonly.com repository
|
||||||
"""
|
"""
|
||||||
Slackonly.com repository
|
return self.default_dict_repo["slonly"]
|
||||||
"""
|
|
||||||
return "https://slackonly.com/pub/packages/"
|
|
||||||
|
|
||||||
def ktown(self):
|
def ktown(self):
|
||||||
|
"""Alien"s ktown repository
|
||||||
"""
|
"""
|
||||||
Alien"s ktown repository
|
return self.default_dict_repo["ktown"]
|
||||||
"""
|
|
||||||
return "http://alien.slackbook.org/ktown/"
|
|
||||||
|
|
||||||
def multi(self):
|
def multi(self):
|
||||||
|
"""Alien"s multilib repository
|
||||||
"""
|
"""
|
||||||
Alien"s multilib repository
|
return self.default_dict_repo["multi"]
|
||||||
"""
|
|
||||||
return "http://www.slackware.com/~alien/multilib/"
|
|
||||||
|
|
||||||
def slacke(self):
|
def slacke(self):
|
||||||
|
"""Slacke slacke{17|18} repository
|
||||||
"""
|
"""
|
||||||
Slacke slacke{17|18} repository
|
return self.default_dict_repo["slacke"]
|
||||||
"""
|
|
||||||
return "http://ngc891.blogdns.net/pub/"
|
|
||||||
|
|
||||||
def salix(self):
|
def salix(self):
|
||||||
|
"""SalixOS salix repository
|
||||||
"""
|
"""
|
||||||
SalixOS salix repository
|
return self.default_dict_repo["salix"]
|
||||||
"""
|
|
||||||
return "http://download.salixos.org/"
|
|
||||||
|
|
||||||
def slackel(self):
|
def slackel(self):
|
||||||
|
"""Slackel.gr slackel repository
|
||||||
"""
|
"""
|
||||||
Slackel.gr slackel repository
|
return self.default_dict_repo["slackl"]
|
||||||
"""
|
|
||||||
return "http://www.slackel.gr/repo/"
|
|
||||||
|
|
||||||
def restricted(self):
|
def restricted(self):
|
||||||
|
"""Slackel.gr slackel repository
|
||||||
"""
|
"""
|
||||||
Slackel.gr slackel repository
|
return self.default_dict_repo["rested"]
|
||||||
"""
|
|
||||||
return ("http://taper.alienbase.nl/mirrors/people/alien/"
|
|
||||||
"restricted_slackbuilds/")
|
|
||||||
|
|
||||||
def msb(self):
|
def msb(self):
|
||||||
|
"""MSB mate repository
|
||||||
"""
|
"""
|
||||||
MSB mate repository
|
return self.default_dict_repo["msb"]
|
||||||
"""
|
|
||||||
return "http://slackware.org.uk/msb/"
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue