diff --git a/CHANGELOG b/CHANGELOG index 3b23c033..2e32dce2 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,9 @@ +Version 1.9.1 +25-09-2014 + +[Updated] - Bugfix v1.9.0 no update slackbuilds packages + - Fix arch in sbo upgrade + Version 1.9.0 24-09-2014 diff --git a/PKG-INFO b/PKG-INFO index 768726f8..219aa0bb 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: slpkg -Version: 1.9.0 +Version: 1.9.1 Author: dslackw Author-email: d zlatanidis at gmail com Maintainer: dslackw diff --git a/README.rst b/README.rst index 82c32219..879440ee 100644 --- a/README.rst +++ b/README.rst @@ -7,9 +7,9 @@ Latest Release: -- Version: 1.9.0 +- Version: 1.9.1 - `Package `_ -- `Source `_ +- `Source `_ - `CHANGELOG `_ .. image:: https://raw.githubusercontent.com/dslackw/images/master/slpkg/logo.png @@ -98,8 +98,8 @@ Untar the archive and run install.sh script: .. code-block:: bash - $ tar xvf slpkg-1.9.0.tar.gz - $ cd slpkg-1.9.0 + $ tar xvf slpkg-1.9.1.tar.gz + $ cd slpkg-1.9.1 $ ./install.sh Using `pip `_ : diff --git a/install.sh b/install.sh index d1cfc14a..ad83fc0d 100755 --- a/install.sh +++ b/install.sh @@ -21,7 +21,7 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. PRGNAM=slpkg -VERSION=${VERSION:-1.9.0} +VERSION=${VERSION:-1.9.1} TAG=${TAG:-_dsw} cd .. diff --git a/slackbuild/slpkg.SlackBuild b/slackbuild/slpkg.SlackBuild index 15199ca6..c91c7968 100755 --- a/slackbuild/slpkg.SlackBuild +++ b/slackbuild/slpkg.SlackBuild @@ -23,7 +23,7 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. PRGNAM=slpkg -VERSION=${VERSION:-1.9.0} +VERSION=${VERSION:-1.9.1} BUILD=${BUILD:-1} TAG=${TAG:-_dsw} diff --git a/slackbuild/slpkg.info b/slackbuild/slpkg.info index de77bc00..c4e24278 100644 --- a/slackbuild/slpkg.info +++ b/slackbuild/slpkg.info @@ -1,7 +1,7 @@ PRGNAM="slpkg" -VERSION="1.9.0" +VERSION="1.9.1" HOMEPAGE="https://github.com/dslackw/slpkg" -DOWNLOAD="https://github.com/dslackw/slpkg/archive/v1.9.0.tar.gz" +DOWNLOAD="https://github.com/dslackw/slpkg/archive/v1.9.1.tar.gz" MD5SUM="" DOWNLOAD_x86_64="" MD5SUM_x86_64="" diff --git a/slpkg/__metadata__.py b/slpkg/__metadata__.py index 3851406f..a032d7ca 100644 --- a/slpkg/__metadata__.py +++ b/slpkg/__metadata__.py @@ -26,7 +26,7 @@ import subprocess __all__ = "slpkg" __author__ = "dslackw" -__version_info__ = (1, 9, 0) +__version_info__ = (1, 9, 1) __version__ = "{0}.{1}.{2}".format(*__version_info__) __license__ = "GNU General Public License v3 (GPLv3)" __email__ = "d.zlatanidis@gmail.com" diff --git a/slpkg/main.py b/slpkg/main.py index 215ac06f..6b97710d 100755 --- a/slpkg/main.py +++ b/slpkg/main.py @@ -56,7 +56,6 @@ import argparse from colors import colors from __metadata__ import path -from functions import get_file from version import prog_version from messages import (ext_err_args, s_user, err1_args, err2_args) @@ -79,9 +78,9 @@ def main(): action="store_true") parser.add_argument("-a", help="auto build packages", type=str, nargs="+", metavar=("script", "sources")) - parser.add_argument("-l", help="list of installed packages", + parser.add_argument("-l", help="list of installed packages", choices="all sbo slack noarch".split(), - metavar=("all, sbo, slack, noarch")) + metavar=("all, sbo, slack, noarch")) parser.add_argument("-c", help="check if your packages is up to date", type=str, nargs="+", metavar=("sbo, slack", "")) parser.add_argument("-s", help="download, build & install packages", diff --git a/slpkg/sbo/check.py b/slpkg/sbo/check.py index fbe27dd8..6873e018 100755 --- a/slpkg/sbo/check.py +++ b/slpkg/sbo/check.py @@ -30,7 +30,6 @@ from slpkg.pkg.build import build_package from slpkg.pkg.manager import pkg_upgrade from slpkg.colors import colors -from slpkg.functions import get_file from slpkg.messages import template, build_FAILED from slpkg.__metadata__ import tmp, pkg_path, build_path, sp @@ -54,12 +53,7 @@ def sbo_check(): colors.GREY, colors.ENDC)) sys.stdout.flush() initialization() - arches = [ - "-x86_64-", - "-i486-", - "-arm-", - "-noarch-" - ] + arches = ["-x86_64-", "-i486-", "-arm-", "-noarch-"] index, toolbar_width = int(), 3 dependencies, dependencies_list, \ requires, upgrade, installed, sbo_list, \ @@ -80,8 +74,10 @@ def sbo_check(): arch = _arch[1:-1] else: arch = os.uname()[4] + if arch.startswith("i") and arch.endswith("86"): + arch = "i486" package = pkg[:-(len(arch) + len("_SBo") + 3)] - pkg_version = get_file(package, "-")[1:] + pkg_version = package.split("-")[-1] name = package[:-(len(pkg_version) + 1)] if sbo_search_pkg(name): # search packages if exists in the repository @@ -127,6 +123,9 @@ def sbo_check(): prgnam = ("{0}-{1}".format(pkg, ver)) pkg_version = ver # if package not installed # take version from repository + arch = os.uname()[4] + if arch.startswith("i") and arch.endswith("86"): + arch = "i486" if find_package(prgnam, pkg_path) == []: for sbo in os.listdir(pkg_path): if sbo.startswith(pkg + sp) and sbo.endswith("_SBo"): @@ -134,12 +133,10 @@ def sbo_check(): # if yes grab package name, # version and arch for _arch in arches: - if _arch in pkg: + if _arch in sbo: arch = _arch[1:-1] - else: - arch = os.uname()[4] name = sbo[:-(len(arch) + len("_SBo") + 3)] - pkg_version = get_file(name, "-")[1:] + pkg_version = name.split("-")[-1] upgrade.append(pkg) pkg_for_upg.append("{0}-{1}".format(pkg, pkg_version)) upg_ver.append(ver) @@ -183,13 +180,13 @@ def sbo_check(): sbo_url = sbo_search_pkg(name) sbo_dwn = sbo_slackbuild_dwn(sbo_url) src_dwn = sbo_source_dwn(name).split() - script = get_file(sbo_dwn, "/") + script = sbo_dwn.split("/")[-1] # keep file from script link print("\n{0}Start -->{1} {2}\n".format(GREEN, ENDC, name)) subprocess.call("wget -N {0}".format(sbo_dwn), shell=True) sources = [] for src in src_dwn: subprocess.call("wget -N {0}".format(src), shell=True) - sources.append(get_file(src, "/")) + sources.append(src.split("/")[-1]) # keep file from source link build_package(script, sources, build_path) # Searches the package name and version in /tmp to install. # If find two or more packages e.g. to build tag diff --git a/slpkg/sbo/greps.py b/slpkg/sbo/greps.py index c93ab817..f7d31e8a 100755 --- a/slpkg/sbo/greps.py +++ b/slpkg/sbo/greps.py @@ -25,6 +25,7 @@ import os from slpkg.url_read import url_read from slpkg.__metadata__ import arch, lib_path + from search import sbo_search_pkg def sbo_source_dwn(name): diff --git a/slpkg/sbo/search.py b/slpkg/sbo/search.py index beac2030..4337af85 100755 --- a/slpkg/sbo/search.py +++ b/slpkg/sbo/search.py @@ -25,7 +25,6 @@ import os import re import sys -from slpkg.functions import get_file from slpkg.__metadata__ import lib_path from slpkg.slack.slack_version import slack_ver @@ -39,7 +38,7 @@ def sbo_search_pkg(name): with open(lib_path + "sbo_repo/SLACKBUILDS.TXT", "r") as SLACKBUILDS_TXT: for line in SLACKBUILDS_TXT: if line.startswith("SLACKBUILD LOCATION"): - if name == get_file(line[23:].strip(), "/").replace("\n", ""): + if name == (line[23:].split("/")[-1].replace("\n", "")).strip(): SLACKBUILDS_TXT.close() return (sbo_url + line[23:].strip() + "/") except KeyboardInterrupt: diff --git a/slpkg/sbo/slackbuild.py b/slpkg/sbo/slackbuild.py index 5eea36cf..6077c7bd 100755 --- a/slpkg/sbo/slackbuild.py +++ b/slpkg/sbo/slackbuild.py @@ -26,9 +26,8 @@ import sys import subprocess from slpkg.colors import colors -from slpkg.functions import get_file from slpkg.__metadata__ import (tmp, pkg_path, build_path, - log_path, lib_path, sp) + log_path, lib_path, sp) from slpkg.messages import (pkg_not_found, pkg_found, template, build_FAILED, sbo_packages_view) @@ -165,13 +164,13 @@ def sbo_build(name): sbo_url = sbo_search_pkg(pkg) sbo_link = sbo_slackbuild_dwn(sbo_url) src_link = sbo_source_dwn(pkg).split() - script = get_file(sbo_link, "/") + script = sbo_link.split("/")[-1] # get file from script print("\n{0}Start -->{1} {2}\n".format(colors.GREEN, ENDC, pkg)) subprocess.call("wget -N {0}".format(sbo_link), shell=True) sources = [] for src in src_link: subprocess.call("wget -N {0}".format(src), shell=True) - sources.append(get_file(src, "/")) + sources.append(src.split("/")[-1]) # get file from source build_package(script, sources, build_path) # Searches the package name and version in /tmp to install. # If find two or more packages e.g. to build tag diff --git a/slpkg/sbo/views.py b/slpkg/sbo/views.py index 44656dd7..ec0ffd27 100755 --- a/slpkg/sbo/views.py +++ b/slpkg/sbo/views.py @@ -27,10 +27,9 @@ import pydoc import subprocess from slpkg.colors import colors -from slpkg.functions import get_file from slpkg.__metadata__ import tmp, build_path, pkg_path, sp from slpkg.messages import (pkg_not_found, pkg_found, view_sbo, - template, build_FAILED) + template, build_FAILED) from slpkg.pkg.build import build_package from slpkg.pkg.find import find_package @@ -58,8 +57,8 @@ def sbo_network(name): sbo_dwn = sbo_slackbuild_dwn(sbo_url) source_dwn = sbo_source_dwn(name).split() sys.stdout.write("{0}Done{1}\n".format(colors.GREY, colors.ENDC)) - view_sbo(name, sbo_url, sbo_desc, get_file(sbo_dwn, "/"), \ - ", ".join([get_file(src, "/") for src in source_dwn]), \ + view_sbo(name, sbo_url, sbo_desc, sbo_dwn.split("/")[-1], \ + ", ".join([src.split("/")[-1] for src in source_dwn]), \ sbo_req) # Check if package supported by arch # before proceed to install @@ -97,12 +96,12 @@ def sbo_network(name): os.mkdir(build_path) sources = [] os.chdir(build_path) - script = get_file(sbo_dwn, "/") + script = sbo_dwn.split("/")[-1] # get file from script link print("\n{0}Start -->{0} {1}\n".format(colors.GREEN, colors.ENDC, name)) subprocess.call("wget -N {0}".format(sbo_dwn), shell=True) for src in source_dwn: subprocess.call("wget -N {0}".format(src), shell=True) - sources.append(get_file(src, "/")) + sources.append(src.split("/")[-1]) # get file from source link build_package(script, sources, build_path) print("Complete!\n") break @@ -119,10 +118,10 @@ def sbo_network(name): os.chdir(build_path) print("\n{0}Start -->{0} {1}\n".format(colors.GREEN, colors.ENDC, name)) subprocess.call("wget -N {0}".format(sbo_dwn), shell=True) - script = get_file(sbo_dwn, "/") + script = sbo_dwn.split("/")[-1] # get file from script link for src in source_dwn: subprocess.call("wget -N {0}".format(src), shell=True) - sources.append(get_file(src, "/")) + sources.append(src.split("/")[-1]) # get file from source link build_package(script, sources, build_path) # Searches the package name and version in /tmp to install. # If find two or more packages e.g. to build tag diff --git a/slpkg/slack/install.py b/slpkg/slack/install.py index 9ec69fd6..176e06ff 100755 --- a/slpkg/slack/install.py +++ b/slpkg/slack/install.py @@ -27,7 +27,6 @@ import time import subprocess from slpkg.colors import colors -from slpkg.functions import get_file from slpkg.url_read import url_read from slpkg.messages import pkg_not_found, template from slpkg.__metadata__ import slpkg_tmp, pkg_path, slack_archs @@ -97,9 +96,9 @@ def install(slack_pkg): for archs in slack_archs: if archs in pkg: pkgs = pkg[:-4] - build = get_file(pkgs, "-").replace("-", "") + build = pkgs.split("-")[-1] name_ver = pkgs[:-(len(archs) + len(build))] - ver = get_file(name_ver, "-").replace("-", "") + ver = name_ver.split("-")[-1] name = name_ver[:-(len(ver) + 1)] arch = archs[1:-1] names.append(name) diff --git a/slpkg/slack/mirrors.py b/slpkg/slack/mirrors.py index 421bb22d..678dd7e5 100755 --- a/slpkg/slack/mirrors.py +++ b/slpkg/slack/mirrors.py @@ -22,7 +22,6 @@ # along with this program. If not, see . from slpkg.__metadata__ import arch - from slack_version import slack_ver def mirrors(name, location): diff --git a/slpkg/slack/patches.py b/slpkg/slack/patches.py index 261ae72c..b3a68910 100755 --- a/slpkg/slack/patches.py +++ b/slpkg/slack/patches.py @@ -29,7 +29,6 @@ import subprocess from slpkg.colors import colors from slpkg.url_read import url_read from slpkg.messages import template -from slpkg.functions import get_file from slpkg.__metadata__ import pkg_path, slpkg_tmp, slack_archs from slpkg.pkg.manager import pkg_upgrade @@ -94,9 +93,9 @@ def patches(): else: slack = str() upg = upgrade[:-(len(slack) + 4)] - build = get_file(upg, "-").replace("-", "") + build = upg.split("-")[-1] upg_ver = upg[:-(len(arch) + len(build))] - ver = get_file(upg_ver, "-").replace("-", "") + ver = upg_ver.split("-")[-1] name = upg_ver[:-(len(ver) + 1)] arch = arch[1:-1] print(" {0}{1}{2}{3}{4}{5}{6}{7}{8}{9}{10}{11:>12}{12}".format(