updated for version 1.9.0

This commit is contained in:
Dimitris Zlatanidis 2014-09-25 01:40:55 +03:00
parent 7ae7af71d0
commit 97cba1a317
13 changed files with 39 additions and 214 deletions

View file

@ -1,3 +1,9 @@
Version 1.9.0
24-09-2014
[Updated] - Fix arguments.
- Replace less command with pydoc.
Version 1.8.9 Version 1.8.9
23-09-2014 23-09-2014

View file

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

View file

@ -7,9 +7,9 @@
Latest Release: Latest Release:
- Version: 1.8.9 - Version: 1.9.0
- `Package <https://sourceforge.net/projects/slpkg/files/slpkg/binary/>`_ - `Package <https://sourceforge.net/projects/slpkg/files/slpkg/binary/>`_
- `Source <https://github.com/dslackw/slpkg/archive/v1.8.9.tar.gz>`_ - `Source <https://github.com/dslackw/slpkg/archive/v1.9.0.tar.gz>`_
- `CHANGELOG <https://github.com/dslackw/slpkg/blob/master/CHANGELOG>`_ - `CHANGELOG <https://github.com/dslackw/slpkg/blob/master/CHANGELOG>`_
.. image:: https://raw.githubusercontent.com/dslackw/images/master/slpkg/logo.png .. 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 .. code-block:: bash
$ tar xvf slpkg-1.8.9.tar.gz $ tar xvf slpkg-1.9.0.tar.gz
$ cd slpkg-1.8.9 $ cd slpkg-1.9.0
$ ./install.sh $ ./install.sh
Using `pip <https://pip.pypa.io/en/latest/>`_ : Using `pip <https://pip.pypa.io/en/latest/>`_ :
@ -331,7 +331,8 @@ Find packages from slackbuilds.org:
Build Download and build this package Build Download and build this package
Install Download/Build/Install Install Download/Build/Install
Quit Quit Quit Quit
_
> _
Auto tool to build package: Auto tool to build package:
@ -457,8 +458,8 @@ Find installed packages:
[ installed ] - xf86dgaproto-2.1-noarch-1 [ installed ] - xf86dgaproto-2.1-noarch-1
[ installed ] - xineramaproto-1.2.1-noarch-1 [ installed ] - xineramaproto-1.2.1-noarch-1
Found 4 matcing packages Total found 4 matcing packages
Total size of installed packages 1.61 Mb Size of installed packages 1.61 Mb
Display the contents of the packages: Display the contents of the packages:

View file

@ -21,7 +21,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=slpkg PRGNAM=slpkg
VERSION=${VERSION:-1.8.9} VERSION=${VERSION:-1.9.0}
TAG=${TAG:-_dsw} TAG=${TAG:-_dsw}
cd .. cd ..

View file

@ -125,166 +125,10 @@ command.
.br .br
For example: For example:
\fBslpkg \-\-help\fP - display help for slpkg \fBslpkg \-\-help\fP - display help for slpkg
.SH EXAMPLES
$ \fBslpkg -t brasero\fP
Reading package lists...... Done
+=========================
| brasero dependencies :
+=========================
\\
+---[ Tree of dependencies ]
|
--1: orc
|
--2: gstreamer1
|
--3: gst1-plugins-base
|
--4: gst1-plugins-bad
|
--5: libunique
$ \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
Installing summary
===============================================================================
Total 6 packages.
2 packages will be installed, 3 allready installed and 1 packages
will be upgraded.
Do you want to continue [Y/n]? y
.
.
.
+==============================================================================
| Installing new package /tmp/brasero-3.11.3-x86_64-1_SBo.tgz
+==============================================================================
Verifying package brasero-3.11.3-x86_64-1_SBo.tgz.
Installing package brasero-3.11.3-x86_64-1_SBo.tgz:
PACKAGE DESCRIPTION:
# brasero (CD/DVD burning application)
#
# Brasero is a application to burn CD/DVD for the Gnome Desktop. It is
# designed to be as simple as possible and has some unique features to
# enable users to create their discs easily and quickly.
#
# Homepage: http://projects.gnome.org/brasero
#
Executing install script for brasero-3.11.3-x86_64-1_SBo.tgz.
Package brasero-3.11.3-x86_64-1_SBo.tgz installed.
$ \fBslpkg -c sbo upgrade\fP
Reading package lists. Done
These packages need upgrading:
+==============================================================================
| Package New version Arch Repository
+==============================================================================
Upgrading:
six-1.7.1 1.7.3 x86_64 SBo
pysetuptools-3.4 3.6 x86_64 SBo
Jinja2-2.7.0 2.7.2 x86_64 SBo
pysed-0.3.0 0.3.1 x86_64 SBo
Pafy-0.3.56 0.3.58 x86_64 SBo
MarkupSafe-0.21 0.23 x86_64 SBo
pip-1.5.3 1.5.6 x86_64 SBo
colored-1.1.1 1.1.4 x86_64 SBo
Installing summary
===============================================================================
Total 8 packages will be upgraded and 0 package will be installed.
Would you like to upgrade [Y/n]?
$ \fBslpkg -c slack upgrade\fp
Reading package lists....... Done
Slackware64 v14.1 distribution is up to date
$ \fBslpkg -n termcolor\fP
Reading package lists. Done
+==============================================================================
| Package termcolor --> http://slackbuilds.org/repository/14.1/python/termcolor/
+==============================================================================
| Description : ANSII Color formatting for output in terminal
| SlackBuild : termcolor.tar.gz
| Source : termcolor-1.1.0.tar.gz
| Requirements :
+===============================================================================
README View the README file
SlackBuild View the SlackBuild file
Info View the Info file
Download Download this package
Build Download and build this package
Install Download/Build/Install
_
Two files termcolor.tar.gz and termcolor-1.1.0.tar.gz
must be in the same directory.
$ \fBslpkg -a termcolor.tar.gz termcolor-1.1.0.tar.gz\fP
Slackware package /tmp/termcolor-1.1.0-x86_64-1_SBo.tgz created.
$ \fBslpkg -u /tmp/termcolor-1.1.0-x86_64-1_SBo.tgz\fP
Installing new package ./termcolor-1.1.0-x86_64-1_SBo.tgz
$ \fBslpkg -r termcolor yetris\fP
Packages with name matching [ termcolor, yetris ]
[ delete ] -- > termcolor-1.1.0-x86_64-1_SBo
No such package yetris: Can't find
Are you sure to remove 1 package(s) [Y/y]
Package: termcolor-1.1.0-x86_64-1_SBo
Package: yetris-2.0.1-x86_64-1_SBo
Removing...
Package termcolor removed
$ \fBslpkg -f termcolor\fP
Installed packages with name matching [ termcolor ]
No package was found to match
$ \fBslpkg -d termcolor\fP
No such package termcolor: Can't dislpay
$ \fBslpkg -v\fP
Version: x.x.x
.SH AUTHOR .SH AUTHOR
Dimitris Zlatanidis <d.zlatanidis@gmail.com> Dimitris Zlatanidis <d.zlatanidis@gmail.com>
.SH HOMEPAGE
https://github.com/dslackw/slpkg
.SH COPYRIGHT .SH COPYRIGHT
Copyright \(co 2014 Dimitris Zlatanidis Copyright \(co 2014 Dimitris Zlatanidis

View file

@ -23,7 +23,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=slpkg PRGNAM=slpkg
VERSION=${VERSION:-1.8.9} VERSION=${VERSION:-1.9.0}
BUILD=${BUILD:-1} BUILD=${BUILD:-1}
TAG=${TAG:-_dsw} TAG=${TAG:-_dsw}

View file

@ -1,7 +1,7 @@
PRGNAM="slpkg" PRGNAM="slpkg"
VERSION="1.8.9" VERSION="1.9.0"
HOMEPAGE="https://github.com/dslackw/slpkg" HOMEPAGE="https://github.com/dslackw/slpkg"
DOWNLOAD="https://github.com/dslackw/slpkg/archive/v1.8.9.tar.gz" DOWNLOAD="https://github.com/dslackw/slpkg/archive/v1.9.0.tar.gz"
MD5SUM="" MD5SUM=""
DOWNLOAD_x86_64="" DOWNLOAD_x86_64=""
MD5SUM_x86_64="" MD5SUM_x86_64=""

View file

@ -26,7 +26,7 @@ import subprocess
__all__ = "slpkg" __all__ = "slpkg"
__author__ = "dslackw" __author__ = "dslackw"
__version_info__ = (1, 8, 9) __version_info__ = (1, 9, 0)
__version__ = "{0}.{1}.{2}".format(*__version_info__) __version__ = "{0}.{1}.{2}".format(*__version_info__)
__license__ = "GNU General Public License v3 (GPLv3)" __license__ = "GNU General Public License v3 (GPLv3)"
__email__ = "d.zlatanidis@gmail.com" __email__ = "d.zlatanidis@gmail.com"

View file

@ -27,11 +27,4 @@ def get_file(link, char):
''' '''
Get filename from links Get filename from links
''' '''
i = 0 return link.split(char)[-1]
results = []
for file in range(len(link)):
i -= 1
results.append(link[i])
if link[i] == char:
break
return ("".join(results[::-1]).replace("/", "").strip())

View file

@ -56,7 +56,7 @@ def err1_args(invalid, choices):
''' '''
Print error message arguments Print error message arguments
''' '''
print("{0}: error: invalid choice: '{1}' choose from {2}".format( print("{0}: error: invalid choice: '{1}' (choose from {2})".format(
__all__, invalid, choices)) __all__, invalid, choices))
def err2_args(choices): def err2_args(choices):

View file

@ -26,27 +26,14 @@ import os
from url_read import url_read from url_read import url_read
from __metadata__ import slpkg_tmp from __metadata__ import slpkg_tmp
# create directories if not exist def read_readme(sbo_url, sbo_readme):
rdm_path = slpkg_tmp + "readme/"
if not os.path.exists(slpkg_tmp):
os.mkdir(slpkg_tmp)
if not os.path.exists(rdm_path):
os.mkdir(rdm_path)
def read_readme(sbo_url, name, site):
''' '''
Read SlackBuild README file Read SlackBuild README file
''' '''
readme = url_read(sbo_url + site) return url_read(sbo_url + sbo_readme)
with open("{0}{1}.{2}".format(rdm_path, name, site), "w") as f:
f.write(readme)
f.close()
def read_info_slackbuild(sbo_url, name, site): def read_info_slackbuild(sbo_url, name, sbo_file):
''' '''
Read info SlackBuild file Read info and SlackBuild file
''' '''
info = url_read(sbo_url + name + site) return url_read(sbo_url + name + sbo_file)
with open("{0}{1}{2}".format(rdm_path, name, site), "w") as f:
f.write(info)
f.close()

View file

@ -23,11 +23,12 @@
import os import os
import sys import sys
import pydoc
import subprocess import subprocess
from colors import colors from colors import colors
from functions import get_file from functions import get_file
from __metadata__ import tmp, build_path, pkg_path, slpkg_tmp, sp from __metadata__ import tmp, build_path, pkg_path, sp
from messages import pkg_not_found, pkg_found, view_sbo, template, build_FAILED from messages import pkg_not_found, pkg_found, view_sbo, template, build_FAILED
from pkg.build import build_package from pkg.build import build_package
@ -45,7 +46,6 @@ def sbo_network(name):
View SlackBuild package, read or install them View SlackBuild package, read or install them
from slackbuilds.org from slackbuilds.org
''' '''
rdm_path = slpkg_tmp + "readme/"
sys.stdout.write("{0}Reading package lists ...{1}".format( sys.stdout.write("{0}Reading package lists ...{1}".format(
colors.GREY, colors.ENDC)) colors.GREY, colors.ENDC))
sys.stdout.flush() sys.stdout.flush()
@ -68,7 +68,7 @@ def sbo_network(name):
FAULT = "".join(source_dwn) FAULT = "".join(source_dwn)
while True: while True:
try: try:
read = raw_input("_ ") read = raw_input(" {0}>{1} ".format(colors.GREY, colors.ENDC))
except KeyboardInterrupt: except KeyboardInterrupt:
print # new line at exit print # new line at exit
break break
@ -80,20 +80,14 @@ def sbo_network(name):
print("Complete!\n") print("Complete!\n")
break break
elif read == "R" or read == "r": elif read == "R" or read == "r":
site = "README" readme = "README"
read_readme(sbo_url, name, site) pydoc.pager(read_readme(sbo_url, readme))
subprocess.call("less {0}{1}.{2}".format(rdm_path, name, site), shell=True)
os.remove("{0}{1}.{2}".format(rdm_path, name, site))
elif read == "F" or read == "f": elif read == "F" or read == "f":
site = ".info" _info = ".info"
read_info_slackbuild(sbo_url, name, site) pydoc.pager(read_info_slackbuild(sbo_url, name, _info))
subprocess.call("less {0}{1}{2}".format(rdm_path, name, site), shell=True)
os.remove("{0}{1}{2}".format(rdm_path, name, site))
elif read == "S" or read == "s": elif read == "S" or read == "s":
site = ".SlackBuild" _SlackBuild = ".SlackBuild"
read_info_slackbuild(sbo_url, name, site) pydoc.pager(read_info_slackbuild(sbo_url, name, _SlackBuild))
subprocess.call("less {0}{1}{2}".format(rdm_path, name, site), shell=True)
os.remove("{0}{1}{2}".format(rdm_path, name, site))
elif read == "B" or read == "b": elif read == "B" or read == "b":
if FAULT: if FAULT:
print("\n{0}The package {1}{2}\n".format(colors.RED, FAULT, colors.ENDC)) print("\n{0}The package {1}{2}\n".format(colors.RED, FAULT, colors.ENDC))

View file

@ -56,7 +56,7 @@ def install(slack_pkg):
if not os.path.exists(tmp_path): if not os.path.exists(tmp_path):
os.mkdir(tmp_path) os.mkdir(tmp_path)
print("\nPackages with name matching [ {0}{1}{2} ]\n".format( print("\nPackages with name matching [ {0}{1}{2} ]\n".format(
colors.CYAN, slack_pkg, ENDC)) colors.CYAN, slack_pkg, ENDC))
sys.stdout.write ("{0}Reading package lists ...{1}".format(colors.GREY, ENDC)) sys.stdout.write ("{0}Reading package lists ...{1}".format(colors.GREY, ENDC))
sys.stdout.flush() sys.stdout.flush()
PACKAGES = url_read(mirrors(name="PACKAGES.TXT", location="")) PACKAGES = url_read(mirrors(name="PACKAGES.TXT", location=""))