From 8ae8797cc80666ab9294588f53d95eeac1e5cc0f Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Sat, 30 Aug 2014 07:54:11 +0300 Subject: [PATCH] update source --- slpkg/__metadata__.py | 4 ++-- slpkg/main.py | 39 +++++++++++++++------------------------ slpkg/slack/install.py | 4 ++-- slpkg/slack/patches.py | 20 ++++++++++---------- 4 files changed, 29 insertions(+), 38 deletions(-) diff --git a/slpkg/__metadata__.py b/slpkg/__metadata__.py index d37909aa..c74a53f7 100644 --- a/slpkg/__metadata__.py +++ b/slpkg/__metadata__.py @@ -69,7 +69,7 @@ sbo_tag = "_SBo" sbo_filetype = ".tgz" ''' Slackware architectures ''' -slack_archs = ( +slack_archs = [ "-noarch-", "-x86_64-", "-i386-", @@ -77,5 +77,5 @@ slack_archs = ( "-i686-", "-x86-", "-fw-" - ) + ] diff --git a/slpkg/main.py b/slpkg/main.py index 899407bd..9818096c 100755 --- a/slpkg/main.py +++ b/slpkg/main.py @@ -22,32 +22,23 @@ # along with this program. If not, see . ''' - _ _ - ___| |_ __ | | ____ _ -/ __| | '_ \| |/ / _` | -\__ \ | |_) | < (_| | -|___/_| .__/|_|\_\__, | - |_| |___/ - - -usage: slpkg [-h] [-v] [-a script [source ...]] - [-l all, sbo, slack, noarch, other] - [-c sbo, slack [sbo, slack ...]] - [-s sbo, slack [sbo, slack ...]] [-t] [-n] [-i [...]] - [-u [...]] [-o [...]] [-r [...]] [-f [...]] [-d [...]] +usage: slpkg [-h] [-v] [-a script [sources ...]] + [-l all, sbo, slack, noarch] [-c sbo, slack [ ...]] + [-s sbo, slack [ ...]] [-t] [-n] [-i [...]] + [-u [...]] [-o [...]] [-r [...]] [-f [...]] [-d [...]] Utility for easy management packages in Slackware optional arguments: -h, --help show this help message and exit -v, --verbose print version and exit - -a script [source ...] + -a script [sources ...] auto build packages - -l all, sbo, slack, noarch, other [all, sbo, slack, noarch, other ...] + -l all, sbo, slack, noarch list of installed packages - -c sbo, slack [sbo, slack ...] + -c sbo, slack [ ...] check if your packages is up to date - -s sbo, slack [sbo, slack ...] + -s sbo, slack [ ...] download, build & install packages -t packages tracking dependencies from SBo -n view packages from SBo repository @@ -63,20 +54,20 @@ optional arguments: import getpass import argparse -from version import * -from functions import * from colors import colors from __metadata__ import path -from messages import ext_err_args, s_user -from messages import err1_args, err2_args +from functions import get_file +from version import prog_version +from messages import (ext_err_args, s_user, + err1_args, err2_args) -from pkg.build import build_package from pkg.manager import * +from pkg.build import build_package -from sbo.slackbuild import * -from sbo.dependency import * from sbo.check import sbo_check from sbo.views import sbo_network +from sbo.slackbuild import sbo_build +from sbo.dependency import pkg_tracking from slack.patches import patches from slack.install import install diff --git a/slpkg/slack/install.py b/slpkg/slack/install.py index ab1999ca..7343f8f7 100755 --- a/slpkg/slack/install.py +++ b/slpkg/slack/install.py @@ -145,10 +145,10 @@ def install(slack_pkg): print("Packages removed") else: print("\nThere are packages in directory {0}\n".format( - tmp_path)) + tmp_path)) else: print("\nThere are packages in directory {0}\n".format( - tmp_path)) + tmp_path)) else: message = "No matching" pkg_not_found("", slack_pkg, message, "\n") diff --git a/slpkg/slack/patches.py b/slpkg/slack/patches.py index 72223796..4b64f146 100755 --- a/slpkg/slack/patches.py +++ b/slpkg/slack/patches.py @@ -45,12 +45,12 @@ def patches(): comp_sum, uncomp_sum = [], [] dwn_patches, comp_size, uncomp_size = [], [], [] upgrade_all, package_name, package_location = [], [], [] - pch_path = slpkg_tmp + "patches/" + patch_path = slpkg_tmp + "patches/" slack_arch = "" - if not os.path.exists(pch_path): + if not os.path.exists(patch_path): if not os.path.exists(slpkg_tmp): os.mkdir(slpkg_tmp) - os.mkdir(pch_path) + os.mkdir(patch_path) sys.stdout.write ("Reading package lists ...") sys.stdout.flush() PACKAGE_TXT = url_read(mirrors(name="PACKAGES.TXT", location="patches/")) @@ -119,11 +119,11 @@ def patches(): if read == "Y" or read == "y": for dwn in dwn_patches: subprocess.call("wget -N --directory-prefix={0} {1} {2}.asc".format( - pch_path, dwn, dwn), shell=True) + patch_path, dwn, dwn), shell=True) for pkg in upgrade_all: print("{0}[ upgrading ] --> {1}{2}".format( colors.GREEN, colors.ENDC, pkg[:-4])) - pkg_upgrade((pch_path + pkg).split()) + pkg_upgrade((patch_path + pkg).split()) for kernel in upgrade_all: if "kernel" in kernel: print("The kernel has been upgraded, reinstall `lilo` ...") @@ -133,14 +133,14 @@ def patches(): read = raw_input("Removal downloaded packages [Y/n]? ") if read == "Y" or read == "y": for pkg in upgrade_all: - os.remove(pch_path + pkg) - os.remove(pch_path + pkg + ".asc") - if os.listdir(pch_path) == []: + os.remove(patch_path + pkg) + os.remove(patch_path + pkg + ".asc") + if os.listdir(patch_path) == []: print("Packages removed") else: - print("\nThere are packages in direcrory {0}\n".format(pch_path)) + print("\nThere are packages in direcrory {0}\n".format(patch_path)) else: - print("\nThere are packages in directory {0}\n".format(pch_path)) + print("\nThere are packages in directory {0}\n".format(patch_path)) else: if os.uname()[4] == "x86_64": slack_arch = 64