updated for version 1.6.9

This commit is contained in:
dslackw 2014-08-04 03:02:38 +03:00
parent 9591db7f71
commit 9c318564b8
23 changed files with 285 additions and 189 deletions

View file

@ -1,3 +1,15 @@
04-08-2014
Version 1.6.9
[Updated] - Remove non-useful code
Fix /tmp/slpkg/readme/ path create
[Feature] - Added build path, drop all packages in Slpkg_Build directory
Added build and install packages only if new version available and
package not installed (slpkg -s sbo)
Added display installed packages in tracking dependencies
01-08-2014
Version 1.6.8

142
PKG-INFO
View file

@ -1,11 +1,12 @@
Metadata-Version: 1.1
Name: slpkg
Version: 1.6.8
Version: 1.6.9
Author: dslackw
Author-email: d zlatanidis at gmail com
Maintainer: dslackw
Maintainer-email: d zlatanidis at gmail com
Home-page: https://github.com/dslackw/slpkg
Download-url: http://sourceforge.net/projects/slpkg
Summary: Utility for easy management packages in Slackware
Description: .. image:: https://badge.fury.io/py/slpkg.png
:target: http://badge.fury.io/py/slpkg
@ -13,14 +14,20 @@ Description: .. image:: https://badge.fury.io/py/slpkg.png
:target: https://pypi.python.org/pypi/slpkg
.. image:: https://pypip.in/license/slpkg/badge.png
:target: https://pypi.python.org/pypi/slpkg
.. image:: https://raw.githubusercontent.com/dslackw/images/master/slpkg/logo.png
:target: https://github.com/dslackw/slpkg
Slpkg is a terminal multitool in order to easy use Slackware packages.
Slpkg is a terminal multitool in order to easy use `Slackware
<http://www.slackware.com/>`_ packages.
Features
========
- Build packages from source with all dependencies
- Find and Download packages from slackbuilds.org
- Build third party packages from source with all dependencies
- Install packages through from official `Slackware <http://www.slackware.com/>`_
mirrors
- Find and Download packages from `slackbuilds.org <http://slackbuilds.org/>`_
- Grabs packages from slackbuilds.org in real time
- Automatic tool build and install packages
- Check if your distribution is up to date
- Display the contents of the packages
@ -34,7 +41,8 @@ Description: .. image:: https://badge.fury.io/py/slpkg.png
- Remove packages
- No dependencies
It's a quick and easy way to manage your packages in slackware
It's a quick and easy way to manage your packages in `Slackware
<http://www.slackware.com/>`_
to a command.
`[CHANGELOG] <https://github.com/dslackw/slpkg/blob/master/CHANGELOG>`_
@ -44,22 +52,12 @@ Description: .. image:: https://badge.fury.io/py/slpkg.png
.. image::
https://raw.githubusercontent.com/dslackw/images/master/slpkg/screenshot-1.png
:target: https://asciinema.org/a/11059
:target: https://asciinema.org/a/11183
Installation
------------
Using slackware command:
.. code-block:: bash
Download from SlackBuilds http://slackbuilds.org
or
using sbopkg tool SBOPKG http://www.sbopkg.org
Using pip:
Using `pip <https://pip.pypa.io/en/latest/>`_ (best way to have last updates):
.. code-block:: bash
@ -69,14 +67,28 @@ https://raw.githubusercontent.com/dslackw/images/master/slpkg/screenshot-1.png
$ pip uninstall slpkg
Using Slackware command:
.. code-block:: bash
Download http://slackbuilds.org/repository/14.1/system/slpkg from
slackbuilds.org
using SBOPKG http://www.sbopkg.org
Download binary package from SourceForge:
.. code-block:: bash
Download https://sourceforge.net/projects/slpkg
Command Line Tool Usage
-----------------------
=======================
.. code-block:: bash
usage: slpkg [-h] [-v] [-a script [source ...]]
[-l all, sbo, slack, noarch, other [all, sbo, slack, noarch,
other ...]]
[-l all, sbo, slack, noarch, other]
[-c sbo, slack [sbo, slack ...]]
[-s sbo, slack [sbo, slack ...]] [-t] [-n] [-i [...]]
[-u [...]] [-o [...]] [-r [...]] [-f [...]] [-d [...]]
@ -88,19 +100,19 @@ other ...]]
-v, --verbose print version and exit
-a script [source ...]
auto build package
-l all, sbo, slack, noarch, other [all, sbo, slack, noarch, other ...]
-l all, sbo, slack, noarch, other
list of installed packages
-c sbo, slack [sbo, slack ...]
check if your packages is up to date
-s sbo, slack [sbo, slack ...]
download, build & install packages
-t tracking dependencies
-n find packages from SBo repository
-n view packages from SBo repository
-i [ ...] install binary packages
-u [ ...] upgrade binary packages
-o [ ...] reinstall binary packages
-r [ ...] remove packages
-f [ ...] find if packages installed
-f [ ...] view installed packages
-d [ ...] display the contents of the packages
@ -115,20 +127,22 @@ other ...]]
$ slpkg -s sbo brasero
+==============================================================================
| Build dependecies tree for package brasero
| Build dependencies tree for package brasero:
+==============================================================================
Searching [ brasero ] from slackbuilds.org ...
Searching [ libunique ] from slackbuilds.org ...
Searching [ gst1-plugins-bad ] from slackbuilds.org ...
Searching [ gst1-plugins-base ] from slackbuilds.org ...
Searching [ gstreamer1 ] from slackbuilds.org ...
Searching [ orc ] from slackbuilds.org ...
[ found ] --> brasero
[ found ] --> libunique
[ found ] --> gst1-plugins-bad
[ found ] --> gst1-plugins-base
[ found ] --> gstreamer1
[ found ] --> orc
+==============================================================================
| Start download, build and install packages
+==============================================================================
Searching [ orc ] from slackbuilds.org ...
[ found ] --> orc
.
.
.
+==============================================================================
| Installing new package /tmp/brasero-3.11.3-x86_64-1_SBo.tgz
+==============================================================================
@ -147,15 +161,6 @@ other ...]]
Executing install script for brasero-3.11.3-x86_64-1_SBo.tgz.
Package brasero-3.11.3-x86_64-1_SBo.tgz installed.
+==============================================================================
| Package orc installed
| Package gstreamer1 installed
| Package gst1-plugins-base installed
| Package gst1-plugins-bad installed
| Package libunique installed
| Package brasero installed
+==============================================================================
Find packages from `Slackware official mirrors <http://mirrors.slackware.com/>`_
download and install:
@ -177,11 +182,20 @@ other ...]]
$ slpkg -t brasero
Search dependencies for package brasero from slackbuilds.org:
[ found ] --> brasero
[ found ] --> libunique
[ found ] --> gst1-plugins-bad
[ found ] --> gst1-plugins-base
[ found ] --> gstreamer1
[ found ] --> orc
+=========================
| brasero dependencies :
+=========================
\
+---[ Tree of dependecies ]
+---[ Tree of dependencies ]
|
+-- 1 orc
|
@ -196,7 +210,10 @@ other ...]]
.. code-block:: bash
$ slpkg -c sbo flashplayer-plugin
Searching [ flashplayer-plugin ] from slackbuilds.org ...
Search for package flashplayer-plugin from slackbuilds.org:
[ found ] --> flashplayer-plugin
New version is available:
+==============================================================================
@ -206,29 +223,41 @@ other ...]]
Would you like to install ? [Y/y]
$ slpkg -c sbo ranger
Searching [ ranger ] from slackbuilds.org ...
Search for package ranger from slackbuilds.org:
Package ranger is up to date
[ found ] --> ranger
Package ranger-1.6.1-x86_64-1_SBo is up to date
$ slpkg -c sbo termcolor
No such package termcolor: Can't find
No such package termcolor: Not installed
Check if your distribution is up to date from `Slackware official mirrors
<http://mirrors.slackware.com/>`_
<http://mirrors.slackware.com/>`_
.. code-block:: bash
$ slpkg -c slack upgrade
Your system is up to date
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
Would you like to upgrade ? [Y/y]
Find slackbuild from slackbuilds.org:
.. code-block:: bash
$ slpkg -n bitfighter
Searching [ bitfighter ] from slackbuilds.org ...
Search for package bitfighter from slackbuilds.org:
[ found ] --> bitfighter
+===============================================================================
| Package bitfighter -->
@ -281,11 +310,13 @@ http://slackbuilds.org/repository/14.1/games/bitfighter/
creating /tmp/SBo/package-termcolor/usr/lib64/python2.7
creating /tmp/SBo/package-termcolor/usr/lib64/python2.7/site-packages
copying build/lib/termcolor.py ->
/tmp/SBo/package-termcolor/usr/lib64/python2.7/site-packages
/tmp/SBo/package-termcolor/usr/lib64/python2.7/site-packages
byte-compiling
/tmp/SBo/package-termcolor/usr/lib64/python2.7/site-packages/termcolor.py to termcolor.pyc
/tmp/SBo/package-termcolor/usr/lib64/python2.7/site-packages/termcolor.py
to termcolor.pyc
running install_egg_info
Writing
/tmp/SBo/package-termcolor/usr/lib64/python2.7/site-packages/termcolor-1.1.0-py2.7.egg-info
Slackware package maker, version 3.14159.
@ -361,6 +392,9 @@ http://slackbuilds.org/repository/14.1/games/bitfighter/
.. code-block:: bash
$ slpkg -f termcolor lua yetris you-get rar pip
Packages with name matching [ termcolor, lua, yetris, you-get, rar, pip ]
[ installed ] - termcolor-1.1.0-x86_64-1_SBo
No such package lua: Cant find
[ installed ] - yetris-2.0.1-x86_64-1_SBo
@ -421,7 +455,9 @@ http://slackbuilds.org/repository/14.1/games/bitfighter/
.. code-block:: bash
$ slpkg -r termcolor
Packages with name matching [ termcolor ]
[ delete ] --> termcolor-1.1.0-x86_64-1_SBo
Are you sure to remove 1 package(s) [Y/y] y
@ -454,6 +490,8 @@ http://slackbuilds.org/repository/14.1/games/bitfighter/
$ slpkg -f termcolor lua rar
Packages with name matching [ termcolor, lua, rar ]
No such package termcolor: Cant find
No such package lua: Cant find
[ installed ] - rar-5.0.1-x86_64-1_SBo

View file

@ -56,15 +56,11 @@ Using `pip <https://pip.pypa.io/en/latest/>`_ (best way to have last updates):
Using Slackware command:
`[Download] <http://slackbuilds.org/repository/14.1/system/slpkg/>`_ from slackbuilds.org
Download http://slackbuilds.org/repository/14.1/system/slpkg from slackbuilds.org
or
using `SBOPKG <http://www.sbopkg.org>`_ tool
Using SBOPKG http://www.sbopkg.org
Download binary package from SourceForge:
`[Download] <https://sourceforge.net/projects/slpkg>`_ slpkg
Command Line Tool Usage
-----------------------
@ -90,12 +86,12 @@ Command Line Tool Usage
check if your packages is up to date
-s sbo, slack [sbo, slack ...]
download, build & install packages
-t tracking dependencies
-t packages tracking dependencies from SBo
-n view packages from SBo repository
-i [ ...] install binary packages
-u [ ...] upgrade binary packages
-o [ ...] reinstall binary packages
-r [ ...] remove packages
-r [ ...] remove binary packages
-f [ ...] view installed packages
-d [ ...] display the contents of the packages
@ -181,13 +177,17 @@ Tracking all dependencies of packages:
\
+---[ Tree of dependencies ]
|
+-- 1 orc
+--1 orc
|
+-- 1 gstreamer1
+--2 gstreamer1
|
+-- 1 gst1-plugins-base
+--3 gst1-plugins-base
|
+-- 2 libunique, gst1-plugins-bad
+--4 gst1-plugins-bad
|
+--5 libunique
NOTE: green installed, red not installed
Check if your packages is up to date from slackbuilds.org:

View file

@ -34,12 +34,12 @@ It's a quick and easy way to manage your packages in slackware to a command.
\fB-s sbo, slack [sbo, slack ...]\fP
\fB download, build & install packages\fP
\fB list of installed packages\fP
\fB-t tracking dependencies\fP
\fB-t packages tracking dependencies from SBo\fP
\fB-n view packages from SBo repositority\fP
\fB-i [ ...] install binary packages\fP
\fB-u [ ...] upgrade binary packages\fP
\fB-o [ ...] reinstall binary packages\fP
\fB-r [ ...] remove packages\fP
\fB-r [ ...] remove binary packages\fP
\fB-f [ ...] view installed packages\fP
\fB-d [ ...] display the contents of the packages\fP
@ -75,13 +75,13 @@ the network. (www.slackbuilds.org)
.PP
Check your packages from Slackware official mirrors or from
slackbuilds.org is up to date.
.SS -s , sbo, slack [sbo, slack ...] find, download, build and install
package with all dependencies
.SS -s , sbo, slack [sbo, slack ...] find, download, build and install package with all dependencies
\fBslpkg\fP \fB-s\fP <\fIsbo\fP> <\fIslack\fP> <\fIname of package\fP>
.PP
Find package from slackbuild.org with all dependencies,
download, build and install them. Even download and install official
packages from Slackware official mirrors and install.
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.
.SS -i , install binary package
\fBslpkg\fP \fB-i\fP <\fIpackages.t?z\fP>
.PP
@ -131,16 +131,20 @@ $ \fBslpkg -t brasero\fP
+=========================
| brasero dependencies :
+=========================
\
\\
+---[ Tree of dependencies ]
|
-- 1 orc
--1: orc
|
-- 1 gstreamer1
--2: gstreamer1
|
-- 1 gst1-plugins-base
--3: gst1-plugins-base
|
-- 2 libunique gst1-plugins-bad
--4: gst1-plugins-bad
|
--5: libunique
NOTE: green installed, red not installed
$ \fBslpkg -s sbo brasero\fP

View file

@ -1,11 +1,15 @@
Slpkg is a terminal tool in order to easy use Slackware packages.
Slpkg is a terminal multitool in order to easy use Slackware
packages.
Features
--------
========
- Build packages from source with all dependencies
- Build third party packages from source with all dependencies
- Install packages through from official Slackware mirrros
- Find and Download packages from slackbuilds.org
- Grabs packages from slackbuilds.org in real time
- Automatic tool build and install packages
- Check if your distribution is up to date
- Display the contents of the packages
- Install-upgrade Slackware packages
- Build and install all in a command
@ -17,5 +21,5 @@ Features
- Remove packages
- No dependencies
It's a quick and easy way to manage your packages in slackware
It's a quick and easy way to manage your packages in `Slackware <http://www.slackware$
to a command.

View file

@ -8,11 +8,11 @@
|-----handy-ruler------------------------------------------------------|
slpkg: slpkg (Slackware tool in Python)
slpkg:
slpkg: Slpkg is a terminal tool in order to easy use Slackware packages.
slpkg: It's a quick and easy way to manage your packages in slackware to a
slpkg: command.
slpkg:
slpkg: Homepage: http://dslackw.github.io/slpkg
slpkg: Slpkg is a terminal multitool in order to easy use Slackware
slpkg: packages. It's a quick and easy way to manage your packages in
slpkg: slackware to a command
slpkg:
slpkg: Homepage: https://github.com/dslackw/slpkg
slpkg:
slpkg:
slpkg:

View file

@ -1,6 +1,6 @@
PRGNAM="slpkg"
VERSION="1.x.x"
HOMEPAGE="http://dslackw.github.io/slpkg"
HOMEPAGE="https://github.com/dslackw/slpkg"
DOWNLOAD="https://github.com/dslackw/slpkg/archive/v1.x.x.tar.gz"
MD5SUM="9676ce788fc030ac83362aa3e183ec42"
DOWNLOAD_x86_64=""

View file

@ -2,10 +2,11 @@
# -*- coding: utf-8 -*-
import os
import subprocess
__all__ = "slpkg"
__author__ = "dslackw"
__version_info__ = (1, 6, 8)
__version_info__ = (1, 6, 9)
__version__ = "{0}.{1}.{2}".format(*__version_info__)
__license__ = "GNU General Public License v3 (GPLv3)"
__email__ = "d.zlatanidis@gmail.com"
@ -13,6 +14,12 @@ __email__ = "d.zlatanidis@gmail.com"
''' file spacer '''
sp = "-"
''' current path '''
path = subprocess.check_output(["pwd"], shell=True).replace("\n", "/")
''' build path '''
build_path = path + "Slpkg_Build/"
''' temponary path '''
tmp = "/tmp/"
slpkg_path = tmp + "slpkg/"

View file

@ -9,5 +9,5 @@ class colors:
GREEN = "\x1b[32m"
YELLOW = "\x1b[33m"
CYAN = "\x1b[36m"
WHEAT = "\x1b[38;5;101m"
GREY = "\x1b[38;5;247m"
ENDC = "\x1b[0m"

View file

@ -2,29 +2,13 @@
# -*- coding: utf-8 -*-
'''
SSSSSSS SSSSSSSS
SSSSSSS SSSSSSSS
SSSSSSS SSSSSSSS
SSSSSSS SSSSSSSS
SSSSSSSSSS SSSSSSSSSSS SSSSSSSSS SSSSSSS SSSSSSSSSSSSSSSS SSSSS
SSSSSSSSSSSSS SSSSSSSSSSSSSSSSSSSSSSSS SSSSSSS SSSSSSSSSSSSSSSSSSSSSSSSS
SSSSSSSSSSSSSSSS SSSSSSSSSSSSSSSSSSSSSSSSS SSSSSSS SSSSSSSSSSSSSSSSSSSSSSSSSS
SSSSSSSSSSSSSSSSS SSSSSSSSSSSSSSSSSSSSSSSSSS SSSSSSS SSSSSSSSSSSSSSSSSSSSSSSSSSS
SSSSSSS SSSSSS SSSSSS SSSSSSS SSSSSSS SSSSSSSSSSSSSS SSSSSSS SSSSSSS
SSSSSSSS SSSSSS SSSSSSS SSSSSSS SSSSSSSSSSSSS SSSSSSS SSSSSSS
SSSSSSSS SSSSSS SSSSSSS SSSSSSS SSSSSSSSSSSSS SSSSSSS SSSSSSS
SSSSSS SSSSSSS SSSSSS SSSSSSS SSSSSSSS SSSSSSSSSSSSSS SSSSSSSS SSSSSSS
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS SSSSSSSSSSSSSSSSSSSSSSSSSS
SSSSSSSSSSSSSSSS SSSSSSSSSSSSSSSSSSSSSSSSSS SSSSSSSS SSSSSSSSSSSSSSSSSSSSSSSSS
SSSSSSSSSSSSSS SSSSSSSSSSSSSSSSSSSSSSSSS SSSSSSSS SSSSSSSSSSSSSSSSSSSSSSSS
SSSSSSSSSSS SSSSSSSSSSSSSSSSSSSSSSS SSSSSSSS SSSSSSS SSSSSSSSSSSSSSS
SSSSSSS SSSSSSS
SSSSSSS SSSSSS SSSSSSS
SSSSSSSSS SSSSSSSS SSSSSSSS
SSSSSSSSS SSSSSSSSSSSSSSSSSS
SSSSSSSSS SSSSSSSSSSSSSSSS
SSSSSSSSS SSSSSSSSSSSS
SSSSSS
_ _
___| |_ __ | | ____ _
/ __| | '_ \| |/ / _` |
\__ \ | |_) | < (_| |
|___/_| .__/|_|\_\__, |
|_| |___/
usage: slpkg [-h] [-v] [-a script [source ...]]
[-l all, sbo, slack, noarch, other]
@ -45,7 +29,7 @@ optional arguments:
check if your packages is up to date
-s sbo, slack [sbo, slack ...]
download, build & install packages
-t tracking dependencies
-t packages tracking dependencies from SBo
-n view packages from SBo repository
-i [ ...] install binary packages
-u [ ...] upgrade binary packages
@ -53,12 +37,14 @@ optional arguments:
-r [ ...] remove packages
-f [ ...] view packages installed
-d [ ...] display the contents of the packages
'''
import argparse
from version import *
from functions import *
from colors import colors
from __metadata__ import path
from messages import ext_err_args
from messages import err1_args, err2_args
@ -87,7 +73,7 @@ def main():
type=str, nargs="+", metavar=('sbo, slack'))
parser.add_argument("-s", help="download, build & install packages",
type=str, nargs="+", metavar=('sbo, slack'))
parser.add_argument("-t", help="tracking dependencies",
parser.add_argument("-t", help="packages tracking dependencies from SBo",
type=str, metavar=(''))
parser.add_argument("-n", help="view packages from SBo repository",
type=str, metavar=(''))
@ -97,7 +83,7 @@ def main():
type=str, nargs="+", metavar=(''))
parser.add_argument("-o", help="reinstall binary packages",
type=str, nargs="+", metavar=(''))
parser.add_argument("-r", help="remove packages",
parser.add_argument("-r", help="remove binary packages",
type=str, nargs="+", metavar=(''))
parser.add_argument("-f", help="view installed packages",
type=str, nargs="+", metavar=(''))
@ -107,7 +93,7 @@ def main():
if args.verbose:
prog_version()
if args.a:
build_package(args.a[0], args.a[1], args.a[2:])
build_package(args.a[0], args.a[1], args.a[2:], path)
if args.l:
pkg_list(args.l)
if args.t:

View file

@ -1 +1 @@
# [ pkg ] directory
# [ packages ] directory

View file

@ -6,17 +6,15 @@ import sys
import shutil
import getpass
import tarfile
import subprocess
from slpkg.messages import pkg_not_found, s_user
def build_package(script, source, extra):
def build_package(script, source, extra, path):
'''
Build package with source
'''
s_user(getpass.getuser())
pkg_name = script.replace(".tar.gz", "")
path = subprocess.check_output(["pwd"], shell=True).replace("\n", "/")
try:
tar = tarfile.open(script)
tar.extractall()
@ -25,7 +23,7 @@ def build_package(script, source, extra):
for src in extra:
shutil.copy2(src, pkg_name)
os.chdir(path + pkg_name)
os.system("sh {0}{1}{2}".format(path, pkg_name + "/", pkg_name + ".SlackBuild"))
os.system("sh {0}.SlackBuild".format(pkg_name))
os.chdir(path)
except (OSError, IOError):
message = "Wrong file"
@ -34,4 +32,3 @@ def build_package(script, source, extra):
except KeyboardInterrupt:
print # new line at exit
sys.exit()

View file

@ -8,8 +8,8 @@ def find_package(find_pkg, directory):
Find installed packages from
/var/log/packages/
'''
results = []
pkgs = []
for pkg in os.listdir(directory):
if pkg.startswith(find_pkg):
results.append(pkg)
return results
pkgs.append(pkg)
return pkgs

View file

@ -139,48 +139,48 @@ def pkg_list(binary):
'''
try:
print # new line at start
index, stop = 0, 50
index, page = 0, 50
if "all" in binary:
for pkg in os.listdir(pkg_path):
index += 1
print ("[{0}{1}{2}] {3}".format(colors.WHEAT, index, colors.ENDC, pkg))
if index == stop:
print ("{0}{1}:{2} {3}".format(colors.GREY, index, colors.ENDC, pkg))
if index == page:
key = raw_input('\nPress [ Enter ] >> Next page ')
stop += 50
page += 50
if "sbo" in binary:
for pkg in os.listdir(pkg_path):
if 'SBo' in pkg:
index += 1
print ("[{0}{1}{2}] {3}".format(colors.WHEAT, index, colors.ENDC, pkg))
if index == stop:
print ("{0}{1}:{2} {3}".format(colors.GREY, index, colors.ENDC, pkg))
if index == page:
key = raw_input('\nPress [ Enter ] >> Next page ')
stop += 50
page += 50
if "slack" in binary:
for pkg in os.listdir(pkg_path):
if 'slack' in pkg:
index += 1
print ("[{0}{1}{2}] {3}".format(colors.WHEAT, index, colors.ENDC, pkg))
if index == stop:
print ("{0}{1}:{2} {3}".format(colors.GREY, index, colors.ENDC, pkg))
if index == page:
key = raw_input('\nPress [ Enter ] >> Next page ')
stop += 50
page += 50
if "noarch" in binary:
for pkg in os.listdir(pkg_path):
if 'noarch' in pkg:
index += 1
print ("[{0}{1}{2}] {3}".format(colors.WHEAT, index, colors.ENDC, pkg))
if index == stop:
print ("{0}{1}:{2} {3}".format(colors.GREY, index, colors.ENDC, pkg))
if index == page:
key = raw_input('\nPress [ Enter ] >> Next page ')
stop += 50
page += 50
if "other" in binary:
for pkg in os.listdir(pkg_path):
if 'SBo' in pkg or 'slack' in pkg or 'noarch' in pkg:
pass
else:
index += 1
print ("[{0}{1}{2}] {3}".format(colors.WHEAT, index, colors.ENDC, pkg))
if index == stop:
print ("{0}{1}:{2} {3}".format(colors.GREY, index, colors.ENDC, pkg))
if index == page:
key = raw_input('\nPress [ Enter ] >> Next page ')
stop += 50
page += 50
print # new line at end
except KeyboardInterrupt:
print # new line at exit

View file

@ -1 +1 @@
# [ sbo ] directory
# [ slackbuilds ] directory

View file

@ -11,7 +11,7 @@ from slpkg.colors import colors
from slpkg.functions import get_file
from slpkg.messages import pkg_not_found, s_user, template
from slpkg.__metadata__ import tmp, pkg_path, uname, arch, sp
from slpkg.__metadata__ import sbo_arch, sbo_tag, sbo_filetype
from slpkg.__metadata__ import sbo_arch, sbo_tag, sbo_filetype, build_path
from search import sbo_search_pkg
from download import sbo_slackbuild_dwn
@ -38,17 +38,20 @@ def sbo_check(name):
sbo_dwn = sbo_slackbuild_dwn(sbo_url, name)
source_dwn = sbo_source_dwn(sbo_url, name)
extra_dwn = sbo_extra_dwn(sbo_url, name)
sbo_file = sbo_file[len(name) + 1:-len(arch) - 7]
if sbo_version > sbo_file:
print ("\n{0}New version is available:{1}".format(colors.YELLOW, colors.ENDC))
sbo_file_version = sbo_file[len(name) + 1:-len(arch) - 7]
if sbo_version > sbo_file_version:
print ("\n{0}New version is available:{1}".format(
colors.YELLOW, colors.ENDC))
template(78)
print ("| Package: {0} {1} --> {2} {3}".format(
name, sbo_file, name, sbo_version))
name, sbo_file_version, name, sbo_version))
template(78)
print # new line at start
read = raw_input("Would you like to install ? [Y/y] ")
if read == "Y" or read == "y":
s_user(getpass.getuser())
os.system("mkdir -p {0}".format(build_path))
os.chdir(build_path)
prgnam = sbo_prgnam_pkg(sbo_url, name)
pkg_for_install = ("{0}-{1}".format(prgnam, sbo_version))
script = get_file(sbo_dwn, "/")
@ -60,8 +63,9 @@ def sbo_check(name):
for src in extra_dwn.split():
os.system("wget -N {0}".format(src))
extra.append(get_file(src, "/"))
build_package(script, source, extra)
binary = (tmp + pkg_for_install + sbo_arch + sbo_tag + sbo_filetype).split()
build_package(script, source, extra, build_path)
binary = ("{0}{1}{2}{3}{4}".format(
tmp, pkg_for_install, sbo_arch, sbo_tag, sbo_filetype).split())
pkg_upgrade(binary)
else:
print ("\nPackage {0} is up to date\n".format(

View file

@ -2,9 +2,13 @@
# -*- coding: utf-8 -*-
import sys
from slpkg.colors import colors
from slpkg.__metadata__ import pkg_path, sp
from slpkg.messages import pkg_not_found, template
from slpkg.pkg.find import find_package
from greps import *
from search import sbo_search_pkg
from download import sbo_slackbuild_dwn
@ -25,7 +29,7 @@ def sbo_dependencies_pkg(name):
else:
sbo_req = sbo_requires_pkg(sbo_url, name)
dependencies = sbo_req.split()
if dependencies != []:
if dependencies:
dep_results.append(dependencies)
for line in dependencies:
sbo_dependencies_pkg(line)
@ -39,23 +43,35 @@ def pkg_tracking(name):
Print tree of dependencies
'''
print ('\nSearch dependencies for package {0} from slackbuilds.org:\n'.format(name))
dependencies = sbo_dependencies_pkg(name)
if dependencies is None:
dependencies_list = sbo_dependencies_pkg(name)
if dependencies_list is None:
pass
elif dependencies == []:
elif dependencies_list == []:
print ("\nPackage {0} no dependencies\n".format(name))
else:
print # new line at start
requires, dependencies = [], []
for pkg in dependencies_list:
requires += pkg
requires.reverse()
for duplicate in requires:
if duplicate not in dependencies:
dependencies.append(duplicate)
pkg_len = len(name) + 24
template(pkg_len)
print ("| Package {0}{1}{2} dependencies :".format(colors.CYAN, name,
colors.ENDC))
template(pkg_len)
dependencies.reverse()
#clear_dependencies.reverse()
print ("\\")
print (" +---{0}[ Tree of dependencies ]{1}".format(colors.YELLOW, colors.ENDC))
for i in range(len(dependencies)):
print (" |")
print (" ".join((" +--", str(len(dependencies[i])),
", ".join(dependencies[i]))))
print # new line at end
index = 0
for pkg in dependencies:
index += 1
if find_package(pkg + sp, pkg_path):
print (" |")
print (" {0}{1}: {2}{3}{4}".format("+--", index, colors.GREEN, pkg, colors.ENDC))
else:
print (" |")
print (" {0}{1}: {2}{3}{4}".format("+--", index, colors.RED, pkg, colors.ENDC))
print ("\n NOTE: green installed, red not installed\n")

View file

@ -8,7 +8,7 @@ from slpkg.url_read import url_read
from slpkg.__metadata__ import slpkg_path
# create tmp directory if not exist
os.system("mkdir -p /tmp/readme/")
os.system("mkdir -p {0}readme/".format(slpkg_path))
def read_readme(sbo_url, name, site):
'''

View file

@ -23,7 +23,7 @@ def sbo_search_pkg(name):
sbo_location.append(line.replace('SLACKBUILD LOCATION: ./', ''))
for loc in sbo_location:
if get_file(loc, '/') == name:
print ('{0}[ found ] --> {1} {2}'.format(colors.CYAN, colors.ENDC, name))
print ('{0}[ found ] --> {1}{2}'.format(colors.CYAN, colors.ENDC, name))
return sbo_url + loc.replace(name, '') + name + "/"
except KeyboardInterrupt:
print # new line at exit

View file

@ -6,16 +6,19 @@ import sys
import getpass
from slpkg.colors import colors
from slpkg.functions import get_file
from slpkg.messages import pkg_not_found, template, s_user
from slpkg.__metadata__ import tmp, sbo_arch, sbo_tag, sbo_filetype
from slpkg.__metadata__ import tmp, pkg_path, build_path, sp
from slpkg.__metadata__ import sbo_arch, sbo_tag, sbo_filetype, arch
from slpkg.messages import pkg_not_found, pkg_found, template, s_user
from slpkg.pkg.find import find_package
from slpkg.pkg.build import build_package
from slpkg.pkg.manager import pkg_upgrade
from search import sbo_search_pkg
from download import sbo_slackbuild_dwn
from dependency import sbo_dependencies_pkg
from greps import sbo_prgnam_pkg, sbo_version_pkg, sbo_source_dwn, sbo_extra_dwn
from greps import sbo_source_dwn, sbo_extra_dwn
from greps import sbo_prgnam_pkg, sbo_version_pkg
def sbo_build(name):
'''
@ -27,37 +30,52 @@ def sbo_build(name):
template(78)
print ("| Build dependencies tree for package {0}:".format(name))
template(78)
dependencies = sbo_dependencies_pkg(name)
if dependencies == None:
dependencies_list = sbo_dependencies_pkg(name)
if dependencies_list == None:
pass
else:
try:
requires, extra = [], []
os.system("mkdir -p {0}".format(build_path))
os.chdir(build_path)
requires, dependencies, extra = [], [], []
requires.append(name)
for pkg in dependencies:
for pkg in dependencies_list:
requires += pkg
requires.reverse()
for duplicate in requires:
if duplicate not in dependencies:
dependencies.append(duplicate)
print # new lines at start
template(78)
print ("| Start download, build and install packages:")
template(78)
for pkg in requires:
for pkg in dependencies:
sbo_url = sbo_search_pkg(pkg)
prgnam = ("{0}-{1}".format(sbo_prgnam_pkg(sbo_url, pkg),
sbo_version_pkg(sbo_url, pkg)))
sbo_link = sbo_slackbuild_dwn(sbo_url, pkg)
src_link = sbo_source_dwn(sbo_url, pkg)
ext_link = sbo_extra_dwn(sbo_url, pkg)
script = get_file(sbo_link, '/')
source = get_file(src_link, '/')
os.system("wget -N {0} {1}".format(sbo_link, src_link))
if ext_link:
for src in ext_link:
os.system("wget -N {0}".format(src))
extra.append(get_file(src, '/'))
build_package(script, source, extra)
binary = (tmp + prgnam + sbo_arch + sbo_tag + sbo_filetype).split()
pkg_upgrade(binary)
sbo_version = sbo_version_pkg(sbo_url, pkg)
sbo_file = "".join(find_package(pkg + sp, pkg_path))
sbo_file_version = sbo_file[len(pkg) + 1:-len(arch) - 7]
if sbo_version > sbo_file_version:
prgnam = ("{0}-{1}".format(sbo_prgnam_pkg(sbo_url, pkg),
sbo_version_pkg(sbo_url, pkg)))
sbo_link = sbo_slackbuild_dwn(sbo_url, pkg)
src_link = sbo_source_dwn(sbo_url, pkg)
ext_link = sbo_extra_dwn(sbo_url, pkg)
script = get_file(sbo_link, '/')
source = get_file(src_link, '/')
os.system("wget -N {0} {1}".format(sbo_link, src_link))
if ext_link:
for src in ext_link:
os.system("wget -N {0}".format(src))
extra.append(get_file(src, '/'))
build_package(script, source, extra, build_path)
binary = ("{0}{1}{2}{3}{4}".format(
tmp, prgnam, sbo_arch, sbo_tag, sbo_filetype).split())
pkg_upgrade(binary)
else:
template(78)
pkg_found(pkg)
template(78)
print # new line at end
except KeyboardInterrupt:
print # new line at exit
sys.exit()

View file

@ -5,7 +5,7 @@ import os
from slpkg.colors import colors
from slpkg.functions import get_file
from slpkg.__metadata__ import tmp, pkg_path, slpkg_path, sp
from slpkg.__metadata__ import sbo_arch, sbo_tag, sbo_filetype
from slpkg.__metadata__ import sbo_arch, sbo_tag, sbo_filetype, build_path
from slpkg.messages import s_user, pkg_not_found, pkg_found, view_sbo, template
from slpkg.pkg.build import build_package
@ -67,6 +67,8 @@ def sbo_network(name):
os.remove("{0}readme/{1}{2}".format(slpkg_path, name, site))
elif read == "B" or read == "b":
s_user(getpass.getuser())
os.system("mkdir -p {0}".format(build_path))
os.chdir(build_path)
script = get_file(sbo_dwn, "/")
source = get_file(source_dwn, "/")
print ("\n{0}Start -->{1}\n".format(colors.GREEN, colors.ENDC))
@ -76,10 +78,12 @@ def sbo_network(name):
for src in extra_dwn.split():
os.system("wget -N {0}".format(src))
extra.append(get_file(src, "/"))
build_package(script, source, extra)
build_package(script, source, extra, build_path)
break
elif read == "I" or read == "i":
s_user(getpass.getuser())
os.system("mkdir -p {0}".format(build_path))
os.chdir(build_path)
prgnam = sbo_prgnam_pkg(sbo_url, name)
pkg_for_install = ("{0}-{1}".format(prgnam, sbo_version))
if find_package(prgnam + sp, pkg_path) == []:
@ -92,8 +96,9 @@ def sbo_network(name):
for src in extra_dwn.split():
os.system("wget -N {0}".format(src))
extra.append(get_file(src, "/"))
build_package(script, source, extra)
binary = (tmp + pkg_for_install + sbo_arch + sbo_tag + sbo_filetype).split()
build_package(script, source, extra, build_path)
binary = ("{0}{1}{2}{3}{4}".format(
tmp, pkg_for_install, sbo_arch, sbo_tag, sbo_filetype).split())
pkg_upgrade(binary)
break
else:

View file

@ -1 +1 @@
# [ slack ] directory
# [ slackware ] directory

View file

@ -7,7 +7,7 @@ import getpass
from slpkg.colors import colors
from slpkg.messages import s_user
from slpkg.url_read import url_read
from slpkg.__metadata__ import pkg_path, slpkg_path
from slpkg.__metadata__ import pkg_path, slpkg_path, arch
from slpkg.pkg.find import find_package
from slpkg.pkg.manager import pkg_upgrade
@ -66,7 +66,12 @@ def patches():
print ("\nThere are packages in directory {0}{1}\n".format(
slpkg_path, 'patches/'))
else:
print ("\nSlackware {0} distribution is up to date\n".format(slack_ver()))
if arch == "x86_64":
slack_arch = 64
else:
slack_arch = ""
print ("\nSlackware{0} v{1} distribution is up to date\n".format(
slack_arch, slack_ver()))
except KeyboardInterrupt:
print # new line at exit
sys.exit()