updated for version 1.7.7

This commit is contained in:
Dimitris Zlatanidis 2014-08-27 21:45:00 +03:00
parent c87846c7dd
commit f01743f3bd
34 changed files with 318 additions and 284 deletions

View file

@ -1,4 +1,13 @@
Version 1.7.7
26-08-2014
[Updated] - Fix install noarch packages from SBo repository
Fix avoid '%README%' as dependency
Fix arguments
Fix messages
Version 1.7.6 Version 1.7.6
25-08-2014
[Updated] - Bugfix IndexError '-aa' in cli argparseoptions. [Updated] - Bugfix IndexError '-aa' in cli argparseoptions.
Fix arch's Fix arch's

View file

@ -40,6 +40,3 @@ There are mainly four ways:
Proposed mode if you want to have installed the most updated version is 1 and 2 Proposed mode if you want to have installed the most updated version is 1 and 2
process. process.

117
PKG-INFO
View file

@ -1,6 +1,6 @@
Metadata-Version: 1.1 Metadata-Version: 1.1
Name: slpkg Name: slpkg
Version: 1.7.6 Version: 1.7.7
Author: dslackw Author: dslackw
Author-email: d zlatanidis at gmail com Author-email: d zlatanidis at gmail com
Maintainer: dslackw Maintainer: dslackw
@ -25,8 +25,7 @@ Description: .. image:: https://badge.fury.io/py/slpkg.png
======== ========
- Build third party packages from source with all dependencies - Build third party packages from source with all dependencies
- Install packages through from official `Slackware <http://www.slackware.com/>`_ - Install packages through from official `Slackware <http://www.slackware.com/>`_ mirrors
mirrors
- Find and Download packages from `slackbuilds.org <http://slackbuilds.org/>`_ - Find and Download packages from `slackbuilds.org <http://slackbuilds.org/>`_
- Grabs packages from slackbuilds.org in real time - Grabs packages from slackbuilds.org in real time
- Automatic tool build and install packages - Automatic tool build and install packages
@ -51,9 +50,8 @@ mirrors
Video Tutorial Video Tutorial
============== ==============
.. image:: .. image:: https://raw.githubusercontent.com/dslackw/images/master/slpkg/screenshot-1.png
https://raw.githubusercontent.com/dslackw/images/master/slpkg/screenshot-1.png :target: https://asciinema.org/a/11457
:target: https://asciinema.org/a/11265
Installation Installation
------------ ------------
@ -68,21 +66,20 @@ https://raw.githubusercontent.com/dslackw/images/master/slpkg/screenshot-1.png
$ pip uninstall slpkg $ pip uninstall slpkg
Using Slackware command: Using Slackware command:
Download http://slackbuilds.org/repository/14.1/system/slpkg from slackbuilds.org Download `SBo package <http://slackbuilds.org/repository/14.1/system/slpkg/>`_
Using SBOPKG http://www.sbopkg.org Download binary package from `SourceForge <https://sourceforge.net/projects/slpkg/>`_
Download binary package from SourceForge:
Command Line Tool Usage Command Line Tool Usage
----------------------- -----------------------
.. code-block:: bash .. code-block:: bash
usage: slpkg [-h] [-v] [-a script [source ...]] usage: slpkg [-h] [-v] [-a script [source ...]] [-l all, sbo, slack, noarch]
[-l all, sbo, slack, noarch, other]
[-c sbo, slack [sbo, slack ...]] [-c sbo, slack [sbo, slack ...]]
[-s sbo, slack [sbo, slack ...]] [-t] [-n] [-i [...]] [-s sbo, slack [sbo, slack ...]] [-t] [-n] [-i [...]]
[-u [...]] [-o [...]] [-r [...]] [-f [...]] [-d [...]] [-u [...]] [-o [...]] [-r [...]] [-f [...]] [-d [...]]
@ -94,7 +91,7 @@ https://raw.githubusercontent.com/dslackw/images/master/slpkg/screenshot-1.png
-v, --verbose print version and exit -v, --verbose print version and exit
-a script [source ...] -a script [source ...]
auto build package auto build package
-l all, sbo, slack, noarch, other -l all, sbo, slack, noarch
list of installed packages list of installed packages
-c sbo, slack [sbo, slack ...] -c sbo, slack [sbo, slack ...]
check if your packages is up to date check if your packages is up to date
@ -120,10 +117,25 @@ https://raw.githubusercontent.com/dslackw/images/master/slpkg/screenshot-1.png
$ slpkg -s sbo brasero $ slpkg -s sbo brasero
Building dependency tree...... Done Building dependency tree...... Done
The following packages will be automatically installed or upgraded with new
version:
orc gstreamer1 gst1-plugins-base gst1-plugins-bad libunique brasero 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.
6 packages will be installed, 0 allready installed.
Do you want to continue [Y/n]? y Do you want to continue [Y/n]? y
. .
@ -158,9 +170,21 @@ version:
Reading package lists.............................. Done Reading package lists.............................. Done
[ install ] --> mozilla-firefox-24.1.0esr-x86_64-1 +==============================================================================
[ install ] --> mozilla-nss-3.15.2-x86_64-2 | Package Arch Build Repos Size
[ install ] --> mozilla-thunderbird-24.1.0-x86_64-1 +==============================================================================
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.
Would you like to install [Y/n]? Would you like to install [Y/n]?
@ -188,31 +212,33 @@ version:
| |
+--5 libunique +--5 libunique
NOTE: green installed, red not installed
Check if your packages is up to date from slackbuilds.org: Check if your packages is up to date from slackbuilds.org:
.. code-block:: bash .. code-block:: bash
$ slpkg -c sbo flashplayer-plugin $ slpkg -c sbo upgrade
Reading package lists. Done Reading package lists. Done
New version is available: These packages need upgrading:
+============================================================================== +==============================================================================
| Package: flashplayer-plugin 11.2.202.356 --> flashplayer-plugin 11.2.202.394 | 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
Would you like to install [Y/n]? Installing summary
===============================================================================
Total 8 packages will be upgraded.
$ slpkg -c sbo ranger Would you like to upgrade [Y/n]?
Reading package lists. Done
Package 'ranger-1.6.1' is up to date
$ slpkg -c sbo termcolor
Reading package lists. Done
No such package termcolor: Not installed
Check if your distribution is up to date from `Slackware official mirrors Check if your distribution is up to date from `Slackware official mirrors
<http://mirrors.slackware.com/>`_ <http://mirrors.slackware.com/>`_
@ -224,9 +250,19 @@ version:
These packages need upgrading: 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 | Package Arch Build Repos Size
[ upgrade ] --> xscreensaver-5.29-x86_64-1_slack14.1.txz +==============================================================================
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.
Would you like to upgrade [Y/y]? Would you like to upgrade [Y/y]?
@ -251,7 +287,7 @@ version:
Download Download this package Download Download this package
Build Download and build this package Build Download and build this package
Install Download/Build/Install Install Download/Build/Install
Quit Quit
_ _
Auto tool to build package: Auto tool to build package:
@ -453,8 +489,7 @@ version:
--> Deleting /usr/lib64/python2.7/site-packages/termcolor-1.1.0-py2.7.egg-info --> Deleting /usr/lib64/python2.7/site-packages/termcolor-1.1.0-py2.7.egg-info
--> Deleting /usr/lib64/python2.7/site-packages/termcolor.py --> Deleting /usr/lib64/python2.7/site-packages/termcolor.py
--> Deleting /usr/lib64/python2.7/site-packages/termcolor.pyc --> Deleting /usr/lib64/python2.7/site-packages/termcolor.pyc
--> Deleting --> Deleting /usr/lib64/python3.3/site-packages/__pycache__/termcolor.cpython-33.pyc
/usr/lib64/python3.3/site-packages/__pycache__/termcolor.cpython-33.pyc
--> Deleting /usr/lib64/python3.3/site-packages/termcolor-1.1.0-py3.3.egg-info --> Deleting /usr/lib64/python3.3/site-packages/termcolor-1.1.0-py3.3.egg-info
--> Deleting /usr/lib64/python3.3/site-packages/termcolor.py --> Deleting /usr/lib64/python3.3/site-packages/termcolor.py
--> Deleting empty directory /usr/lib64/python3.3/site-packages/__pycache__/ --> Deleting empty directory /usr/lib64/python3.3/site-packages/__pycache__/
@ -497,8 +532,7 @@ version:
| werkzeug | werkzeug
+============================================================================== +==============================================================================
Remove dependencies [Y/n]? y Remove dependencies (maybe used by other packages) [Y/n]? y
. .
. .
. .
@ -516,6 +550,7 @@ version:
.. code-block:: bash .. code-block:: bash
$ man slpkg $ man slpkg
Keywords: slackware, slpkg, slackpkg, sbopkg, package, build, install, yum, apt-get, linux, unix
Classifier: Development Status :: 5 - Production/Stable Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console Classifier: Environment :: Console
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3) Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)

View file

@ -65,9 +65,9 @@ Command Line Tool Usage
.. code-block:: bash .. code-block:: bash
usage: slpkg [-h] [-v] [-a script [source ...]] [-l all, sbo, slack, noarch] usage: slpkg [-h] [-v] [-a script [source ...]]
[-c sbo, slack [sbo, slack ...]] [-l all, sbo, slack, noarch] [-c sbo, slack [<upgrade> ...]]
[-s sbo, slack [sbo, slack ...]] [-t] [-n] [-i [...]] [-s sbo, slack [<package> ...]] [-t] [-n] [-i [...]]
[-u [...]] [-o [...]] [-r [...]] [-f [...]] [-d [...]] [-u [...]] [-o [...]] [-r [...]] [-f [...]] [-d [...]]
Utility for easy management packages in Slackware Utility for easy management packages in Slackware
@ -79,9 +79,9 @@ Command Line Tool Usage
auto build package auto build package
-l all, sbo, slack, noarch -l all, sbo, slack, noarch
list of installed packages list of installed packages
-c sbo, slack [sbo, slack ...] -c sbo, slack [<upgrade> ...]
check if your packages is up to date check if your packages is up to date
-s sbo, slack [sbo, slack ...] -s sbo, slack [<package> ...]
download, build & install packages download, build & install packages
-t packages tracking dependencies from SBo -t packages tracking dependencies from SBo
-n view packages from SBo repository -n view packages from SBo repository
@ -263,8 +263,7 @@ Find packages from slackbuilds.org:
| Package bitfighter --> http://slackbuilds.org/repository/14.1/games/bitfighter/ | Package bitfighter --> http://slackbuilds.org/repository/14.1/games/bitfighter/
+=============================================================================== +===============================================================================
| SlackBuild : bitfighter.tar.gz | SlackBuild : bitfighter.tar.gz
| Source : bitfighter-019c.tar.gz | Sources : bitfighter-019c.tar.gz
| Extra : classic_level_pack.zip
| Requirements : OpenAL, SDL2, speex, libmodplug | Requirements : OpenAL, SDL2, speex, libmodplug
+=============================================================================== +===============================================================================
README View the README file README View the README file

View file

@ -1,7 +1,7 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# slpkg # slpkg file is part of slpkg.
# Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com> # Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved. # All rights reserved.
@ -10,7 +10,7 @@
# https://github.com/dslackw/slpkg # https://github.com/dslackw/slpkg
# This program is free software: you can redistribute it and/or modify # Slpkg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or # the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.

View file

@ -15,9 +15,9 @@
.SH NAME .SH NAME
slpkg - Utility for easy management packages in Slackware slpkg - Utility for easy management packages in Slackware
.SH SYNOPSIS .SH SYNOPSIS
\fBusage: slpkg [-h] [-v] [-a script [source ...]] [-l all, sbo, slack, noarch] \fBusage: slpkg [-h] [-v] [-a script [source ...]]
[-c sbo, slack [sbo, slack ...]] [-l all, sbo, slack, noarch] [-c sbo, slack [<upgrade> ...]]
[-s sbo, slack [sbo, slack ...]] [-t] [-n] [-i [...]] [-s sbo, slack [<package> ...]] [-t] [-n] [-i [...]]
[-u [...]] [-o [...]] [-r [...]] [-f [...]] [-d [...]]\fP [-u [...]] [-o [...]] [-r [...]] [-f [...]] [-d [...]]\fP
.SH DESCRIPTION .SH DESCRIPTION
@ -31,9 +31,9 @@ It's a quick and easy way to manage your packages in slackware to a command.
\fB auto build packages\fP \fB auto build packages\fP
\fB-l all, sbo, slack, noarch\fP \fB-l all, sbo, slack, noarch\fP
\fB list of installed packages\fP \fB list of installed packages\fP
\fB-c sbo, slack [sbo, slack ...]\fp \fB-c sbo, slack [<upgrade> ...]\fp
\fB check if your packages is up to date\fP \fB check if your packages is up to date\fP
\fB-s sbo, slack [sbo, slack ...]\fP \fB-s sbo, slack [<package> ...]\fP
\fB download, build & install packages\fP \fB download, build & install packages\fP
\fB list of installed packages\fP \fB list of installed packages\fP
\fB-t packages tracking dependencies from SBo\fP \fB-t packages tracking dependencies from SBo\fP
@ -230,7 +230,6 @@ $ \fBslpkg -n termcolor\fP
+============================================================================== +==============================================================================
| SlackBuild : termcolor.tar.gz | SlackBuild : termcolor.tar.gz
| Source : termcolor-1.1.0.tar.gz | Source : termcolor-1.1.0.tar.gz
| Extra :
| Requirements : | Requirements :
+=============================================================================== +===============================================================================
README View the README file README View the README file

View file

@ -1,7 +1,7 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# setup.py # setup.py file is part of slpkg.
# Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com> # Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved. # All rights reserved.
@ -10,7 +10,7 @@
# https://github.com/dslackw/slpkg # https://github.com/dslackw/slpkg
# This program is free software: you can redistribute it and/or modify # Slpkg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or # the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.
@ -69,4 +69,3 @@ if 'install' in sys.argv:
man_page = "man/slpkg.8" man_page = "man/slpkg.8"
shutil.copy2(man_page, man_path) shutil.copy2(man_page, man_path)
os.chmod(man_path, int('444', 8)) os.chmod(man_path, int('444', 8))

View file

@ -10,10 +10,10 @@ slpkg: slpkg (Slackware tool in Python)
slpkg: slpkg:
slpkg: Slpkg is a terminal multitool in order to easy use Slackware 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: packages. It's a quick and easy way to manage your packages in
slpkg: slackware to a command slpkg: Slackware to a command. Slpkg uses Slackware commands to upgrade,
slpkg: install or remove packages.
slpkg: slpkg:
slpkg: Homepage: https://github.com/dslackw/slpkg slpkg: Homepage: https://github.com/dslackw/slpkg
slpkg: slpkg:
slpkg: slpkg:
slpkg: slpkg:
slpkg:

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.7.6} VERSION=${VERSION:-1.7.7}
BUILD=${BUILD:-1} BUILD=${BUILD:-1}
TAG=${TAG:-_dsw} TAG=${TAG:-_dsw}
@ -35,7 +35,6 @@ if [ -z "$ARCH" ]; then
esac esac
fi fi
CWD=$(pwd) CWD=$(pwd)
TMP=${TMP:-/tmp/SBo} TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM PKG=$TMP/package-$PRGNAM
@ -70,9 +69,6 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
# ignore pip install man page
#sed -i 's/'install'//' setup.py
python setup.py install --root=$PKG python setup.py install --root=$PKG
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
@ -83,7 +79,7 @@ gzip -9 man/$PRGNAM.8
install -D -m0644 man/$PRGNAM.8.gz $PKG/usr/man/man8/$PRGNAM.8.gz install -D -m0644 man/$PRGNAM.8.gz $PKG/usr/man/man8/$PRGNAM.8.gz
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a README.rst CHANGELOG LICENSE $PKG/usr/doc/$PRGNAM-$VERSION cp -a README.rst CHANGELOG LICENSE CONTRIBUTING ISSUES $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install mkdir -p $PKG/install

View file

@ -1,7 +1,7 @@
PRGNAM="slpkg" PRGNAM="slpkg"
VERSION="1.7.6" VERSION="1.7.7"
HOMEPAGE="https://github.com/dslackw/slpkg" HOMEPAGE="https://github.com/dslackw/slpkg"
DOWNLOAD="https://github.com/dslackw/slpkg/archive/v1.7.6.tar.gz" DOWNLOAD="https://github.com/dslackw/slpkg/archive/v1.7.7.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, 7, 6) __version_info__ = (1, 7, 7)
__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"
@ -67,3 +67,15 @@ elif "arm" in arch:
build = "*" build = "*"
sbo_tag = "_SBo" sbo_tag = "_SBo"
sbo_filetype = ".tgz" sbo_filetype = ".tgz"
''' Slackware architectures '''
slack_archs = (
"-noarch-",
"-x86_64-",
"-i386-",
"-i486-",
"-i686-",
"-x86-",
"-fw-"
)

View file

@ -1,7 +1,7 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# colors.py # colors.py file is part of slpkg.
# Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com> # Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved. # All rights reserved.
@ -10,7 +10,7 @@
# https://github.com/dslackw/slpkg # https://github.com/dslackw/slpkg
# This program is free software: you can redistribute it and/or modify # Slpkg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or # the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.

View file

@ -1,7 +1,7 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# functions.py # functions.py file is part of slpkg.
# Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com> # Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved. # All rights reserved.
@ -10,7 +10,7 @@
# https://github.com/dslackw/slpkg # https://github.com/dslackw/slpkg
# This program is free software: you can redistribute it and/or modify # Slpkg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or # the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.

View file

@ -1,7 +1,7 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# main.py # main.py file is part of slpkg.
# Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com> # Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved. # All rights reserved.
@ -10,7 +10,7 @@
# https://github.com/dslackw/slpkg # https://github.com/dslackw/slpkg
# This program is free software: you can redistribute it and/or modify # Slpkg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or # the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.
@ -87,14 +87,14 @@ def main():
parser.add_argument("-v", "--verbose", help="print version and exit", parser.add_argument("-v", "--verbose", help="print version and exit",
action="store_true") action="store_true")
parser.add_argument("-a", help="auto build packages", parser.add_argument("-a", help="auto build packages",
type=str, nargs="+", metavar=("script", "source")) type=str, nargs="+", metavar=("script", "sources"))
parser.add_argument("-l", help="list of installed packages", parser.add_argument("-l", help="list of installed packages",
choices="all sbo slack noarch".split(), choices="all sbo slack noarch".split(),
metavar=("all, sbo, slack, noarch")) metavar=("all, sbo, slack, noarch"))
parser.add_argument("-c", help="check if your packages is up to date", parser.add_argument("-c", help="check if your packages is up to date",
type=str, nargs="+", metavar=("sbo, slack")) type=str, nargs="+", metavar=("sbo, slack", "<upgrade>"))
parser.add_argument("-s", help="download, build & install packages", parser.add_argument("-s", help="download, build & install packages",
type=str, nargs="+", metavar=("sbo, slack")) type=str, nargs="+", metavar=("sbo, slack","<package>"))
parser.add_argument("-t", help="packages tracking dependencies from SBo", parser.add_argument("-t", help="packages tracking dependencies from SBo",
type=str, metavar=("")) type=str, metavar=(""))
parser.add_argument("-n", help="view packages from SBo repository", parser.add_argument("-n", help="view packages from SBo repository",
@ -172,7 +172,7 @@ def main():
err1_args("".join(args.s[0]), choices) err1_args("".join(args.s[0]), choices)
elif len(args.s) < 2: elif len(args.s) < 2:
if "sbo" in args.s or "slack" in args.s: if "sbo" in args.s or "slack" in args.s:
choices = ["upgrade"] choices = ["package"]
ext_err_args() ext_err_args()
err2_args(choices) err2_args(choices)
else: else:

View file

@ -1,7 +1,7 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# messages.py # messages.py file is part of slpkg.
# Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com> # Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved. # All rights reserved.
@ -10,7 +10,7 @@
# https://github.com/dslackw/slpkg # https://github.com/dslackw/slpkg
# This program is free software: you can redistribute it and/or modify # Slpkg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or # the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.
@ -29,41 +29,41 @@ def pkg_not_found(bol, pkg, message, eol):
''' '''
Print message when package not found Print message when package not found
''' '''
print ("{0}No such package {1}: {2}{3}".format(bol, pkg, message, eol)) print("{0}No such package {1}: {2}{3}".format(bol, pkg, message, eol))
def pkg_found(pkg, version): def pkg_found(pkg, version):
''' '''
Print message when package found Print message when package found
''' '''
print ("| Package {0}-{1} is already installed".format(pkg, version)) print("| Package {0}-{1} is already installed".format(pkg, version))
def pkg_installed(pkg): def pkg_installed(pkg):
''' '''
Print message when package installed Print message when package installed
''' '''
print ("| Package {0} installed".format(pkg)) print("| Package {0} installed".format(pkg))
def ext_err_args(): def ext_err_args():
''' '''
Extended error arguments view Extended error arguments view
''' '''
print ("usage: {0} [-h] [-v] [-a script [source ...]] [-l all, sbo, slack, noarch]".format(__all__)) print("usage: {0} [-h] [-v] [-a script [sources ...]]".format(__all__))
print (" [-c sbo, slack [sbo, slack ...]]") print(" [-l all, sbo, slack, noarch] [-c sbo, slack [<upgrade> ...]]")
print (" [-s sbo, slack [sbo, slack ...]] [-t] [-n] [-i [...]]") print(" [-s sbo, slack [<package> ...]] [-t] [-n] [-i [...]]")
print (" [-u [...]] [-o [...]] [-r [...]] [-f [...]] [-d [...]]") print(" [-u [...]] [-o [...]] [-r [...]] [-f [...]] [-d [...]]")
def err1_args(invalid, choices): 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):
''' '''
Print error message arguments Print error message arguments
''' '''
print ("{0}: error: must enter at least two arguments: choose {1}".format( print("{0}: error: must enter at least two arguments: choose {1}".format(
__all__, choices)) __all__, choices))
def s_user(user): def s_user(user):
@ -71,14 +71,14 @@ def s_user(user):
Check for root user Check for root user
''' '''
if user != "root": if user != "root":
print ("\nError: must have root privileges\n") print("\nError: must have root privileges\n")
sys.exit() sys.exit()
def template(max): def template(max):
''' '''
Print view template Print view template
''' '''
print ("+" + "=" * max) print("+" + "=" * max)
def view_sbo(pkg, sbo_url, sbo_dwn, source_dwn, sbo_req): def view_sbo(pkg, sbo_url, sbo_dwn, source_dwn, sbo_req):
print # new line at start print # new line at start
@ -87,7 +87,7 @@ def view_sbo(pkg, sbo_url, sbo_dwn, source_dwn, sbo_req):
colors.CYAN, pkg, colors.GREEN, colors.ENDC + sbo_url)) colors.CYAN, pkg, colors.GREEN, colors.ENDC + sbo_url))
template(78) template(78)
print("| {0}SlackBuild : {1}{2}".format(colors.GREEN, colors.ENDC, sbo_dwn)) 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}Sources : {1}{2}".format(colors.GREEN, colors.ENDC, source_dwn))
print("| {0}Requirements : {1}{2}".format(colors.YELLOW, colors.ENDC, print("| {0}Requirements : {1}{2}".format(colors.YELLOW, colors.ENDC,
", ".join(sbo_req))) ", ".join(sbo_req)))
template(78) template(78)

View file

@ -1,7 +1,7 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# build.py # build.py file is part of slpkg.
# Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com> # Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved. # All rights reserved.
@ -10,7 +10,7 @@
# https://github.com/dslackw/slpkg # https://github.com/dslackw/slpkg
# This program is free software: you can redistribute it and/or modify # Slpkg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or # the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.
@ -33,21 +33,20 @@ def build_package(script, sources, path):
''' '''
Build package from source Build package from source
''' '''
pkg_name = script.replace(".tar.gz", "") prgnam = script.replace(".tar.gz", "")
try: try:
tar = tarfile.open(script) tar = tarfile.open(script)
tar.extractall() tar.extractall()
tar.close() tar.close()
for src in sources: for src in sources:
shutil.copy2(src, pkg_name) shutil.copy2(src, prgnam)
os.chdir(path + pkg_name) os.chdir(path + prgnam)
subprocess.call("chmod +x {0}.SlackBuild".format(pkg_name), shell=True) subprocess.call("chmod +x {0}.SlackBuild".format(prgnam), shell=True)
subprocess.call("./{0}.SlackBuild".format(pkg_name), shell=True) subprocess.call("./{0}.SlackBuild".format(prgnam), shell=True)
os.chdir(path) os.chdir(path)
except (OSError, IOError): except (OSError, IOError):
message = "Wrong file" message = "Wrong file"
bol, eol, pkg = "\n", "\n", "" pkg_not_found("\n", prgnam, message, "\n")
pkg_not_found(bol, pkg, message, eol)
except KeyboardInterrupt: except KeyboardInterrupt:
print # new line at exit print # new line at exit
sys.exit() sys.exit()

View file

@ -1,7 +1,7 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# find.py # find.py file is part of slpkg.
# Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com> # Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved. # All rights reserved.
@ -10,7 +10,7 @@
# https://github.com/dslackw/slpkg # https://github.com/dslackw/slpkg
# This program is free software: you can redistribute it and/or modify # Slpkg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or # the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.

View file

@ -1,7 +1,7 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# manager.py # manager.py file is part of slpkg.
# Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com> # Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved. # All rights reserved.
@ -10,7 +10,7 @@
# https://github.com/dslackw/slpkg # https://github.com/dslackw/slpkg
# This program is free software: you can redistribute it and/or modify # Slpkg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or # the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.
@ -95,9 +95,8 @@ def pkg_remove(binary):
removed.append(pkg) removed.append(pkg)
else: else:
message = "Can't remove" message = "Can't remove"
bol, eol = "", ""
not_found.append(pkg) not_found.append(pkg)
pkg_not_found(bol, pkg, message, eol) pkg_not_found("", pkg, message, "")
if removed == []: if removed == []:
print # new line at end print # new line at end
else: else:
@ -176,8 +175,7 @@ def pkg_find(binary):
find_package(pkg + sp, pkg_path))) find_package(pkg + sp, pkg_path)))
else: else:
message = "Can't find" message = "Can't find"
bol, eol = "", "" pkg_not_found("", pkg, message, "")
pkg_not_found(bol, pkg, message, eol)
print # new line at end print # new line at end
def pkg_display(binary): def pkg_display(binary):

View file

@ -1,7 +1,7 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# check.py # check.py file is part of slpkg.
# Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com> # Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved. # All rights reserved.
@ -10,7 +10,7 @@
# https://github.com/dslackw/slpkg # https://github.com/dslackw/slpkg
# This program is free software: you can redistribute it and/or modify # Slpkg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or # the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.
@ -25,14 +25,15 @@ import os
import sys import sys
import subprocess import subprocess
from slpkg.pkg.find import find_package
from slpkg.pkg.build import build_package from slpkg.pkg.build import build_package
from slpkg.pkg.manager import pkg_upgrade from slpkg.pkg.manager import pkg_upgrade
from slpkg.colors import colors from slpkg.colors import colors
from slpkg.messages import template from slpkg.messages import template
from slpkg.functions import get_file from slpkg.functions import get_file
from slpkg.__metadata__ import tmp, pkg_path, build_path from slpkg.__metadata__ import (tmp, sbo_arch, build, sbo_tag,
from slpkg.__metadata__ import sbo_arch, build, sbo_tag, sbo_filetype sbo_filetype, pkg_path, build_path)
from init import initialization from init import initialization
from search import sbo_search_pkg from search import sbo_search_pkg
@ -49,9 +50,9 @@ def sbo_check():
sys.stdout.flush() sys.stdout.flush()
initialization() initialization()
index, toolbar_width = 0, 3 index, toolbar_width = 0, 3
pkg_name, sbo_ver, pkg_for_upg, sbo_list = [], [], [], [] pkg_name, sbo_ver, pkg_for_upg, sbo_list, pkg_arch = [], [], [], [], []
for pkg in os.listdir(pkg_path): for pkg in os.listdir(pkg_path):
if "_SBo" in pkg: if pkg.endswith("_SBo"):
sbo_list.append(pkg) sbo_list.append(pkg)
if sbo_list: if sbo_list:
for pkg in sbo_list: for pkg in sbo_list:
@ -70,14 +71,15 @@ def sbo_check():
arch = "noarch" arch = "noarch"
else: else:
arch = os.uname()[4] arch = os.uname()[4]
name = pkg[:-(len(arch) + len("_SBo") + 3)] name = pkg[:-(len(arch) + len(sbo_tag) + 3)]
pkg_version = get_file(name, "-")[1:] pkg_version = get_file(name, "-")[1:]
name = name[:-(len(pkg_version) + 1)] name = name[:-(len(pkg_version) + 1)]
sbo_version = sbo_version_pkg(name) sbo_version = sbo_version_pkg(name)
if sbo_version > pkg_version: if sbo_version > pkg_version:
pkg_name.append(name) pkg_name.append(name)
pkg_for_upg.append(name + "-" + pkg_version) pkg_for_upg.append("{0}-{1}".format(name, pkg_version))
sbo_ver.append(sbo_version) sbo_ver.append(sbo_version)
pkg_arch.append(arch)
sys.stdout.write("Done\n") sys.stdout.write("Done\n")
if pkg_for_upg: if pkg_for_upg:
print("\nThese packages need upgrading:\n") print("\nThese packages need upgrading:\n")
@ -85,7 +87,7 @@ def sbo_check():
print "| Package", " "*27, "New version", " "*5, "Arch", " "*7, "Repository" print "| Package", " "*27, "New version", " "*5, "Arch", " "*7, "Repository"
template(78) template(78)
print("Upgrading:") print("Upgrading:")
for upg, ver in zip(pkg_for_upg, sbo_ver): for upg, ver, arch in zip(pkg_for_upg, sbo_ver, pkg_arch):
print " ", upg, " "*(34-len(upg)), ver, " "*( print " ", upg, " "*(34-len(upg)), ver, " "*(
16-len(ver)), arch, " "*(11-len(arch)), "SBo" 16-len(ver)), arch, " "*(11-len(arch)), "SBo"
msg_pkg = "package" msg_pkg = "package"
@ -99,10 +101,10 @@ def sbo_check():
if not os.path.exists(build_path): if not os.path.exists(build_path):
os.mkdir(build_path) os.mkdir(build_path)
os.chdir(build_path) os.chdir(build_path)
for name, version in zip(pkg_name, sbo_ver): for name, version, arch in zip(pkg_name, sbo_ver, pkg_arch):
pkg_for_install = ("{0}-{1}".format(name, version)) prgnam = ("{0}-{1}".format(name, version))
sbo_url = sbo_search_pkg(name) sbo_url = sbo_search_pkg(name)
sbo_dwn = sbo_slackbuild_dwn(sbo_url, name) sbo_dwn = sbo_slackbuild_dwn(sbo_url)
src_dwn = sbo_source_dwn(name).split() src_dwn = sbo_source_dwn(name).split()
script = get_file(sbo_dwn, "/") script = get_file(sbo_dwn, "/")
print("\n{0}Start -->{1} {2}\n".format(colors.GREEN, colors.ENDC, name)) print("\n{0}Start -->{1} {2}\n".format(colors.GREEN, colors.ENDC, name))
@ -112,8 +114,8 @@ def sbo_check():
subprocess.call("wget -N {0}".format(src), shell=True) subprocess.call("wget -N {0}".format(src), shell=True)
sources.append(get_file(src, "/")) sources.append(get_file(src, "/"))
build_package(script, sources, build_path) build_package(script, sources, build_path)
binary = ("{0}{1}{2}{3}{4}{5}".format( binary = ("{0}{1}-{2}-{3}{4}{5}".format(
tmp, pkg_for_install, sbo_arch, build, sbo_tag, sbo_filetype).split()) tmp, prgnam, arch, build, sbo_tag, sbo_filetype).split())
print("{0}[ Upgrading ] --> {1}{2}".format( print("{0}[ Upgrading ] --> {1}{2}".format(
colors.GREEN, colors.ENDC, name)) colors.GREEN, colors.ENDC, name))
pkg_upgrade(binary) pkg_upgrade(binary)

View file

@ -1,7 +1,7 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# dependency.py # dependency.py file is part of slpkg.
# Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com> # Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved. # All rights reserved.
@ -10,7 +10,7 @@
# https://github.com/dslackw/slpkg # https://github.com/dslackw/slpkg
# This program is free software: you can redistribute it and/or modify # Slpkg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or # the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.
@ -32,24 +32,21 @@ from slpkg.pkg.find import find_package
from init import initialization from init import initialization
from search import sbo_search_pkg from search import sbo_search_pkg
from greps import sbo_requires_pkg from greps import sbo_requires_pkg
from download import sbo_slackbuild_dwn
dep_results = [] dep_results = []
def sbo_dependencies_pkg(name): def sbo_dependencies_pkg(name):
''' '''
Build tree of dependencies Build all dependencies of a package
''' '''
try: try:
if name is not "%README%": dependencies = []
sbo_url = sbo_search_pkg(name) sbo_url = sbo_search_pkg(name)
if sbo_url is None: if sbo_url:
sys.stdout.write("Done\n") requires = sbo_requires_pkg(sbo_url, name)
message = "From slackbuilds.org" for req in requires:
bol, eol = "\n", "\n" if "%README%" not in req:
pkg_not_found(bol, name, message, eol) dependencies.append(req)
else:
dependencies = sbo_requires_pkg(sbo_url, name)
if dependencies: if dependencies:
dep_results.append(dependencies) dep_results.append(dependencies)
for dep in dependencies: for dep in dependencies:
@ -66,14 +63,10 @@ def pkg_tracking(name):
Print tree of dependencies Print tree of dependencies
''' '''
sys.stdout.write("Reading package lists ...") sys.stdout.write("Reading package lists ...")
sys.stdout.flush()
initialization() initialization()
dependencies_list = sbo_dependencies_pkg(name) dependencies_list = sbo_dependencies_pkg(name)
if dependencies_list is None: if dependencies_list is not None:
pass
elif dependencies_list == []:
sys.stdout.write("Done\n")
print("\nPackage {0} no dependencies\n".format(name))
else:
sys.stdout.write("Done\n") sys.stdout.write("Done\n")
print # new line at start print # new line at start
requires, dependencies = [], [] requires, dependencies = [], []
@ -84,6 +77,8 @@ def pkg_tracking(name):
if duplicate not in dependencies: if duplicate not in dependencies:
dependencies.append(duplicate) dependencies.append(duplicate)
pkg_len = len(name) + 24 pkg_len = len(name) + 24
if dependencies == []:
dependencies = ["No dependencies"]
template(pkg_len) template(pkg_len)
print("| Package {0}{1}{2} dependencies :".format(colors.CYAN, name, print("| Package {0}{1}{2} dependencies :".format(colors.CYAN, name,
colors.ENDC)) colors.ENDC))
@ -100,3 +95,7 @@ def pkg_tracking(name):
print(" |") print(" |")
print(" {0}{1}: {2}{3}{4}".format("+--", index, colors.RED, pkg, colors.ENDC)) print(" {0}{1}: {2}{3}{4}".format("+--", index, colors.RED, pkg, colors.ENDC))
print # new line at end print # new line at end
else:
sys.stdout.write("Done\n")
message = "From slackbuilds.org"
pkg_not_found("\n", name, message, "\n")

View file

@ -1,7 +1,7 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# download.py # download.py file is part of slpkg.
# Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com> # Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved. # All rights reserved.
@ -10,7 +10,7 @@
# https://github.com/dslackw/slpkg # https://github.com/dslackw/slpkg
# This program is free software: you can redistribute it and/or modify # Slpkg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or # the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.
@ -21,9 +21,8 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
def sbo_slackbuild_dwn(sbo_url, name): def sbo_slackbuild_dwn(sbo_url):
''' '''
Convert http repository link to Create download slackbuild tar.gz script
slackbuild download link
''' '''
return sbo_url.replace(name + "/", name + ".tar.gz") return sbo_url[:-1] + ".tar.gz"

View file

@ -1,7 +1,7 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -* # -*- coding: utf-8 -*
# file_size.py # file_size.py file is part of slpkg.
# Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com> # Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved. # All rights reserved.
@ -10,7 +10,7 @@
# https://github.com/dslackw/slpkg # https://github.com/dslackw/slpkg
# This program is free software: you can redistribute it and/or modify # Slpkg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or # the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.

View file

@ -1,7 +1,7 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# greps.py # greps.py file is part of slpkg.
# Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com> # Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved. # All rights reserved.
@ -10,7 +10,7 @@
# https://github.com/dslackw/slpkg # https://github.com/dslackw/slpkg
# This program is free software: you can redistribute it and/or modify # Slpkg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or # the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.

View file

@ -1,7 +1,7 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# init.py # init.py file is part of slpkg.
# Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com> # Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved. # All rights reserved.
@ -10,7 +10,7 @@
# https://github.com/dslackw/slpkg # https://github.com/dslackw/slpkg
# This program is free software: you can redistribute it and/or modify # Slpkg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or # the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.

View file

@ -1,7 +1,7 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# read.py # read.py file is part of slpkg.
# Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com> # Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved. # All rights reserved.
@ -10,7 +10,7 @@
# https://github.com/dslackw/slpkg # https://github.com/dslackw/slpkg
# This program is free software: you can redistribute it and/or modify # Slpkg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or # the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.

View file

@ -1,7 +1,7 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# search.py # search.py file is part of slpkg.
# Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com> # Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved. # All rights reserved.
@ -10,7 +10,7 @@
# https://github.com/dslackw/slpkg # https://github.com/dslackw/slpkg
# This program is free software: you can redistribute it and/or modify # Slpkg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or # the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.

View file

@ -1,7 +1,7 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# slackbuild.py # slackbuild.py file is part of slpkg.
# Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com> # Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved. # All rights reserved.
@ -10,7 +10,7 @@
# https://github.com/dslackw/slpkg # https://github.com/dslackw/slpkg
# This program is free software: you can redistribute it and/or modify # Slpkg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or # the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.
@ -28,8 +28,8 @@ import subprocess
from slpkg.colors import colors from slpkg.colors import colors
from slpkg.functions import get_file from slpkg.functions import get_file
from slpkg.messages import pkg_not_found, pkg_found, template from slpkg.messages import pkg_not_found, pkg_found, template
from slpkg.__metadata__ import sbo_arch, build, sbo_tag, sbo_filetype from slpkg.__metadata__ import (tmp, pkg_path, build_path, log_path,
from slpkg.__metadata__ import tmp, pkg_path, build_path, log_path, sp sp, build, sbo_tag, sbo_filetype)
from slpkg.pkg.find import find_package from slpkg.pkg.find import find_package
from slpkg.pkg.build import build_package from slpkg.pkg.build import build_package
@ -50,14 +50,10 @@ def sbo_build(name):
sys.stdout.write("Building dependency tree ...") sys.stdout.write("Building dependency tree ...")
initialization() initialization()
dependencies_list = sbo_dependencies_pkg(name) dependencies_list = sbo_dependencies_pkg(name)
if dependencies_list == None:
pass
else:
try: try:
if not os.path.exists(build_path): if dependencies_list is not None:
os.mkdir(build_path) pkg_sum, SC, EC = 0, "", ""
os.chdir(build_path) requires, dependencies, pkg_for_install = [], [], []
requires, dependencies = [], []
requires.append(name) requires.append(name)
for pkg in dependencies_list: for pkg in dependencies_list:
requires += pkg requires += pkg
@ -65,8 +61,6 @@ def sbo_build(name):
for duplicate in requires: for duplicate in requires:
if duplicate not in dependencies: if duplicate not in dependencies:
dependencies.append(duplicate) dependencies.append(duplicate)
pkg_sum = 0
pkg_for_install = []
if find_package(name + sp, pkg_path): if find_package(name + sp, pkg_path):
pkg_for_install.append(colors.GREEN + name + colors.ENDC) pkg_for_install.append(colors.GREEN + name + colors.ENDC)
pkg_sum = 1 pkg_sum = 1
@ -82,29 +76,30 @@ def sbo_build(name):
arch = "i486" arch = "i486"
elif "arm" in arch: elif "arm" in arch:
arch = "arm" arch = "arm"
else:
arch = os.uname()[4]
if "UNSUPPORTED" in src: if "UNSUPPORTED" in src:
arch = "UNSUPPORTED" arch = "UNSUPPORTED"
SC, EC = colors.RED, colors.ENDC
elif "UNTESTED" in src: elif "UNTESTED" in src:
arch = "UNTESTED" arch = "UNTESTED"
print("The following packages will be automatically installed or upgraded with new version:\n") SC, EC = colors.YELLOW, colors.ENDC
print("\nThe following packages will be automatically installed or upgraded")
print("with new version:\n")
template(78) template(78)
print "| Package", " "*31, "Version", " "*7, "Arch", " "*5, "Repository" print "| Package", " "*31, "Version", " "*7, "Arch", " "*5, "Repository"
template(78) template(78)
print("Installing:") print("Installing:")
print " ", "".join(pkg_for_install), " "*(38-len(name)), sbo_ver, " "*( print " ", "".join(pkg_for_install), " "*(38-len(name)), sbo_ver, " "*(
14-len(sbo_ver)), arch, " "*(9-len(arch)), "SBo" 14-len(sbo_ver)), SC + arch + EC, " "*(9-len(arch)), "SBo"
print("Installing for dependencies:") print("Installing for dependencies:")
for dep in dependencies[:-1]: for dep in dependencies[:-1]:
sbo_ver = sbo_version_pkg(dep) sbo_ver = sbo_version_pkg(dep)
if find_package(dep + sp, pkg_path): if find_package(dep + sp, pkg_path):
print " ", colors.GREEN + dep + colors.ENDC, " "*(38-len(dep)), sbo_ver, " "*( print " ", colors.GREEN + dep + colors.ENDC, " "*(38-len(
14-len(sbo_ver)), arch, " "*(9-len(arch)), "SBo" dep)), sbo_ver, " "*(14-len(sbo_ver)), SC + arch + EC, " "*(9-len(arch)), "SBo"
pkg_sum += 1 pkg_sum += 1
else: else:
print " ", colors.RED + dep + colors.ENDC, " "*(38-len(dep)), sbo_ver, " "*( print " ", colors.RED + dep + colors.ENDC, " "*(38-len(
14-len(sbo_ver)), arch, " "*(9-len(arch)), "SBo" dep)), sbo_ver, " "*(14-len(sbo_ver)), SC + arch + EC, " "*(9-len(arch)), "SBo"
msg_pkg = "package" msg_pkg = "package"
msg_2_pkg = msg_pkg msg_2_pkg = msg_pkg
if len(dependencies) > 1: if len(dependencies) > 1:
@ -118,6 +113,9 @@ def sbo_build(name):
(len(dependencies) - pkg_sum), msg_2_pkg, pkg_sum)) (len(dependencies) - pkg_sum), msg_2_pkg, pkg_sum))
read = raw_input("\nDo you want to continue [Y/n]? ") read = raw_input("\nDo you want to continue [Y/n]? ")
if read == "Y" or read == "y": if read == "Y" or read == "y":
if not os.path.exists(build_path):
os.mkdir(build_path)
os.chdir(build_path)
for pkg in dependencies: for pkg in dependencies:
sbo_version = sbo_version_pkg(pkg) sbo_version = sbo_version_pkg(pkg)
sbo_file = "".join(find_package(pkg + sp, pkg_path)) sbo_file = "".join(find_package(pkg + sp, pkg_path))
@ -125,7 +123,7 @@ def sbo_build(name):
if sbo_version > sbo_file_version: if sbo_version > sbo_file_version:
prgnam = ("{0}-{1}".format(pkg, sbo_version_pkg(pkg))) prgnam = ("{0}-{1}".format(pkg, sbo_version_pkg(pkg)))
sbo_url = sbo_search_pkg(pkg) sbo_url = sbo_search_pkg(pkg)
sbo_link = sbo_slackbuild_dwn(sbo_url, pkg) sbo_link = sbo_slackbuild_dwn(sbo_url)
src_link = sbo_source_dwn(pkg).split() src_link = sbo_source_dwn(pkg).split()
script = get_file(sbo_link, "/") script = get_file(sbo_link, "/")
print("\n{0}Start -->{1} {2}\n".format(colors.GREEN, colors.ENDC, pkg)) print("\n{0}Start -->{1} {2}\n".format(colors.GREEN, colors.ENDC, pkg))
@ -135,6 +133,14 @@ def sbo_build(name):
subprocess.call("wget -N {0}".format(src), shell=True) subprocess.call("wget -N {0}".format(src), shell=True)
sources.append(get_file(src, "/")) sources.append(get_file(src, "/"))
build_package(script, sources, build_path) build_package(script, sources, build_path)
'''
Before installing new binary package look if arch is noarch.
This is because some maintainers changes arch manualy.
'''
if "-noarch-" in "".join(find_package(prgnam, tmp)):
sbo_arch = "-noarch-"
else:
from slpkg.__metadata__ import sbo_arch
binary = ("{0}{1}{2}{3}{4}{5}".format( binary = ("{0}{1}{2}{3}{4}{5}".format(
tmp, prgnam, sbo_arch, build, sbo_tag, sbo_filetype).split()) tmp, prgnam, sbo_arch, build, sbo_tag, sbo_filetype).split())
print("{0}[ Installing ] --> {1}{2}".format( print("{0}[ Installing ] --> {1}{2}".format(
@ -159,6 +165,10 @@ def sbo_build(name):
for dep in dependencies: for dep in dependencies:
f.write(dep + "\n") f.write(dep + "\n")
f.close() f.close()
else:
sys.stdout.write("Done\n")
message = "From slackbuilds.org"
pkg_not_found("\n", name, message, "\n")
except KeyboardInterrupt: except KeyboardInterrupt:
print # new line at exit print # new line at exit
sys.exit() sys.exit()

View file

@ -1,7 +1,7 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# views.py # views.py file is part of slpkg.
# Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com> # Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved. # All rights reserved.
@ -10,7 +10,7 @@
# https://github.com/dslackw/slpkg # https://github.com/dslackw/slpkg
# This program is free software: you can redistribute it and/or modify # Slpkg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or # the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.
@ -27,9 +27,9 @@ import subprocess
from slpkg.colors import colors from slpkg.colors import colors
from slpkg.functions import get_file from slpkg.functions import get_file
from slpkg.__metadata__ import tmp, pkg_path, slpkg_tmp, sp
from slpkg.messages import pkg_not_found, pkg_found, view_sbo, template from slpkg.messages import pkg_not_found, pkg_found, view_sbo, template
from slpkg.__metadata__ import sbo_arch, build, sbo_tag, sbo_filetype, build_path from slpkg.__metadata__ import (tmp, build, sbo_tag, sbo_filetype, build_path,
pkg_path, slpkg_tmp, sp)
from slpkg.pkg.build import build_package from slpkg.pkg.build import build_package
from slpkg.pkg.find import find_package from slpkg.pkg.find import find_package
@ -48,20 +48,14 @@ def sbo_network(name):
''' '''
rdm_path = slpkg_tmp + "readme/" rdm_path = slpkg_tmp + "readme/"
sys.stdout.write("Reading package lists ...") sys.stdout.write("Reading package lists ...")
sys.stdout.flush()
initialization() initialization()
sbo_url = sbo_search_pkg(name) sbo_url = sbo_search_pkg(name)
if sbo_url is None: if sbo_url:
sys.stdout.write ("Done\n")
message = "From slackbuilds.org"
bol, eol = "\n", "\n"
pkg_not_found(bol, name, message, eol)
else:
if not os.path.exists(build_path):
os.mkdir(build_path)
sys.stdout.write ("Done\n")
sbo_req = sbo_requires_pkg(sbo_url, name) sbo_req = sbo_requires_pkg(sbo_url, name)
sbo_dwn = sbo_slackbuild_dwn(sbo_url, name) sbo_dwn = sbo_slackbuild_dwn(sbo_url)
source_dwn = sbo_source_dwn(name).split() source_dwn = sbo_source_dwn(name).split()
sys.stdout.write ("Done\n")
view_sbo(name, sbo_url, get_file(sbo_dwn, "/"), view_sbo(name, sbo_url, get_file(sbo_dwn, "/"),
", ".join([get_file(src, "/") for src in source_dwn]), sbo_req) ", ".join([get_file(src, "/") for src in source_dwn]), sbo_req)
while True: while True:
@ -93,6 +87,8 @@ def sbo_network(name):
subprocess.call("less {0}{1}{2}".format(rdm_path, name, site), shell=True) subprocess.call("less {0}{1}{2}".format(rdm_path, name, site), shell=True)
os.remove("{0}{1}{2}".format(rdm_path, name, site)) os.remove("{0}{1}{2}".format(rdm_path, name, site))
elif read == "B" or read == "b": elif read == "B" or read == "b":
if not os.path.exists(build_path):
os.mkdir(build_path)
sources = [] sources = []
os.chdir(build_path) os.chdir(build_path)
script = get_file(sbo_dwn, "/") script = get_file(sbo_dwn, "/")
@ -105,11 +101,13 @@ def sbo_network(name):
print("Complete!\n") print("Complete!\n")
break break
elif read == "I" or read == "i": elif read == "I" or read == "i":
if not os.path.exists(build_path):
os.mkdir(build_path)
sbo_version = sbo_version_pkg(name) sbo_version = sbo_version_pkg(name)
if find_package(name + sp, pkg_path) == []: if find_package(name + sp, pkg_path) == []:
sources = [] sources = []
os.chdir(build_path) os.chdir(build_path)
pkg_for_install = ("{0}-{1}".format(name, sbo_version)) prgnam = ("{0}-{1}".format(name, sbo_version))
print("\n{0}Start -->{1} {2}\n".format(colors.GREEN, colors.ENDC, name)) print("\n{0}Start -->{1} {2}\n".format(colors.GREEN, colors.ENDC, name))
subprocess.call("wget -N {0}".format(sbo_dwn), shell=True) subprocess.call("wget -N {0}".format(sbo_dwn), shell=True)
script = get_file(sbo_dwn, "/") script = get_file(sbo_dwn, "/")
@ -117,8 +115,17 @@ def sbo_network(name):
subprocess.call("wget -N {0}".format(src), shell=True) subprocess.call("wget -N {0}".format(src), shell=True)
sources.append(get_file(src, "/")) sources.append(get_file(src, "/"))
build_package(script, sources, build_path) build_package(script, sources, build_path)
'''
Before installing new binary package look if arch is noarch.
This is because some maintainers changes arch manualy.
'''
if "-noarch-" in "".join(find_package(prgnam, tmp)):
sbo_arch = "-noarch-"
else:
from __metadata__ import sbo_arch
binary = ("{0}{1}{2}{3}{4}{5}".format( binary = ("{0}{1}{2}{3}{4}{5}".format(
tmp, pkg_for_install, sbo_arch, build, sbo_tag, sbo_filetype).split()) tmp, prgnam, sbo_arch, build, sbo_tag, sbo_filetype).split())
print("{0}[ Installing ] --> {1}{2}".format( print("{0}[ Installing ] --> {1}{2}".format(
colors.GREEN, colors.ENDC, name)) colors.GREEN, colors.ENDC, name))
pkg_upgrade(binary) pkg_upgrade(binary)
@ -134,3 +141,8 @@ def sbo_network(name):
break break
else: else:
break break
else:
sys.stdout.write ("Done\n")
message = "From slackbuilds.org"
pkg_not_found("\n", name, message, "\n")

View file

@ -1,7 +1,7 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# install.py # install.py file is part of slpkg.
# Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com> # Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved. # All rights reserved.
@ -10,7 +10,7 @@
# https://github.com/dslackw/slpkg # https://github.com/dslackw/slpkg
# This program is free software: you can redistribute it and/or modify # Slpkg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or # the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.
@ -29,7 +29,7 @@ import subprocess
from slpkg.colors import colors from slpkg.colors import colors
from slpkg.url_read import url_read from slpkg.url_read import url_read
from slpkg.messages import pkg_not_found, template from slpkg.messages import pkg_not_found, template
from slpkg.__metadata__ import slpkg_tmp, pkg_path, sp from slpkg.__metadata__ import slpkg_tmp, pkg_path, slack_archs
from slpkg.pkg.manager import pkg_upgrade, pkg_reinstall from slpkg.pkg.manager import pkg_upgrade, pkg_reinstall
@ -44,7 +44,7 @@ def install(slack_pkg):
dwn_list, comp_size, uncomp_size = [], [], [] dwn_list, comp_size, uncomp_size = [], [], []
install_all, package_name, package_location = [], [], [] install_all, package_name, package_location = [], [], []
tmp_path = slpkg_tmp + "packages/" tmp_path = slpkg_tmp + "packages/"
pkg_sum = 0 pkg_sum, arch, SC, EC = 0, "", "", ""
if not os.path.exists(tmp_path): if not os.path.exists(tmp_path):
if not os.path.exists(slpkg_tmp): if not os.path.exists(slpkg_tmp):
os.mkdir(slpkg_tmp) os.mkdir(slpkg_tmp)
@ -83,41 +83,25 @@ def install(slack_pkg):
template(78) template(78)
print("Installing:") print("Installing:")
for pkg, comp in zip(install_all, comp_sum): for pkg, comp in zip(install_all, comp_sum):
if "-noarch-" in pkg: for archs in slack_archs:
arch = "noarch" if archs in pkg:
elif "-x86_64-" in pkg: pkgs = pkg.replace(archs, "")
arch = "x86_64" arch = archs[1:-1]
elif "-i386-" in pkg:
arch = "i386"
elif "-i486-" in pkg:
arch = "i486"
elif "-i686-" in pkg:
arch = "i686"
elif "-x86-" in pkg:
arch = "x86"
elif "-fw-" in pkg:
arch = "fw"
else:
arch = ""
if os.path.isfile(pkg_path + pkg[:-4]): if os.path.isfile(pkg_path + pkg[:-4]):
pkg_sum += 1 pkg_sum += 1
SC, EC = colors.GREEN, colors.ENDC SC, EC = colors.GREEN, colors.ENDC
else: else:
SC, EC = colors.RED, colors.ENDC SC, EC = colors.RED, colors.ENDC
print " ", SC + pkg[:-5].replace(sp+arch+sp, "") + EC, " "*( print " ", SC + pkgs[:-5] + EC, " "*(40-len(pkgs[:-5])), arch, " "*(
40-len(pkg[:-5].replace(sp+arch+sp, ""))), arch, " "*( 7-len(arch)), pkgs[-5:-4], " "*(6-len(pkgs[-5:-4])), "Slack", " ", comp, " "*(
7-len(arch)), pkg[-5:-4].replace(sp+arch+sp, ""), " "*(
6-len(pkg[-5:-4].replace(sp+arch+sp, ""))), "Slack", " ", comp, " "*(
3-len(comp)), "K" 3-len(comp)), "K"
comp_unit, uncomp_unit = "Mb", "Mb" comp_unit, uncomp_unit = "Mb", "Mb"
compressed = round((sum(map(float, comp_sum)) * 0.0001220703125), 2) compressed = round((sum(map(float, comp_sum)) * 0.0001220703125), 2)
uncompressed = round((sum(map(float, uncomp_sum)) * 0.0001220703125), 2) uncompressed = round((sum(map(float, uncomp_sum)) * 0.0001220703125), 2)
if compressed < 1: if compressed < 1:
compressed = sum(map(int, comp_sum)) compressed, comp_unit = sum(map(int, comp_sum)), "Kb"
comp_unit = "Kb"
if uncompressed < 1: if uncompressed < 1:
uncompressed = sum(map(int, uncomp_sum)) uncompressed, uncomp_unit = sum(map(int, uncomp_sum)), "Kb"
uncomp_unit = "Kb"
msg_pkg = "package" msg_pkg = "package"
msg_2_pkg = msg_pkg msg_2_pkg = msg_pkg
if len(install_all) > 1: if len(install_all) > 1:
@ -161,9 +145,8 @@ def install(slack_pkg):
print("\nThere are packages in directory {0}\n".format( print("\nThere are packages in directory {0}\n".format(
tmp_path)) tmp_path))
else: else:
bol, eol = "", "\n"
message = "No matching" message = "No matching"
pkg_not_found(bol, slack_pkg, message, eol) pkg_not_found("", slack_pkg, message, "\n")
except KeyboardInterrupt: except KeyboardInterrupt:
print # new line at exit print # new line at exit
sys.exit() sys.exit()

View file

@ -1,7 +1,7 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# mirrors.py # mirrors.py file is part of slpkg.
# Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com> # Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved. # All rights reserved.
@ -10,7 +10,7 @@
# https://github.com/dslackw/slpkg # https://github.com/dslackw/slpkg
# This program is free software: you can redistribute it and/or modify # Slpkg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or # the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.

View file

@ -1,7 +1,7 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# patches.py # patches.py file is part of slpkg.
# Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com> # Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved. # All rights reserved.
@ -10,7 +10,7 @@
# https://github.com/dslackw/slpkg # https://github.com/dslackw/slpkg
# This program is free software: you can redistribute it and/or modify # Slpkg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or # the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.
@ -29,7 +29,8 @@ import subprocess
from slpkg.colors import colors from slpkg.colors import colors
from slpkg.url_read import url_read from slpkg.url_read import url_read
from slpkg.messages import template from slpkg.messages import template
from slpkg.__metadata__ import pkg_path, slpkg_tmp, sp from slpkg.__metadata__ import (pkg_path, slpkg_tmp,
slack_archs)
from slpkg.pkg.manager import pkg_upgrade from slpkg.pkg.manager import pkg_upgrade
@ -83,31 +84,17 @@ def patches():
template(78) template(78)
print("Upgrading:") print("Upgrading:")
for upgrade, size in zip(upgrade_all, comp_sum): for upgrade, size in zip(upgrade_all, comp_sum):
if "-noarch-" in upgrade: for archs in slack_archs:
arch = "noarch" if archs in upgrade:
elif "-x86_64-" in upgrade: upg = upgrade.replace(archs, "")
arch = "x86_64" arch = archs[1:-1]
elif "-i386-" in upgrade:
arch = "i386"
elif "-i486-" in upgrade:
arch = "i486"
elif "-i686-" in upgrade:
arch = "i686"
elif "-x86-" in upgrade:
arch = "x86"
elif "-fw-" in upgrade:
arch = "fw"
else:
arch = ""
if "_slack" in upgrade: if "_slack" in upgrade:
slack = "_slack" + slack_ver() slack = "_slack" + slack_ver()
else: else:
slack = "" slack = ""
print " ", upgrade[:-(5+len(slack))].replace( print " ", upg[:-(5+len(slack))], " "*(40-len(upg[:-(
sp+arch+sp, ""), " "*(40-len(upgrade[:-( 5+len(slack))])), arch, " "*(7-len(arch)), upg[-15:-14], " "*(
5+len(slack))].replace(sp+arch+sp, ""))), arch, " "*( 6-len(upgrade[-15:-14])), "Slack", " ", size, " "*(
7-len(arch)), upgrade[-15:-14].replace(sp+arch+sp, ""), " "*(
6-len(upgrade[-15:-14].replace(sp+arch+sp, ""))), "Slack", " ", size, " "*(
3-len(size)), "K" 3-len(size)), "K"
comp_unit, uncomp_unit = "Mb", "Mb" comp_unit, uncomp_unit = "Mb", "Mb"
compressed = round((sum(map(float, comp_sum)) * 0.0001220703125), 2) compressed = round((sum(map(float, comp_sum)) * 0.0001220703125), 2)

View file

@ -1,7 +1,7 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# slack_version.py # slack_version.py file is part of slpkg.
# Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com> # Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved. # All rights reserved.
@ -10,7 +10,7 @@
# https://github.com/dslackw/slpkg # https://github.com/dslackw/slpkg
# This program is free software: you can redistribute it and/or modify # Slpkg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or # the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.

View file

@ -1,7 +1,7 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# url_read.py # url_read.py file is part of slpkg.
# Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com> # Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved. # All rights reserved.
@ -10,7 +10,7 @@
# https://github.com/dslackw/slpkg # https://github.com/dslackw/slpkg
# This program is free software: you can redistribute it and/or modify # Slpkg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or # the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.

View file

@ -1,7 +1,7 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# version.py # version.py file is part of slpkg.
# Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com> # Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved. # All rights reserved.
@ -10,7 +10,7 @@
# https://github.com/dslackw/slpkg # https://github.com/dslackw/slpkg
# This program is free software: you can redistribute it and/or modify # Slpkg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or # the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.
@ -30,4 +30,3 @@ def prog_version():
print ("Version : {}".format(__version__)) print ("Version : {}".format(__version__))
print ("Licence : {}".format(__license__)) print ("Licence : {}".format(__license__))
print ("Email : {}".format(__email__)) print ("Email : {}".format(__email__))