From fcc56bceb3979dfa0cdf1f486635489de459e655 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Sat, 16 Aug 2014 07:53:16 +0300 Subject: [PATCH] updated 1682014 --- README.rst | 1 - slpkg/main.py | 10 ++++++++++ slpkg/pkg/build.py | 2 -- slpkg/pkg/manager.py | 5 ----- slpkg/sbo/dependency.py | 2 -- slpkg/sbo/read.py | 3 --- slpkg/sbo/slackbuild.py | 2 -- slpkg/slack/install.py | 2 -- slpkg/slack/patches.py | 7 +++++-- 9 files changed, 15 insertions(+), 19 deletions(-) diff --git a/README.rst b/README.rst index ca99a5f5..0d473a18 100644 --- a/README.rst +++ b/README.rst @@ -10,7 +10,6 @@ Slpkg is a terminal multitool in order to easy use `Slackware `_ packages. - Features ======== diff --git a/slpkg/main.py b/slpkg/main.py index a0e73a3e..a962f15a 100755 --- a/slpkg/main.py +++ b/slpkg/main.py @@ -61,6 +61,8 @@ optional arguments: ''' import argparse +import getpass + from version import * from functions import * from colors import colors @@ -113,14 +115,17 @@ def main(): if args.verbose: prog_version() if args.a: + s_user(getpass.getuser()) build_package(args.a[0], args.a[1], args.a[2:], path) if args.l: pkg_list(args.l) if args.t: pkg_tracking(args.t) if args.n: + s_user(getpass.getuser()) sbo_network(args.n) if args.c: + s_user(getpass.getuser()) if len(args.c) == 2: if "sbo" in args.c: sbo_check("".join(args.c[1])) @@ -147,6 +152,7 @@ def main(): ext_err_args() err2_args() if args.s: + s_user(getpass.getuser()) if len(args.s) == 2: if "sbo" in args.s: sbo_build("".join(args.s[1])) @@ -168,12 +174,16 @@ def main(): ext_err_args() err2_args() if args.i: + s_user(getpass.getuser()) pkg_install(args.i) if args.u: + s_user(getpass.getuser()) pkg_upgrade(args.u) if args.o: + s_user(getpass.getuser()) pkg_reinstall(args.o) if args.r: + s_user(getpass.getuser()) pkg_remove(args.r) if args.f: pkg_find(args.f) diff --git a/slpkg/pkg/build.py b/slpkg/pkg/build.py index be9e0b29..e7a55f34 100755 --- a/slpkg/pkg/build.py +++ b/slpkg/pkg/build.py @@ -24,7 +24,6 @@ import os import sys import shutil -import getpass import tarfile import subprocess @@ -34,7 +33,6 @@ def build_package(script, source, extra, path): ''' Build package from source ''' - s_user(getpass.getuser()) pkg_name = script.replace(".tar.gz", "") try: tar = tarfile.open(script) diff --git a/slpkg/pkg/manager.py b/slpkg/pkg/manager.py index b6fbfe23..717af12a 100755 --- a/slpkg/pkg/manager.py +++ b/slpkg/pkg/manager.py @@ -23,7 +23,6 @@ import os import sys -import getpass import subprocess from collections import OrderedDict @@ -38,7 +37,6 @@ def pkg_install(binary): ''' Install Slackware binary packages ''' - s_user(getpass.getuser()) for pkg in binary: try: print subprocess.check_output('installpkg {0}'.format(pkg), shell=True) @@ -54,7 +52,6 @@ def pkg_upgrade(binary): ''' Upgrade Slackware binary packages ''' - s_user(getpass.getuser()) for pkg in binary: try: print subprocess.check_output('upgradepkg --install-new {0}'.format(pkg), @@ -71,7 +68,6 @@ def pkg_reinstall(binary): ''' Reinstall Slackware binary packages ''' - s_user(getpass.getuser()) for pkg in binary: try: print subprocess.check_output('upgradepkg --reinstall {0}'.format(pkg), @@ -88,7 +84,6 @@ def pkg_remove(binary): ''' Remove Slackware binary packages ''' - s_user(getpass.getuser()) dep_path = log_path + "dep/" removed, not_found, dependencies, rmv_dependencies = [], [], [], [] print("\nPackages with name matching [ {0}{1}{2} ]\n".format( diff --git a/slpkg/sbo/dependency.py b/slpkg/sbo/dependency.py index 5305f49e..aee7d8fe 100755 --- a/slpkg/sbo/dependency.py +++ b/slpkg/sbo/dependency.py @@ -22,7 +22,6 @@ # along with this program. If not, see . import sys -import getpass from colors import colors from __metadata__ import pkg_path, sp @@ -66,7 +65,6 @@ def pkg_tracking(name): ''' Print tree of dependencies ''' - s_user(getpass.getuser()) sys.stdout.write("Reading package lists ...") dependencies_list = sbo_dependencies_pkg(name) if dependencies_list is None: diff --git a/slpkg/sbo/read.py b/slpkg/sbo/read.py index ea317b3e..8224dfb2 100755 --- a/slpkg/sbo/read.py +++ b/slpkg/sbo/read.py @@ -22,7 +22,6 @@ # along with this program. If not, see . import os -import getpass from messages import s_user from url_read import url_read @@ -39,7 +38,6 @@ def read_readme(sbo_url, name, site): ''' Read SlackBuild README file ''' - s_user(getpass.getuser()) readme = url_read(sbo_url + site) f = open("{0}{1}.{2}".format(rdm_path, name, site), "w") f.write(readme) @@ -49,7 +47,6 @@ def read_info_slackbuild(sbo_url, name, site): ''' Read info SlackBuild file ''' - s_user(getpass.getuser()) info = url_read(sbo_url + name + site) f = open("{0}{1}{2}".format(rdm_path, name, site), "w") f.write(info) diff --git a/slpkg/sbo/slackbuild.py b/slpkg/sbo/slackbuild.py index beb837bc..a70a95b9 100755 --- a/slpkg/sbo/slackbuild.py +++ b/slpkg/sbo/slackbuild.py @@ -23,7 +23,6 @@ import os import sys -import getpass import subprocess from colors import colors @@ -47,7 +46,6 @@ def sbo_build(name): Download, build and upgrade packages with all dependencies ''' - s_user(getpass.getuser()) sys.stdout.write("Building dependency tree ...") dependencies_list = sbo_dependencies_pkg(name) if dependencies_list == None: diff --git a/slpkg/slack/install.py b/slpkg/slack/install.py index cddd8a7c..5654598b 100755 --- a/slpkg/slack/install.py +++ b/slpkg/slack/install.py @@ -24,7 +24,6 @@ import os import sys import time -import getpass import subprocess from colors import colors @@ -42,7 +41,6 @@ def install(slack_pkg): Install packages from official Slackware distribution ''' try: - s_user(getpass.getuser()) dwn_list, dwn_packages = [], [] install_all, package_name, package_location = [], [], [] pkg_path = slpkg_tmp + "packages/" diff --git a/slpkg/slack/patches.py b/slpkg/slack/patches.py index 69ae58c6..620678b0 100755 --- a/slpkg/slack/patches.py +++ b/slpkg/slack/patches.py @@ -24,7 +24,6 @@ import os import sys import time -import getpass import subprocess from colors import colors @@ -43,7 +42,6 @@ def patches(): Install new patches from official Slackware mirrors ''' try: - s_user(getpass.getuser()) dwn_list, dwn_patches = [], [] upgrade_all, package_name, package_location = [], [], [] pch_path = slpkg_tmp + "patches/" @@ -90,6 +88,11 @@ def patches(): print("{0}[ upgrading ] --> {1}{2}".format( colors.GREEN, colors.ENDC, pkg)) pkg_upgrade((pch_path + pkg).split()) + for kernel in upgrade_all: + if "kernel" in kernel: + print("kernel updating run automatacaly lilo as recomanded") + subprocess.call("lilo", shell=True) + break read = raw_input("Removal downloaded packages [Y/n]? ") if read == "Y" or read == "y": for pkg in upgrade_all: