updated for version 2.1.0

This commit is contained in:
Dimitris Zlatanidis 2014-11-28 17:45:55 +02:00
parent 3057fff167
commit 09010cb3b6
20 changed files with 146 additions and 66 deletions

View file

@ -1,10 +1,16 @@
Version 2.1.0
28-11-2014
[Updated] - Fix change build path.
- Fix creating directories if not exists.
- Added Studioware repository.
Version 2.0.9 Version 2.0.9
26-11-2014 26-11-2014
[Updated] - Fix setup.py to install configuration files after checksum. [Updated] - Fix setup.py to install configuration files after checksum.
- Fix view slpkg config file. - Fix view slpkg config file.
Version 2.0.8 Version 2.0.8
25-11-2014 25-11-2014

View file

@ -1,6 +1,6 @@
Metadata-Version: 1.1 Metadata-Version: 1.1
Name: slpkg Name: slpkg
Version: 2.0.9 Version: 2.1.0
Author: dslackw Author: dslackw
Author-email: d zlatanidis at gmail com Author-email: d zlatanidis at gmail com
Maintainer: dslackw Maintainer: dslackw

View file

@ -11,9 +11,9 @@
Latest Release: Latest Release:
- Version: 2.0.9 - Version: 2.1.0
- `Package <https://sourceforge.net/projects/slpkg/files/slpkg/binary/>`_ - `Package <https://sourceforge.net/projects/slpkg/files/slpkg/binary/>`_
- `Source <https://github.com/dslackw/slpkg/archive/v2.0.9.tar.gz>`_ - `Source <https://github.com/dslackw/slpkg/archive/v2.1.0.tar.gz>`_
- `CHANGELOG <https://github.com/dslackw/slpkg/blob/master/CHANGELOG>`_ - `CHANGELOG <https://github.com/dslackw/slpkg/blob/master/CHANGELOG>`_
.. image:: https://raw.githubusercontent.com/dslackw/images/master/slpkg/logo.png .. image:: https://raw.githubusercontent.com/dslackw/images/master/slpkg/logo.png
@ -31,21 +31,24 @@ Slpkg is `Open Source <http://en.wikipedia.org/wiki/Open_source>`_ software writ
Python language. It's use is for managing packages in Slackware linux distribution. Python language. It's use is for managing packages in Slackware linux distribution.
Supported Repositories: Supported Repositories:
- SBo - `slackbuilds.org <http://slackbuilds.org/>`_ - SBo - `Reposiory <http://slackbuilds.org/>`_
Arch: {x86, x86_64} Arch: {x86, x86_64}
Versions: {11.0, 12.0, 12.1, 12.2, 13.0, 13.1, 13.37, 14.0, 14.1} Versions: {11.0, 12.0, 12.1, 12.2, 13.0, 13.1, 13.37, 14.0, 14.1}
- Slack - `slackware.com <http://www.slackware.com/>`_ - Slack - `Repository <http://www.slackware.com/>`_
Arch: {x86, x86_64} Arch: {x86, x86_64}
Versions: {3.3, 8.1, 9.0, 9.1, 10.0, 10.1, 10.2, 11.0, 12.0, 12.2, 13.0, 13.37, 14.0, 14.1, current} Versions: {3.3, 8.1, 9.0, 9.1, 10.0, 10.1, 10.2, 11.0, 12.0, 12.2, 13.0, 13.37, 14.0, 14.1, current}
- Alien - `alien bob <http://www.slackware.com/~alien/slackbuilds/>`_ - Alien - `Repository <http://www.slackware.com/~alien/slackbuilds/>`_
Arch: {x86, x86_64} Arch: {x86, x86_64}
Versions: {11.0, 12.0, 12.1, 12.2, 13.0, 13.1, 13.37, 14.0, 14.1, current} Versions: {11.0, 12.0, 12.1, 12.2, 13.0, 13.1, 13.37, 14.0, 14.1, current}
- Slacky - `slacky.eu <http://repository.slacky.eu/>`_ - Slacky - `Repository <http://repository.slacky.eu/>`_
Arch: {x86, x86_64} Arch: {x86, x86_64}
Versions: {11.0, 12.0, 12.1, 12.2, 13.0, 13.1, 13.37, 14.0, 14.1} Versions: {11.0, 12.0, 12.1, 12.2, 13.0, 13.1, 13.37, 14.0, 14.1}
- Robby's - `rworkman's <http://rlworkman.net/pkgs/>`_ - Robby's - `Repository <http://rlworkman.net/pkgs/>`_
Arch: {x86, x86_64} Arch: {x86, x86_64}
Versions: {11.0, 12.0, 12.1, 12.2, 13.0, 13.1, 13.37, 14.0, 14.1} Versions: {11.0, 12.0, 12.1, 12.2, 13.0, 13.1, 13.37, 14.0, 14.1}
- Studioware - `Repository <http://studioware.org/packages>`_
Arch: {x86, x86_64}
Versions: {13.37, 14.0, 14.1}
Slpkg works in accordance with the standards of the organization slackbuilds.org Slpkg works in accordance with the standards of the organization slackbuilds.org
to builds packages. Also uses the Slackware linux instructions for installation, to builds packages. Also uses the Slackware linux instructions for installation,
@ -112,8 +115,8 @@ Untar the archive and run install.sh script:
.. code-block:: bash .. code-block:: bash
$ tar xvf slpkg-2.0.9.tar.gz $ tar xvf slpkg-2.1.0.tar.gz
$ cd slpkg-2.0.9 $ cd slpkg-2.1.0
$ ./install.sh $ ./install.sh
From SourceForge: From SourceForge:
@ -194,7 +197,7 @@ Command Line Tool Usage
-r, [package...] remove binary packages -r, [package...] remove binary packages
-d, [package...] display the contents -d, [package...] display the contents
Repositories: <slack, sbo, alien, slacky, rlw> Repositories: <slack, sbo, alien, slacky, rlw, studio>
Colors = [red, green, yellow, cyan, grey] Colors = [red, green, yellow, cyan, grey]
Slpkg Examples Slpkg Examples

View file

@ -21,7 +21,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=slpkg PRGNAM=slpkg
VERSION=${VERSION:-2.0.9} VERSION=${VERSION:-2.1.0}
TAG=${TAG:-_dsw} TAG=${TAG:-_dsw}
# Installation script. # Installation script.

View file

@ -57,7 +57,7 @@ It's a quick and easy way to manage your packages in slackware to a command.
-r, [package...] remove binary packages -r, [package...] remove binary packages
-d, [package...] display the contents -d, [package...] display the contents
Repositories: <slack, sbo, alien, slacky, rlw> Repositories: <slack, sbo, alien, slacky, rlw, studio>
Colors = [red, green, yellow, cyan, grey]\fP Colors = [red, green, yellow, cyan, grey]\fP
.SH GLOBAL OPTIONS .SH GLOBAL OPTIONS

View file

@ -23,7 +23,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=slpkg PRGNAM=slpkg
VERSION=${VERSION:-2.0.9} VERSION=${VERSION:-2.1.0}
BUILD=${BUILD:-1} BUILD=${BUILD:-1}
TAG=${TAG:-_dsw} TAG=${TAG:-_dsw}

View file

@ -26,7 +26,7 @@ import os
__all__ = "slpkg" __all__ = "slpkg"
__author__ = "dslackw" __author__ = "dslackw"
__version_info__ = (2, 0, 9) __version_info__ = (2, 1, 0)
__version__ = "{0}.{1}.{2}".format(*__version_info__) __version__ = "{0}.{1}.{2}".format(*__version_info__)
__license__ = "GNU General Public License v3 (GPLv3)" __license__ = "GNU General Public License v3 (GPLv3)"
__email__ = "d.zlatanidis@gmail.com" __email__ = "d.zlatanidis@gmail.com"
@ -84,30 +84,31 @@ if os.path.isfile("/etc/slpkg/slpkg.conf"):
# repositories # repositories
repositories = [ repositories = [
"sbo", 'slack',
"slack", 'sbo',
"rlw", 'rlw',
"alien", 'alien',
"slacky" 'slacky',
'studio'
] ]
if use_colors == "on": if use_colors == "on":
color = { color = {
'RED': "\x1b[31m", 'RED': '\x1b[31m',
'GREEN': "\x1b[32m", 'GREEN': '\x1b[32m',
'YELLOW': "\x1b[33m", 'YELLOW': '\x1b[33m',
'CYAN': "\x1b[36m", 'CYAN': '\x1b[36m',
'GREY': "\x1b[38;5;247m", 'GREY': '\x1b[38;5;247m',
'ENDC': "\x1b[0m" 'ENDC': '\x1b[0m'
} }
else: else:
color = { color = {
'RED': "", 'RED': '',
'GREEN': "", 'GREEN': '',
'YELLOW': "", 'YELLOW': '',
'CYAN': "", 'CYAN': '',
'GREY': "", 'GREY': '',
'ENDC': "" 'ENDC': ''
} }
# file spacer # file spacer

View file

@ -56,7 +56,7 @@ def options():
" -o, [package...] reinstall binary packages", " -o, [package...] reinstall binary packages",
" -r, [package...] remove binary packages", " -r, [package...] remove binary packages",
" -d, [package...] display the contents\n", " -d, [package...] display the contents\n",
"Repositories: <slack, sbo, alien, slacky, rlw>", "Repositories: <slack, sbo, alien, slacky, rlw, studio>",
"Colors = [red, green, yellow, cyan, grey]\n", "Colors = [red, green, yellow, cyan, grey]\n",
] ]
for opt in arguments: for opt in arguments:

View file

@ -44,7 +44,8 @@ class PkgDesc(object):
'slack': Initialization().slack, 'slack': Initialization().slack,
'rlw': Initialization().rlw, 'rlw': Initialization().rlw,
'alien': Initialization().alien, 'alien': Initialization().alien,
'slacky': Initialization().slacky 'slacky': Initialization().slacky,
'studio': Initialization().studioware
} }
init_repos[self.repo]() init_repos[self.repo]()
color_text = { color_text = {
@ -62,7 +63,8 @@ class PkgDesc(object):
'slack': 'slack_repo/PACKAGES.TXT', 'slack': 'slack_repo/PACKAGES.TXT',
'rlw': 'rlw_repo/PACKAGES.TXT', 'rlw': 'rlw_repo/PACKAGES.TXT',
'alien': 'alien_repo/PACKAGES.TXT', 'alien': 'alien_repo/PACKAGES.TXT',
'slacky': 'slacky_repo/PACKAGES.TXT' 'slacky': 'slacky_repo/PACKAGES.TXT',
'studio': 'studio_repo/PACKAGES.TXT'
} }
self.lib = lib_path + repos[self.repo] self.lib = lib_path + repos[self.repo]

View file

@ -52,11 +52,11 @@ class Initialization(object):
if not os.path.exists("/tmp/slpkg/"): if not os.path.exists("/tmp/slpkg/"):
os.mkdir("/tmp/slpkg/") os.mkdir("/tmp/slpkg/")
if not os.path.exists(build_path): if not os.path.exists(build_path):
os.mkdir(build_path) os.makedirs(build_path)
if not os.path.exists(slpkg_tmp_packages): if not os.path.exists(slpkg_tmp_packages):
os.mkdir(slpkg_tmp_packages) os.makedirs(slpkg_tmp_packages)
if not os.path.exists(slpkg_tmp_patches): if not os.path.exists(slpkg_tmp_patches):
os.mkdir(slpkg_tmp_patches) os.makedirs(slpkg_tmp_patches)
def slack(self): def slack(self):
''' '''
@ -162,6 +162,31 @@ class Initialization(object):
self.write(log, log_file, changelog_txt) self.write(log, log_file, changelog_txt)
self.remote(log, log_file, changelog_txt, lib, lib_file, packages_txt) self.remote(log, log_file, changelog_txt, lib, lib_file, packages_txt)
def studioware(self):
'''
Creating alien local library
'''
ar = ""
arch = os.uname()[4]
repo = Repo().studioware()
log = log_path + "studio/"
lib = lib_path + "studio_repo/"
lib_file = "PACKAGES.TXT"
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 = "64"
packages_txt = "{0}slackware{1}-{2}/{3}".format(repo, ar, slack_ver(),
lib_file)
changelog_txt = "{0}slackware{1}-{2}/{3}".format(repo, ar, slack_ver(),
log_file)
self.write(lib, lib_file, packages_txt)
self.write(log, log_file, changelog_txt)
self.remote(log, log_file, changelog_txt, lib, lib_file, packages_txt)
@staticmethod @staticmethod
def write(path, files, file_url): def write(path, files, file_url):
''' '''

View file

@ -72,6 +72,9 @@ class Case(object):
def slacky_install(self): def slacky_install(self):
OthersInstall(self.package, "slacky", self.release).start() OthersInstall(self.package, "slacky", self.release).start()
def studioware_install(self):
OthersInstall(self.package, "studio", self.release).start()
def sbo_upgrade(self): def sbo_upgrade(self):
SBoCheck().start() SBoCheck().start()
@ -87,6 +90,9 @@ class Case(object):
def slacky_upgrade(self): def slacky_upgrade(self):
OthersUpgrade("slacky", self.release).start() OthersUpgrade("slacky", self.release).start()
def studioware_upgrade(self):
OthersUpgrade("studio", self.release).start()
def main(): def main():
@ -115,11 +121,12 @@ def main():
elif len(args) == 3 and args[0] == "-c" and args[2] == "--upgrade": elif len(args) == 3 and args[0] == "-c" and args[2] == "--upgrade":
pkg = Case("") pkg = Case("")
upgrade = { upgrade = {
"sbo": pkg.sbo_upgrade, 'sbo': pkg.sbo_upgrade,
"slack": pkg.slack_upgrade, 'slack': pkg.slack_upgrade,
"rlw": pkg.rlw_upgrade, 'rlw': pkg.rlw_upgrade,
"alien": pkg.alien_upgrade, 'alien': pkg.alien_upgrade,
"slacky": pkg.slacky_upgrade 'slacky': pkg.slacky_upgrade,
'studio': pkg.studioware_upgrade
} }
if args[1] in repositories: if args[1] in repositories:
upgrade[args[1]]() upgrade[args[1]]()
@ -129,17 +136,18 @@ def main():
pkg = Case(args[2]) pkg = Case(args[2])
if args[1] in repositories: if args[1] in repositories:
install = { install = {
"sbo": pkg.sbo_install, 'sbo': pkg.sbo_install,
"slack": pkg.slack_install, 'slack': pkg.slack_install,
"rlw": pkg.rlw_install, 'rlw': pkg.rlw_install,
"alien": pkg.alien_install, 'alien': pkg.alien_install,
"slacky": pkg.slacky_install 'slacky': pkg.slacky_install,
'studio': pkg.studioware_install
} }
install[args[1]]() install[args[1]]()
else: else:
usage() usage()
elif len(args) == 3 and args[0] == "-t" and args[1] in ["sbo", "alien", elif (len(args) == 3 and args[0] == "-t" and args[1] in repositories
"rlw", "slacky"]: and args[1] != "slack"):
track_dep(args[2], args[1]) track_dep(args[2], args[1])
elif len(args) == 2 and args[0] == "-n": elif len(args) == 2 and args[0] == "-n":
SBoNetwork(args[1]).view() SBoNetwork(args[1]).view()

View file

@ -75,6 +75,15 @@ class OthersUpgrade(object):
self.mirror = "{0}slackware{1}-{2}/".format(repos.slacky(), arch, self.mirror = "{0}slackware{1}-{2}/".format(repos.slacky(), arch,
slack_ver()) slack_ver())
self.step = self.step * 2 self.step = self.step * 2
elif self.repo == "studio":
lib = lib_path + "studio_repo/PACKAGES.TXT"
arch = ""
if os.uname()[4] == "x86_64":
arch = "64"
self.mirror = "{0}slackware{1}-{2}/".format(repos.studioware(),
arch, slack_ver())
self.step = self.step * 2
f = open(lib, "r") f = open(lib, "r")
self.PACKAGES_TXT = f.read() self.PACKAGES_TXT = f.read()
f.close() f.close()
@ -86,7 +95,8 @@ class OthersUpgrade(object):
repository = { repository = {
'rlw': Initialization().rlw, 'rlw': Initialization().rlw,
'alien': Initialization().alien, 'alien': Initialization().alien,
'slacky': Initialization().slacky 'slacky': Initialization().slacky,
'studio': Initialization().studioware
} }
repository[self.repo]() repository[self.repo]()
@ -155,8 +165,8 @@ class OthersUpgrade(object):
data[3]): data[3]):
inst_pkg = split_package(pkg) inst_pkg = split_package(pkg)
repo_pkg = split_package(name[:-4]) repo_pkg = split_package(name[:-4])
if repo_pkg[0] == inst_pkg[0] and name[:-4] > pkg \ if (repo_pkg[0] == inst_pkg[0] and
and inst_pkg[0] not in black: name[:-4] > pkg and inst_pkg[0] not in black):
# store downloads packages by repo # store downloads packages by repo
dwn.append("{0}{1}/{2}".format(self.mirror, loc, name)) dwn.append("{0}{1}/{2}".format(self.mirror, loc, name))
install.append(name) install.append(name)
@ -172,7 +182,8 @@ class OthersUpgrade(object):
repository = { repository = {
'rlw': '_rlw', 'rlw': '_rlw',
'alien': 'alien', 'alien': 'alien',
'slacky': 'sl' 'slacky': 'sl',
'studio': 'se'
} }
repo = repository[self.repo] repo = repository[self.repo]
for pkg in os.listdir(pkg_path): for pkg in os.listdir(pkg_path):
@ -190,7 +201,8 @@ def views(upgrade_all, comp_sum, repository):
align = { align = {
'rlw': ' ' * 3, 'rlw': ' ' * 3,
'alien': ' ', 'alien': ' ',
'slacky': '' 'slacky': '',
'studio': ''
} }
repository += align[repository] repository += align[repository]
for pkg, comp in zip(upgrade_all, comp_sum): for pkg, comp in zip(upgrade_all, comp_sum):

View file

@ -61,7 +61,7 @@ def repo_data(PACKAGES_TXT, step, repo, version):
rsize, rsize,
runsize runsize
) = alien_filter(name, location, size, unsize, version) ) = alien_filter(name, location, size, unsize, version)
elif repo == "slacky": elif repo in ["slacky", "studio"]:
rname, rlocation, rsize, runsize = name, location, size, unsize rname, rlocation, rsize, runsize = name, location, size, unsize
return [rname, rlocation, rsize, runsize] return [rname, rlocation, rsize, runsize]

View file

@ -84,6 +84,15 @@ class OthersInstall(object):
self.mirror = "{0}slackware{1}-{2}/".format(repos.slacky(), arch, self.mirror = "{0}slackware{1}-{2}/".format(repos.slacky(), arch,
slack_ver()) slack_ver())
self.step = self.step * 2 self.step = self.step * 2
elif self.repo == "studio":
lib = lib_path + "studio_repo/PACKAGES.TXT"
arch = ""
if os.uname()[4] == "x86_64":
arch = "64"
self.mirror = "{0}slackware{1}-{2}/".format(repos.studioware(),
arch, slack_ver())
self.step = self.step * 2
f = open(lib, "r") f = open(lib, "r")
self.PACKAGES_TXT = f.read() self.PACKAGES_TXT = f.read()
f.close() f.close()
@ -98,9 +107,10 @@ class OthersInstall(object):
if not os.path.isfile(lib_path + "slack_repo/PACKAGES.TXT"): if not os.path.isfile(lib_path + "slack_repo/PACKAGES.TXT"):
Initialization().slack() Initialization().slack()
repository = { repository = {
"rlw": Initialization().rlw, 'rlw': Initialization().rlw,
"alien": Initialization().alien, 'alien': Initialization().alien,
"slacky": Initialization().slacky 'slacky': Initialization().slacky,
'studio': Initialization().studioware
} }
repository[self.repo]() repository[self.repo]()
@ -218,9 +228,10 @@ def views(install_all, comp_sum, repository, dependencies):
count = pkg_sum = uni_sum = upg_sum = 0 count = pkg_sum = uni_sum = upg_sum = 0
# fix repositories align # fix repositories align
align = { align = {
"rlw": ' ' * 3, 'rlw': ' ' * 3,
"alien": ' ', 'alien': ' ',
"slacky": '' 'slacky': '',
'studio': ''
} }
repository += align[repository] repository += align[repository]
for pkg, comp in zip(install_all, comp_sum): for pkg, comp in zip(install_all, comp_sum):

View file

@ -38,7 +38,8 @@ def search_pkg(name, repo):
repo_dir = { repo_dir = {
"rlw": "rlw_repo/PACKAGES.TXT", "rlw": "rlw_repo/PACKAGES.TXT",
"alien": "alien_repo/PACKAGES.TXT", "alien": "alien_repo/PACKAGES.TXT",
"slacky": "slacky_repo/PACKAGES.TXT" "slacky": "slacky_repo/PACKAGES.TXT",
"studio": "studio_repo/PACKAGES.TXT"
} }
with open(lib_path + repo_dir[repo], "r") as PACKAGES_TXT: with open(lib_path + repo_dir[repo], "r") as PACKAGES_TXT:
for line in PACKAGES_TXT: for line in PACKAGES_TXT:

View file

@ -81,7 +81,7 @@ class BuildPackage(object):
if sbo_check_md5 == "on": if sbo_check_md5 == "on":
check_md5(sbo_md5, src) check_md5(sbo_md5, src)
shutil.copy2(src, self.prgnam) shutil.copy2(src, self.prgnam)
os.chdir(self.path + self.prgnam) os.chdir(self.path + "/" + self.prgnam)
# change permissions # change permissions
subprocess.call("chmod +x {0}.SlackBuild".format(self.prgnam), subprocess.call("chmod +x {0}.SlackBuild".format(self.prgnam),
shell=True) shell=True)

View file

@ -292,6 +292,7 @@ class PackageManager(object):
'rlw': '_rlw', 'rlw': '_rlw',
'alien': 'alien', 'alien': 'alien',
'slacky': 'sl', 'slacky': 'sl',
'studio': 'se',
'all': '' 'all': ''
} }
search = pkg_list[pattern] search = pkg_list[pattern]

View file

@ -68,3 +68,9 @@ class Repo(object):
Slacky.eu repository Slacky.eu repository
''' '''
return "http://repository.slacky.eu/" return "http://repository.slacky.eu/"
def studioware(self):
'''
Studioware repository
'''
return "http://studioware.org/files/packages/"

View file

@ -35,6 +35,7 @@ def split_package(package):
rlw = "_rlw" rlw = "_rlw"
alien = "alien" alien = "alien"
slacky = "sl" slacky = "sl"
studio = "se"
build = split[-1] build = split[-1]
if build.endswith(sbo): if build.endswith(sbo):
build = split[-1][:-4] # and remove .t?z extension build = split[-1][:-4] # and remove .t?z extension
@ -46,6 +47,8 @@ def split_package(package):
build = split[-1][:-len(alien)] build = split[-1][:-len(alien)]
elif build.endswith(slacky): elif build.endswith(slacky):
build = split[-1][:-len(slacky)] build = split[-1][:-len(slacky)]
elif build.endswith(studio):
build = split[-1][:-len(studio)]
arch = split[-2] arch = split[-2]
ver = split[-3] ver = split[-3]
name = "-".join(split[:-3]) name = "-".join(split[:-3])

View file

@ -52,7 +52,8 @@ def track_dep(name, repo):
'slack': Initialization().slack, 'slack': Initialization().slack,
'rlw': Initialization().rlw, 'rlw': Initialization().rlw,
'alien': Initialization().alien, 'alien': Initialization().alien,
'slacky': Initialization().slacky 'slacky': Initialization().slacky,
'studio': Initialization().studioware
} }
init_repos[repo]() init_repos[repo]()
sys.stdout.write("{0}Reading package lists ...{1}".format(color['GREY'], sys.stdout.write("{0}Reading package lists ...{1}".format(color['GREY'],