mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-18 10:26:29 +01:00
update license, arches
This commit is contained in:
parent
3608a12ae1
commit
2a37b04fcb
5 changed files with 42 additions and 60 deletions
|
@ -26,7 +26,7 @@ import subprocess
|
|||
|
||||
__all__ = "slpkg"
|
||||
__author__ = "dslackw"
|
||||
__version_info__ = (1, 7, 6)
|
||||
__version_info__ = (1, 7, 7)
|
||||
__version__ = "{0}.{1}.{2}".format(*__version_info__)
|
||||
__license__ = "GNU General Public License v3 (GPLv3)"
|
||||
__email__ = "d.zlatanidis@gmail.com"
|
||||
|
@ -67,3 +67,15 @@ elif "arm" in arch:
|
|||
build = "*"
|
||||
sbo_tag = "_SBo"
|
||||
sbo_filetype = ".tgz"
|
||||
|
||||
''' Slackware architectures '''
|
||||
slack_archs = (
|
||||
"-noarch-",
|
||||
"-x86_64-",
|
||||
"-i386-",
|
||||
"-i486-",
|
||||
"-i686-",
|
||||
"-x86-",
|
||||
"-fw-"
|
||||
)
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# install.py
|
||||
# install.py file is part of slpkg.
|
||||
|
||||
# Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
|
||||
# All rights reserved.
|
||||
|
@ -10,7 +10,7 @@
|
|||
|
||||
# https://github.com/dslackw/slpkg
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# 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.
|
||||
|
@ -29,7 +29,7 @@ import subprocess
|
|||
from colors import colors
|
||||
from url_read import url_read
|
||||
from messages import pkg_not_found, template
|
||||
from __metadata__ import slpkg_tmp, pkg_path, sp
|
||||
from __metadata__ import slpkg_tmp, pkg_path, slack_archs
|
||||
|
||||
from pkg.manager import pkg_upgrade, pkg_reinstall
|
||||
|
||||
|
@ -44,7 +44,7 @@ def install(slack_pkg):
|
|||
dwn_list, comp_size, uncomp_size = [], [], []
|
||||
install_all, package_name, package_location = [], [], []
|
||||
tmp_path = slpkg_tmp + "packages/"
|
||||
pkg_sum = 0
|
||||
pkg_sum, arch = 0, ""
|
||||
if not os.path.exists(tmp_path):
|
||||
if not os.path.exists(slpkg_tmp):
|
||||
os.mkdir(slpkg_tmp)
|
||||
|
@ -83,41 +83,25 @@ def install(slack_pkg):
|
|||
template(78)
|
||||
print("Installing:")
|
||||
for pkg, comp in zip(install_all, comp_sum):
|
||||
if "-noarch-" in pkg:
|
||||
arch = "noarch"
|
||||
elif "-x86_64-" in pkg:
|
||||
arch = "x86_64"
|
||||
elif "-i386-" in pkg:
|
||||
arch = "i386"
|
||||
elif "-i486-" in pkg:
|
||||
arch = "i486"
|
||||
elif "-i686-" in pkg:
|
||||
arch = "i686"
|
||||
elif "-x86-" in pkg:
|
||||
arch = "x86"
|
||||
elif "-fw-" in pkg:
|
||||
arch = "fw"
|
||||
else:
|
||||
arch = ""
|
||||
for archs in slack_archs:
|
||||
if archs in pkg:
|
||||
pkgs = pkg.replace(archs, "")
|
||||
arch = archs[1:-1]
|
||||
if os.path.isfile(pkg_path + pkg[:-4]):
|
||||
pkg_sum += 1
|
||||
SC, EC = colors.GREEN, colors.ENDC
|
||||
else:
|
||||
SC, EC = colors.RED, colors.ENDC
|
||||
print " ", SC + pkg[:-5].replace(sp+arch+sp, "") + EC, " "*(
|
||||
40-len(pkg[:-5].replace(sp+arch+sp, ""))), arch, " "*(
|
||||
7-len(arch)), pkg[-5:-4].replace(sp+arch+sp, ""), " "*(
|
||||
6-len(pkg[-5:-4].replace(sp+arch+sp, ""))), "Slack", " ", comp, " "*(
|
||||
print " ", SC + pkgs[:-5] + EC, " "*(40-len(pkgs[:-5])), arch, " "*(
|
||||
7-len(arch)), pkgs[-5:-4], " "*(6-len(pkgs[-5:-4])), "Slack", " ", comp, " "*(
|
||||
3-len(comp)), "K"
|
||||
comp_unit, uncomp_unit = "Mb", "Mb"
|
||||
compressed = round((sum(map(float, comp_sum)) * 0.0001220703125), 2)
|
||||
uncompressed = round((sum(map(float, uncomp_sum)) * 0.0001220703125), 2)
|
||||
if compressed < 1:
|
||||
compressed = sum(map(int, comp_sum))
|
||||
comp_unit = "Kb"
|
||||
compressed, comp_unit = sum(map(int, comp_sum)), "Kb"
|
||||
if uncompressed < 1:
|
||||
uncompressed = sum(map(int, uncomp_sum))
|
||||
uncomp_unit = "Kb"
|
||||
uncompressed, uncomp_unit = sum(map(int, uncomp_sum)), "Kb"
|
||||
msg_pkg = "package"
|
||||
msg_2_pkg = msg_pkg
|
||||
if len(install_all) > 1:
|
||||
|
@ -161,9 +145,8 @@ def install(slack_pkg):
|
|||
print("\nThere are packages in directory {0}\n".format(
|
||||
tmp_path))
|
||||
else:
|
||||
bol, eol = "", "\n"
|
||||
message = "No matching"
|
||||
pkg_not_found(bol, slack_pkg, message, eol)
|
||||
pkg_not_found("", slack_pkg, message, "\n")
|
||||
except KeyboardInterrupt:
|
||||
print # new line at exit
|
||||
sys.exit()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# mirrors.py
|
||||
# mirrors.py file is part of slpkg.
|
||||
|
||||
# Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
|
||||
# All rights reserved.
|
||||
|
@ -10,7 +10,7 @@
|
|||
|
||||
# https://github.com/dslackw/slpkg
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# 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.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# patches.py
|
||||
# patches.py file is part of slpkg.
|
||||
|
||||
# Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
|
||||
# All rights reserved.
|
||||
|
@ -10,7 +10,7 @@
|
|||
|
||||
# https://github.com/dslackw/slpkg
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# 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.
|
||||
|
@ -29,7 +29,8 @@ import subprocess
|
|||
from colors import colors
|
||||
from url_read import url_read
|
||||
from messages import template
|
||||
from __metadata__ import pkg_path, slpkg_tmp, sp
|
||||
from __metadata__ import (pkg_path, slpkg_tmp,
|
||||
slack_archs)
|
||||
|
||||
from pkg.manager import pkg_upgrade
|
||||
|
||||
|
@ -83,31 +84,17 @@ def patches():
|
|||
template(78)
|
||||
print("Upgrading:")
|
||||
for upgrade, size in zip(upgrade_all, comp_sum):
|
||||
if "-noarch-" in upgrade:
|
||||
arch = "noarch"
|
||||
elif "-x86_64-" in upgrade:
|
||||
arch = "x86_64"
|
||||
elif "-i386-" in upgrade:
|
||||
arch = "i386"
|
||||
elif "-i486-" in upgrade:
|
||||
arch = "i486"
|
||||
elif "-i686-" in upgrade:
|
||||
arch = "i686"
|
||||
elif "-x86-" in upgrade:
|
||||
arch = "x86"
|
||||
elif "-fw-" in upgrade:
|
||||
arch = "fw"
|
||||
else:
|
||||
arch = ""
|
||||
for archs in slack_archs:
|
||||
if archs in upgrade:
|
||||
upg = upgrade.replace(archs, "")
|
||||
arch = archs[1:-1]
|
||||
if "_slack" in upgrade:
|
||||
slack = "_slack" + slack_ver()
|
||||
else:
|
||||
slack = ""
|
||||
print " ", upgrade[:-(5+len(slack))].replace(
|
||||
sp+arch+sp, ""), " "*(40-len(upgrade[:-(
|
||||
5+len(slack))].replace(sp+arch+sp, ""))), arch, " "*(
|
||||
7-len(arch)), upgrade[-15:-14].replace(sp+arch+sp, ""), " "*(
|
||||
6-len(upgrade[-15:-14].replace(sp+arch+sp, ""))), "Slack", " ", size, " "*(
|
||||
print " ", upg[:-(5+len(slack))], " "*(40-len(upg[:-(
|
||||
5+len(slack))])), arch, " "*(7-len(arch)), upg[-15:-14], " "*(
|
||||
6-len(upgrade[-15:-14])), "Slack", " ", size, " "*(
|
||||
3-len(size)), "K"
|
||||
comp_unit, uncomp_unit = "Mb", "Mb"
|
||||
compressed = round((sum(map(float, comp_sum)) * 0.0001220703125), 2)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# slack_version.py
|
||||
# slack_version.py file is part of slpkg.
|
||||
|
||||
# Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
|
||||
# All rights reserved.
|
||||
|
@ -10,7 +10,7 @@
|
|||
|
||||
# https://github.com/dslackw/slpkg
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# 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.
|
||||
|
|
Loading…
Reference in a new issue