updated for version 1.4.7

This commit is contained in:
dslackw 2014-06-05 13:25:50 +03:00
parent 8d9ef4965a
commit 0ac8642d9f
6 changed files with 110 additions and 26 deletions

View file

@ -1,3 +1,8 @@
04-06-2014
Version 1.4.7
[Feature] - Added download/build/install in choises (-n) network and (-c) check
05-06-2014
Version 1.4.6

View file

@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: slpkg
Version: 1.4.6
Version: 1.4.7
Author: dslackw
Author-email: d zlatanidis at gmail com
Maintainer: dslackw

View file

@ -174,6 +174,8 @@ Check if your packages is up to date (www.slackbuilds.org):
| flashplayer-plugin 11.2.202.356
+==================================================
Would you like to install ? [Y/y]
$ slpkg -c ranger
Searching `ranger` from slackbuilds.org ...
@ -207,6 +209,7 @@ Find slackbuild from network (www.slackbuilds.org):
Info View the Info file
Download Download this package
Build Download and build this package
Install Download/Build/Install
_

118
bin/slpkg
View file

@ -51,7 +51,7 @@ import subprocess
__author__ = "dslackw"
__version__ = "1.4.6"
__version__ = "1.4.7"
__license__ = "GNU General Public License v3 (GPLv3)"
__email__ = "d.zlatanidis@gmail.com"
@ -498,6 +498,7 @@ def SBo_network(name):
# call sbo functions
SBo_req = SBo_requires_pkg(SBo_url, name)
SBo_dwn = SBo_slackbuild_dwn(SBo_url, name)
SBo_version = SBo_version_pkg(SBo_url, name)
source_dwn = SBo_source_dwn(SBo_url, name)
extra_dwn = " ".join(SBo_extra_dwn(SBo_url, name))
@ -521,12 +522,15 @@ def SBo_network(name):
print ("+" + "=" * SBo_url_len)
print (" {}R{}EADME View the README file".format(colors.RED, colors.ENDC))
print (" {}S{}lackBuild View the SlackBuild file".format(colors.RED, colors.ENDC))
print (" {}I{}nfo View the Info file".format(colors.RED, colors.ENDC))
print (" In{}f{}o View the Info file".format(colors.RED, colors.ENDC))
print (" {}D{}ownload Download this package".format(colors.RED, colors.ENDC))
print (" {}B{}uild Download and build this package".format(colors.RED, colors.ENDC))
print (" {}I{}nstall Download/Build/Install".format(colors.RED, colors.ENDC))
print
while True:
read = raw_input("_ ")
if read == "D" or read == "d":
print
print ("{}Start -->{}\n".format(colors.GREEN, colors.ENDC))
@ -538,9 +542,6 @@ def SBo_network(name):
else:
os.system("wget " + extra_dwn)
print ("{}Use {}`slpkg -a`{} to build this package{}\n".format(colors.YELLOW,
colors.CYAN, colors.YELLOW, colors.ENDC))
break
elif read == "R" or read == "r":
@ -548,7 +549,7 @@ def SBo_network(name):
read_readme(SBo_url, name, site)
os.system("less /tmp/slpkg/readme/" + name + ".{}".format(site))
elif read == "I" or read == "i":
elif read == "F" or read == "f":
site = ".info"
read_info_slackbuild(SBo_url, name, site)
os.system("less /tmp/slpkg/readme/" + name + "{}".format(site))
@ -568,10 +569,9 @@ def SBo_network(name):
os.system("wget -nc " + source_dwn)
extra = []
if extra_dwn == "":
pass
else:
os.system("wget -nc " + extra_dwn)
if extra_dwn != "":
os.system("wget -nc " + extra_dwn)
extra_dwn = extra_dwn.split() # convert str to list
for ex in extra_dwn:
extra.append(get_file(ex, "/"))
@ -581,7 +581,43 @@ def SBo_network(name):
build_package(script, source)
break
elif read == "I" or read == "i":
s_user(getpass.getuser())
pkg_for_install = name + "-" + SBo_version
if find_package(pkg_for_install, packages) == []:
script = get_file(SBo_dwn, "/")
source = get_file(source_dwn, "/")
print
print ("{}Start -->{}\n".format(colors.GREEN, colors.ENDC))
os.system("wget -nc " + SBo_dwn)
os.system("wget -nc " + source_dwn)
extra = []
if extra_dwn != "":
os.system("wget -nc " + extra_dwn)
extra_dwn = extra_dwn.split() # convert str to list
for ex in extra_dwn:
extra.append(get_file(ex, "/"))
build_extra_pkg(script, source, extra)
install_pkg = tmp + pkg_for_install + SBo_arch + SBo_tag + SBo_filetype
os.system("upgradepkg --install-new {}".format(install_pkg))
break
build_package(script, source)
install_pkg = tmp + pkg_for_install + SBo_arch + SBo_tag + SBo_filetype
os.system("upgradepkg --install-new {}".format(install_pkg))
break
else:
print
print ("{}The package {}`{}`{} is arlready installed{}".format(colors.YELLOW,
colors.CYAN, pkg_for_install, colors.YELLOW, colors.ENDC))
print
break
else:
break
@ -591,6 +627,7 @@ def SBo_network(name):
# check if packages from www.slackbuilds.org is up to date
def SBo_check(name):
SBo_file = " ".join(find_package(name, packages))
if SBo_file == "":
print
print (" {}The package {}`{}`{} not found on your system{}\n".format(colors.RED,
@ -598,26 +635,62 @@ def SBo_check(name):
else:
SBo_url = SBo_search_pkg(name)
if SBo_url == None:
print ("\n")
print ("{}The {}`{}`{} not found{}\n".format(colors.RED,
colors.CYAN, name, colors.RED, colors.ENDC))
print ("\n")
print ("{}The {}`{}`{} not found{}\n".format(colors.RED,
colors.CYAN, name, colors.RED, colors.ENDC))
else:
SBo_version = SBo_version_pkg(SBo_url, name)
name_len = len(name)
arch_len = len(arch)
SBo_file = SBo_file[name_len+1:-arch_len-7]
SBo_version = SBo_version_pkg(SBo_url, name)
SBo_dwn = SBo_slackbuild_dwn(SBo_url, name)
source_dwn = SBo_source_dwn(SBo_url, name)
extra_dwn = " ".join(SBo_extra_dwn(SBo_url, name))
if SBo_version > SBo_file:
print ("\n")
name_len = len(name)
arch_len = len(arch)
SBo_file = SBo_file[name_len+1:-arch_len-7]
if SBo_version > SBo_file:
print ("\n")
print ("{} New version is available !!!{}".format(colors.YELLOW, colors.ENDC))
print ("+" + "=" * 50)
print ("| {} {}".format(name, SBo_version))
print ("+" + "=" * 50)
print
read = raw_input("Would you like to install ? [Y/y] ")
if read == "Y" or read == "y":
s_user(getpass.getuser())
pkg_for_install = name + "-" + SBo_version
script = get_file(SBo_dwn, "/")
source = get_file(source_dwn, "/")
print
print ("{}Start -->{}\n".format(colors.GREEN, colors.ENDC))
os.system("wget -nc " + SBo_dwn)
os.system("wget -nc " + source_dwn)
extra = []
if extra_dwn != "":
os.system("wget -nc " + extra_dwn)
extra_dwn = extra_dwn.split() # convert str to list
for ex in extra_dwn:
extra.append(get_file(ex, "/"))
build_extra_pkg(script, source, extra)
install_pkg = tmp + pkg_for_install + SBo_arch + SBo_tag + SBo_filetype
os.system("upgradepkg --install-new {}".format(install_pkg))
sys.exit()
build_package(script, source)
install_pkg = tmp + pkg_for_install + SBo_arch + SBo_tag + SBo_filetype
os.system("upgradepkg --install-new {}".format(install_pkg))
print
else:
else:
print ("\n")
print ("{}Your package is up to date{}\n".format(colors.GREEN, colors.ENDC))
@ -628,7 +701,6 @@ def SBo_build(name):
s_user(getpass.getuser())
dependencies_links = SBo_dependencies_links_pkg(name)
# crate one list for all
if dependencies_links == None:
sys.exit()
@ -808,7 +880,7 @@ def pkg_reinstall(name):
def pkg_remove(name):
s_user(getpass.getuser())
print ("{}!!! WARNING !!!{}".format(colors.RED, colors.ENDC))
remove_pkg = raw_input("Are you sure to remove this package(s) [y/n] ")
remove_pkg = raw_input("Are you sure to remove this package(s) [Y/y] ")
print
if remove_pkg == "y" or remove_pkg == "Y":
for i in range(len(name)):

View file

@ -170,6 +170,9 @@ $ \fBslpkg -c flashplayer-plugin\fP
| flashplayer-plugin 11.2.202.356
+==================================================
Would you like to install ? [Y/y]
$ \fBslpkg -n termcolor\fP
Searching 'termcolor' from slackbuilds.org ...
@ -187,6 +190,7 @@ $ \fBslpkg -n termcolor\fP
Info View the Info file
Download Download this package
Build Download and build this package
Install Download/Build/Install
_

View file

@ -7,7 +7,7 @@ from distutils.core import setup
setup(
name = 'slpkg',
version = "1.4.6",
version = "1.4.7",
description = "Python tool to manage Slackware packages",
keywords = ["slackware", "slpkg", "upgrade", "install", "remove",
"view", "slackpkg", "tool"],