diff --git a/CHANGELOG b/CHANGELOG index 8c41d597..5b781bc1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,10 +1,11 @@ -18-08-2014 +22-08-2014 Version 1.7.5.dev -[Feature] - Added report of packages will be installed with options +[Feature] - Added report of packages will be installed the options `slpkg -s sbo ` `slpkg -s slack ` `slpkg -c slack upgrade` +[Updated] - Fix mirrors for Slackware x86 17-08-2014 Version 1.7.4 diff --git a/README.rst b/README.rst index 7bd0c60c..75387143 100644 --- a/README.rst +++ b/README.rst @@ -107,8 +107,22 @@ build and install with all dependencies : $ slpkg -s sbo brasero Building dependency tree...... Done The following packages will be automatically installed or upgraded with new version: + +============================================================================== + | Package Version Arch Repository + +============================================================================== + Installing: + brasero 3.11.3 x86_64 SBo + Installing for dependencies: + orc 0.4.19 x86_64 SBo + gstreamer1 1.2.2 x86_64 SBo + gst1-plugins-base 1.2.2 x86_64 SBo + gst1-plugins-bad 1.2.2 x86_64 SBo + libunique 1.1.6 x86_64 SBo - orc gstreamer1 gst1-plugins-base gst1-plugins-bad libunique brasero + Installing summary + =============================================================================== + Total 6 packages. + 0 packages will be installed, 6 allready installed. Do you want to continue [Y/n]? y . @@ -143,10 +157,19 @@ download and install: Reading package lists.............................. Done - [ install ] --> mozilla-firefox-24.1.0esr-x86_64-1 - [ install ] --> mozilla-nss-3.15.2-x86_64-2 - [ install ] --> mozilla-thunderbird-24.1.0-x86_64-1 + +============================================================================== + | Package Arch Build Repos Size + +============================================================================== + Installing: + mozilla-firefox-24.1.0esr x86_64 1 Slack 23524 K + mozilla-nss-3.15.2 x86_64 2 Slack 1592 K + mozilla-thunderbird-24.1.0 x86_64 1 Slack 24208 K + Installing summary + =============================================================================== + + Total 3 packages. + 3 packages will be installed, 0 allready installed. Need to get 6.02 Mb of archives. After this process, 15.72 Mb of additional disk space will be used. @@ -176,9 +199,6 @@ and also displays installed packages: | +--5 libunique - NOTE: green installed, red not installed - - Check if your packages is up to date from slackbuilds.org: .. code-block:: bash @@ -213,10 +233,17 @@ Check if your distribution is up to date from `Slackware official mirrors These packages need upgrading: - [ upgrade ] --> dhcpcd-6.0.5-x86_64-3_slack14.1.txz - [ upgrade ] --> samba-4.1.11-x86_64-1_slack14.1.txz - [ upgrade ] --> xscreensaver-5.29-x86_64-1_slack14.1.txz + +============================================================================== + | Package Arch Build Repos Size + +============================================================================== + Upgrading: + dhcpcd-6.0.5 x86_64 3 Slack 92 K + samba-4.1.11 x86_64 1 Slack 9928 K + xscreensaver-5.29 x86_64 1 Slack 3896 K + Installing summary + =============================================================================== + Total 3 package will be upgrading. Need to get 1.70 Mb of archives. After this process, 9.51 Mb of additional disk space will be used. @@ -243,7 +270,7 @@ Find packages from slackbuilds.org: Download Download this package Build Download and build this package Install Download/Build/Install - + Quit Quit _ Auto tool to build package: diff --git a/man/slpkg.8 b/man/slpkg.8 index 8d6ccd1a..96d6e4cc 100644 --- a/man/slpkg.8 +++ b/man/slpkg.8 @@ -81,7 +81,7 @@ slackbuilds.org is up to date. Find package from slackbuild.org with all dependencies, download, build and install them if not installed or new version is available. Even download and install official packages from Slackware -official mirrors and install. +official mirrors and install or reinstall if already installed. .SS -i , install binary package \fBslpkg\fP \fB-i\fP <\fIpackages.t?z\fP> .PP @@ -148,13 +148,25 @@ $ \fBslpkg -t brasero\fP | --5: libunique - NOTE: green installed, red not installed - $ \fBslpkg -s sbo brasero\fP Building dependency tree...... Done The following packages will be automatically installed or upgraded with new version: + +============================================================================== + | Package Version Arch Repository + +============================================================================== + Installing: + brasero 3.11.3 x86_64 SBo + Installing for dependencies: + orc 0.4.19 x86_64 SBo + gstreamer1 1.2.2 x86_64 SBo + gst1-plugins-base 1.2.2 x86_64 SBo + gst1-plugins-bad 1.2.2 x86_64 SBo + libunique 1.1.6 x86_64 SBo - orc gstreamer1 gst1-plugins-base gst1-plugins-bad libunique brasero + Installing summary + =============================================================================== + Total 6 packages. + 0 packages will be installed, 6 allready installed. Do you want to continue [Y/n]? y . diff --git a/slpkg/functions.py b/slpkg/functions.py index 8fde429f..218b2e71 100755 --- a/slpkg/functions.py +++ b/slpkg/functions.py @@ -34,4 +34,4 @@ def get_file(link, char): results.append(link[i]) if link[i] == char: break - return "".join(results[::-1]).replace("/", "").strip(" ") + return "".join(results[::-1]).replace("/", "").strip() diff --git a/slpkg/main.py b/slpkg/main.py index fbd25315..3f4ac601 100755 --- a/slpkg/main.py +++ b/slpkg/main.py @@ -136,7 +136,7 @@ def main(): else: choices = ["upgrade"] ext_err_args() - err1_args("".join(args.c), choices) + err1_args("".join(args.c[1]), choices) else: choices = ["sbo", "slack"] ext_err_args() @@ -162,7 +162,7 @@ def main(): else: choices = ["sbo", "slack"] ext_err_args() - err1_args("".join(args.s), choices) + err1_args("".join(args.s[0]), choices) elif len(args.s) < 2: if "sbo" in args.s or "slack" in args.s: ext_err_args() diff --git a/slpkg/messages.py b/slpkg/messages.py index 4b88b5b1..2a18d44c 100755 --- a/slpkg/messages.py +++ b/slpkg/messages.py @@ -84,18 +84,20 @@ def template(max): def view_sbo(pkg, sbo_url, sbo_dwn, source_dwn, extra_dwn, sbo_req): print # new line at start template(78) - print ("| {0}Package {1}{2}{3} --> {4}".format(colors.GREEN, + print("| {0}Package {1}{2}{3} --> {4}".format(colors.GREEN, colors.CYAN, pkg, colors.GREEN, colors.ENDC + sbo_url)) template(78) - print ("| {0}SlackBuild : {1}{2}".format(colors.GREEN, colors.ENDC, sbo_dwn)) - print ("| {0}Source : {1}{2}".format(colors.GREEN, colors.ENDC, source_dwn)) - print ("| {0}Extra : {1}{2}".format(colors.GREEN, colors.ENDC, extra_dwn)) - print ("| {0}Requirements : {1}{2}".format(colors.YELLOW, colors.ENDC, + print("| {0}SlackBuild : {1}{2}".format(colors.GREEN, colors.ENDC, sbo_dwn)) + print("| {0}Source : {1}{2}".format(colors.GREEN, colors.ENDC, source_dwn)) + print("| {0}Extra : {1}{2}".format(colors.GREEN, colors.ENDC, extra_dwn)) + print("| {0}Requirements : {1}{2}".format(colors.YELLOW, colors.ENDC, ", ".join(sbo_req.split()))) template(78) - print (" {0}R{1}EADME View the README file".format(colors.RED, colors.ENDC)) - print (" {0}S{1}lackBuild View the SlackBuild file".format(colors.RED, colors.ENDC)) - print (" In{0}f{1}o View the Info file".format(colors.RED, colors.ENDC)) - print (" {0}D{1}ownload Download this package".format(colors.RED, colors.ENDC)) - print (" {0}B{1}uild Download and build".format(colors.RED, colors.ENDC)) - print (" {0}I{1}nstall Download/Build/Install\n".format(colors.RED, colors.ENDC)) + print(" {0}R{1}EADME View the README file".format(colors.RED, colors.ENDC)) + print(" {0}S{1}lackBuild View the SlackBuild file".format(colors.RED, colors.ENDC)) + print(" In{0}f{1}o View the Info file".format(colors.RED, colors.ENDC)) + print(" {0}D{1}ownload Download this package".format(colors.RED, colors.ENDC)) + print(" {0}B{1}uild Download and build".format(colors.RED, colors.ENDC)) + print(" {0}I{1}nstall Download/Build/Install".format(colors.RED, colors.ENDC)) + print(" {0}Q{1}uit Quit\n".format(colors.RED, colors.ENDC)) + diff --git a/slpkg/sbo/dependency.py b/slpkg/sbo/dependency.py index 2c092094..173c9b7d 100755 --- a/slpkg/sbo/dependency.py +++ b/slpkg/sbo/dependency.py @@ -98,4 +98,4 @@ def pkg_tracking(name): else: print(" |") print(" {0}{1}: {2}{3}{4}".format("+--", index, colors.RED, pkg, colors.ENDC)) - print("\n NOTE: green installed, red not installed\n") + print # new line at end diff --git a/slpkg/sbo/greps.py b/slpkg/sbo/greps.py index 2da641e4..87d8ef02 100755 --- a/slpkg/sbo/greps.py +++ b/slpkg/sbo/greps.py @@ -71,6 +71,6 @@ def sbo_version_pkg(name): sbo_name.append(line[17:].strip()) if line.startswith("SLACKBUILD VERSION: "): sbo_ver.append(line[20:].strip()) - for nam, ver in zip(sbo_name, sbo_ver): - if nam == name: + for sbo, ver in zip(sbo_name, sbo_ver): + if sbo == name: return ver diff --git a/slpkg/sbo/slackbuild.py b/slpkg/sbo/slackbuild.py index 2fbe8736..8e4ede19 100755 --- a/slpkg/sbo/slackbuild.py +++ b/slpkg/sbo/slackbuild.py @@ -79,18 +79,18 @@ def sbo_build(name): template(78) print("Installing:") print " ", "".join(pkg_for_install), " "*(22-len(name)), sbo_ver, " "*( - 12-len(sbo_ver)), arch, " "*5, "SBo" + 12-len(sbo_ver)), arch, " "*(11-len(arch)), "SBo" print("Installing for dependencies:") for dep in dependencies[:-1]: sbo_url = sbo_search_pkg(dep) sbo_ver = sbo_version_pkg(dep) if find_package(dep + sp, pkg_path): print " ", colors.GREEN + dep + colors.ENDC, " "*(22-len(dep)), sbo_ver, " "*( - 12-len(sbo_ver)), arch, " "*5, "SBo" + 12-len(sbo_ver)), arch, " "*(11-len(arch)), "SBo" pkg_sum += 1 else: print " ", colors.RED + dep + colors.ENDC, " "*(22-len(dep)), sbo_ver, " "*( - 12-len(sbo_ver)), arch, " "*5, "SBo" + 12-len(sbo_ver)), arch, " "*(11-len(arch)), "SBo" print("\nInstalling summary") print("="*79) print("Total {0} packages.".format(len(dependencies))) @@ -123,20 +123,20 @@ def sbo_build(name): template(78) pkg_found(pkg, sbo_file_version) template(78) - ''' - Write dependencies in a log file - into directory `/var/log/slpkg/dep/` - ''' - dep_path = log_path + "dep/" - if not os.path.exists(dep_path): - os.mkdir(dep_path) - if os.path.isfile(dep_path + name): - os.remove(dep_path + name) - if len(dependencies) > 1: - f = open(dep_path + name, "w") - for dep in dependencies: - f.write(dep + "\n") - f.close() + ''' + Write dependencies in a log file + into directory `/var/log/slpkg/dep/` + ''' + dep_path = log_path + "dep/" + if not os.path.exists(dep_path): + os.mkdir(dep_path) + if os.path.isfile(dep_path + name): + os.remove(dep_path + name) + if len(dependencies) > 1: + f = open(dep_path + name, "w") + for dep in dependencies: + f.write(dep + "\n") + f.close() except KeyboardInterrupt: print # new line at exit sys.exit() diff --git a/slpkg/slack/install.py b/slpkg/slack/install.py index 4bfdd950..7f4f783e 100755 --- a/slpkg/slack/install.py +++ b/slpkg/slack/install.py @@ -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, arch +from __metadata__ import slpkg_tmp, pkg_path, arch, sp from pkg.manager import pkg_upgrade, pkg_reinstall @@ -96,8 +96,12 @@ def install(slack_pkg): Kb = size.replace(pkg, "") if "-noarch-" in pkg: arch = "noarch" - elif "-"+os.uname()[4]+"-" in pkg: + elif sp+os.uname()[4]+sp in pkg: arch = os.uname()[4] + elif "-i486-" in pkg: + arch = "i486" + elif "-i686-" in pkg: + arch = "i686" elif "-x86-" in pkg: arch = "x86" elif "-fw-" in pkg: @@ -109,9 +113,11 @@ def install(slack_pkg): SC, EC = colors.GREEN, colors.ENDC else: SC, EC = colors.RED, colors.ENDC - print " ", SC + pkg[:-5].replace("-"+arch+"-", "") + EC, " "*( - 48-len(pkg[:-5])), arch, " ", pkg[-5:-4].replace( - "-"+arch+"-", ""), " "*5, "Slack", " ", Kb, " "*(3-len(Kb)), "K" + 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", " ", Kb, " "*( + 3-len(Kb)), "K" for install in install_all: for comp in comp_list: if install == comp[:-(len(comp)-len(install))]: diff --git a/slpkg/slack/mirrors.py b/slpkg/slack/mirrors.py index 5d956b36..38344d30 100755 --- a/slpkg/slack/mirrors.py +++ b/slpkg/slack/mirrors.py @@ -33,6 +33,6 @@ def mirrors(name, location): http = "http://mirrors.slackware.com/slackware/slackware64-{0}/{1}{2}".format( slack_ver(), location, name) else: - http = "http://mirrors.slackware.com/slackware/slackware-{0}/{1}{3}".format( + http = "http://mirrors.slackware.com/slackware/slackware-{0}/{1}{2}".format( slack_ver(), location, name) return http diff --git a/slpkg/slack/patches.py b/slpkg/slack/patches.py index d1308955..20646469 100755 --- a/slpkg/slack/patches.py +++ b/slpkg/slack/patches.py @@ -29,7 +29,7 @@ import subprocess from colors import colors from url_read import url_read from messages import template -from __metadata__ import pkg_path, slpkg_tmp +from __metadata__ import pkg_path, slpkg_tmp, sp from pkg.manager import pkg_upgrade @@ -84,14 +84,19 @@ def patches(): template(78) print "| Package", " "*33, "Arch", " "*3, "Build", " ", "Repos", " ", "Size" template(78) + print("Upgrading:") for upgrade in upgrade_all: for size in comp_list: if upgrade in size: Kb = size.replace(upgrade, "") if "-noarch-" in upgrade: arch = "noarch" - elif "-"+os.uname()[4]+"-" in upgrade: + elif sp+os.uname()[4]+sp in upgrade: arch = os.uname()[4] + elif "-i486-" in upgrade: + arch = "i486" + elif "-i686-" in upgrade: + arch = "i686" elif "-x86-" in upgrade: arch = "x86" elif "-fw-" in upgrade: @@ -103,9 +108,11 @@ def patches(): else: slack = "" print " ", upgrade[:-(5+len(slack))].replace( - "-"+arch+"-", ""), " "*(48-len(upgrade[:-( - 5+len(slack))])), arch, " ", upgrade[-15:-14].replace( - "-"+arch+"-", ""), " "*5, "Slack", " ", Kb, " "*(3-len(Kb)), "K" + 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", " ", Kb, " "*( + 3-len(Kb)), "K" for dwn in dwn_list: if "/" + upgrade in dwn: dwn_patches.append(dwn)