mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-12-26 09:58:31 +01:00
Bump to version 2.2.0
This commit is contained in:
parent
11351c2d27
commit
afc9ec0d7b
33 changed files with 641 additions and 253 deletions
14
CHANGELOG
14
CHANGELOG
|
@ -1,3 +1,17 @@
|
||||||
|
Version 2.2.0
|
||||||
|
08-1-2015
|
||||||
|
|
||||||
|
[Updated] - Fix queue downloads.
|
||||||
|
- Update find argument.
|
||||||
|
- Rename commands repolist and repoinfo to repo-list, repo-info.
|
||||||
|
- Update installed package list.
|
||||||
|
|
||||||
|
[Feature] - Added custom binary repository.
|
||||||
|
- Added Slackware 'patches' repository in PACKAGES.txt file.
|
||||||
|
- Added Alien's restricted repository.
|
||||||
|
- Added wget option.
|
||||||
|
- Added view default repositories in repo-list.
|
||||||
|
|
||||||
Version 2.1.5
|
Version 2.1.5
|
||||||
27-12-2014
|
27-12-2014
|
||||||
|
|
||||||
|
|
13
CHECKSUMS.md5
Normal file
13
CHECKSUMS.md5
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
These are the MD5 message digests for the files in this directory.
|
||||||
|
If you want to test your files, use 'md5sum' and compare the values to
|
||||||
|
the ones listed here.
|
||||||
|
|
||||||
|
To test all these files, use this command:
|
||||||
|
|
||||||
|
tail +13 CHECKSUMS.md5 | md5sum -c --quiet - | less
|
||||||
|
|
||||||
|
'md5sum' can be found in the GNU coreutils package on ftp.gnu.org in
|
||||||
|
/pub/gnu, or at any GNU mirror site.
|
||||||
|
|
||||||
|
MD5 message digest Filename
|
||||||
|
74d79364aef2717c00eae3a37c0e7479 ./slpkg-2.1.5.tar.gz
|
2
PKG-INFO
2
PKG-INFO
|
@ -1,6 +1,6 @@
|
||||||
Metadata-Version: 1.1
|
Metadata-Version: 1.1
|
||||||
Name: slpkg
|
Name: slpkg
|
||||||
Version: 2.1.5
|
Version: 2.1.x-dev
|
||||||
Author: dslackw
|
Author: dslackw
|
||||||
Author-email: d zlatanidis at gmail com
|
Author-email: d zlatanidis at gmail com
|
||||||
Maintainer: dslackw
|
Maintainer: dslackw
|
||||||
|
|
90
README.rst
90
README.rst
|
@ -11,9 +11,9 @@
|
||||||
|
|
||||||
Latest Release:
|
Latest Release:
|
||||||
|
|
||||||
- Version: 2.1.5
|
- Version: 2.1.dev
|
||||||
- `Package <https://sourceforge.net/projects/slpkg/files/slpkg/binary/>`_
|
- `Package <https://sourceforge.net/projects/slpkg/files/slpkg/binary/>`_
|
||||||
- `Source <https://github.com/dslackw/slpkg/archive/v2.1.5.tar.gz>`_
|
- `Source <https://github.com/dslackw/slpkg/archive/v2.1.dev.tar.gz>`_
|
||||||
- `CHANGELOG <https://github.com/dslackw/slpkg/blob/master/CHANGELOG>`_
|
- `CHANGELOG <https://github.com/dslackw/slpkg/blob/master/CHANGELOG>`_
|
||||||
|
|
||||||
.. image:: https://raw.githubusercontent.com/dslackw/images/master/slpkg/logo.png
|
.. image:: https://raw.githubusercontent.com/dslackw/images/master/slpkg/logo.png
|
||||||
|
@ -29,11 +29,11 @@ packages.
|
||||||
|
|
||||||
Slpkg is `Open Source <http://en.wikipedia.org/wiki/Open_source>`_ software written in
|
Slpkg is `Open Source <http://en.wikipedia.org/wiki/Open_source>`_ software written in
|
||||||
Python language. It's use is for managing packages in Slackware linux distribution.
|
Python language. It's use is for managing packages in Slackware linux distribution.
|
||||||
Supported Repositories:
|
Default available Repositories:
|
||||||
|
|
||||||
- SBo - `Reposiory <http://slackbuilds.org/>`_
|
- SBo - `Reposiory <http://slackbuilds.org/>`_
|
||||||
Arch: {x86, x86_64}
|
Arch: {x86, x86_64}
|
||||||
Versions: {11.0, 12.0, 12.1, 12.2, 13.0, 13.1, 13.37, 14.0, 14.1}
|
Versions: {13.1, 13.37, 14.0, 14.1}
|
||||||
- Slack - `Repository <http://www.slackware.com/>`_
|
- Slack - `Repository <http://www.slackware.com/>`_
|
||||||
Arch: {x86, x86_64}
|
Arch: {x86, x86_64}
|
||||||
Versions: {3.3, 8.1, 9.0, 9.1, 10.0, 10.1, 10.2, 11.0, 12.0, 12.2, 13.0, 13.37, 14.0, 14.1, current}
|
Versions: {3.3, 8.1, 9.0, 9.1, 10.0, 10.1, 10.2, 11.0, 12.0, 12.2, 13.0, 13.37, 14.0, 14.1, current}
|
||||||
|
@ -70,10 +70,15 @@ Supported Repositories:
|
||||||
- Slackel - `Repository <http://www.slackel.gr/repo/>`_
|
- Slackel - `Repository <http://www.slackel.gr/repo/>`_
|
||||||
Arch: {x86, x86_64}
|
Arch: {x86, x86_64}
|
||||||
Versions: {current}
|
Versions: {current}
|
||||||
|
- Restricted - `Repository <http://taper.alienbase.nl/mirrors/people/alien/restricted_slackbuilds/>`_
|
||||||
|
Arch: {x86, x86_64}
|
||||||
|
Versions: {11.0, 12.0, 12.1, 12.2, 13.0, 13.1, 13.37, 14.0, 14,1, current}
|
||||||
|
|
||||||
|
|
||||||
* Choose repositories you need to work from file '/etc/slpkg/slpkg.conf' default is
|
* Choose default repositories you need to work from file '/etc/slpkg/slpkg.conf' default is
|
||||||
'slack' and 'sbo' repositories and read REPOSITORIES file for each of the particularities.
|
'slack' and 'sbo' repositories and read REPOSITORIES file for each of the particularities.
|
||||||
|
If a repository is not in the above list, manage custom repositories with commands 'repo-add'
|
||||||
|
and 'repo-remove'.
|
||||||
|
|
||||||
Slpkg works in accordance with the standards of the organization slackbuilds.org
|
Slpkg works in accordance with the standards of the organization slackbuilds.org
|
||||||
to builds packages. Also uses the Slackware linux instructions for installation,
|
to builds packages. Also uses the Slackware linux instructions for installation,
|
||||||
|
@ -135,8 +140,8 @@ Untar the archive and run install.sh script:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ tar xvf slpkg-2.1.5.tar.gz
|
$ tar xvf slpkg-2.1.dev.tar.gz
|
||||||
$ cd slpkg-2.1.5
|
$ cd slpkg-2.1.dev
|
||||||
$ ./install.sh
|
$ ./install.sh
|
||||||
|
|
||||||
From SourceForge:
|
From SourceForge:
|
||||||
|
@ -172,6 +177,8 @@ Configuration files
|
||||||
/etc/slpkg/slackware-mirrors
|
/etc/slpkg/slackware-mirrors
|
||||||
List of Slackware Mirrors
|
List of Slackware Mirrors
|
||||||
|
|
||||||
|
/etc/slpkg/custom-repositories
|
||||||
|
List of custom repositories
|
||||||
|
|
||||||
Slackware Current
|
Slackware Current
|
||||||
-----------------
|
-----------------
|
||||||
|
@ -214,7 +221,7 @@ before proceeding to any installation or upgrade a new package.
|
||||||
Issues
|
Issues
|
||||||
------
|
------
|
||||||
|
|
||||||
Please report any bugs in "https://github.com/dslackw/slpkg/issues"
|
Please report any bugs in `ISSUES <https://github.com/dslackw/slpkg/issues>`_
|
||||||
|
|
||||||
|
|
||||||
Command Line Tool Usage
|
Command Line Tool Usage
|
||||||
|
@ -227,25 +234,27 @@ Command Line Tool Usage
|
||||||
Commands:
|
Commands:
|
||||||
update update all package lists
|
update update all package lists
|
||||||
re-create recreate package lists
|
re-create recreate package lists
|
||||||
repolist list all repositories
|
repo-add [repository name] [URL] add custom repository
|
||||||
repoinfo [repository] repository information
|
repo-remove [repository] remove custom repository
|
||||||
|
repo-list list all repositories
|
||||||
|
repo-info [repository] repository information
|
||||||
update slpkg check and update slpkg
|
update slpkg check and update slpkg
|
||||||
|
|
||||||
Optional arguments:
|
Optional arguments:
|
||||||
-h, --help show this help message and exit
|
-h, --help show this help message and exit
|
||||||
-v, --version print version and exit
|
-v, --version print version and exit
|
||||||
-a, script.tar.gz [source...] auto build SBo packages
|
-a, [script.tar.gz] [source...] auto build SBo packages
|
||||||
-b, --list, [package...] --add, --remove add, remove packages in blacklist
|
-b, --list, [package...] --add, --remove add, remove packages in blacklist
|
||||||
-q, --list, [package...] --add, --remove add, remove SBo packages in queue
|
-q, --list, [package...] --add, --remove add, remove SBo packages in queue
|
||||||
--build, --install, --build-install build, install packages from queue
|
-q, --build, --install, --build-install build, install packages from queue
|
||||||
-g, --config, --config=[editor] configuration file management
|
-g, --config, --config=[editor] configuration file management
|
||||||
-l, [repository], all list of installed packages
|
-l, [repository], all list of installed packages
|
||||||
-c, [repository] --upgrade check for updated packages
|
-c, [repository] --upgrade check for updated packages
|
||||||
-s, [repository] [package] download, build & install
|
-s, [repository] [package] download, build & install
|
||||||
-t, [repository] [package] tracking dependencies
|
-t, [repository] [package] tracking dependencies
|
||||||
-p, [repository] [package], --color=[] print package description
|
-p, [repository] [package], --color=[] print package description
|
||||||
-f, [package] find installed packages
|
|
||||||
-n, [package] view SBo packages through network
|
-n, [package] view SBo packages through network
|
||||||
|
-f, [package...] find installed packages
|
||||||
-i, [package...] install binary packages
|
-i, [package...] install binary packages
|
||||||
-u, [package...] upgrade binary packages
|
-u, [package...] upgrade binary packages
|
||||||
-o, [package...] reinstall binary packages
|
-o, [package...] reinstall binary packages
|
||||||
|
@ -277,33 +286,50 @@ and update the package lists:
|
||||||
Update repository multi ...Done
|
Update repository multi ...Done
|
||||||
|
|
||||||
|
|
||||||
Take information repositories with commands:
|
Add and remove custom repositories:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
$ slpkg repo-add ponce http://ponce.cc/slackware/slackware64-14.1/packages/
|
||||||
|
|
||||||
|
Repository 'ponce' successfully added
|
||||||
|
|
||||||
|
|
||||||
|
$ slpkg repo-remove ponce
|
||||||
|
|
||||||
|
Repository 'ponce' successfully removed
|
||||||
|
|
||||||
|
|
||||||
|
View information about the repositories:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ slpkg repolist
|
$ slpkg repo-list
|
||||||
|
|
||||||
+==============================================================================
|
+==============================================================================
|
||||||
| Repo id Repo name Status
|
| Repo id Repo URL Default Status
|
||||||
+==============================================================================
|
+==============================================================================
|
||||||
alien http://www.slackware.com/~alien/slackbuilds/ enabled
|
alien http://www.slackware.com/~alien/slackbuilds/ yes disabled
|
||||||
ktown http://alien.slackbook.org/ktown/ enabled
|
ktown http://alien.slackbook.org/ktown/ yes disabled
|
||||||
multi http://www.slackware.com/~alien/multilib/ enabled
|
multi http://www.slackware.com/~alien/multilib/ yes disabled
|
||||||
rlw http://rlworkman.net/pkgs/ enabled
|
ponce http://ponce.cc/slackware/slackware64-14.1/packa~ no enabled
|
||||||
salix http://download.salixos.org/ enabled
|
rested http://taper.alienbase.nl/mirrors/people/alien/r~ yes disabled
|
||||||
sbo http://slackbuilds.org/slackbuilds/ enabled
|
rlw http://rlworkman.net/pkgs/ yes disabled
|
||||||
slack http://mirrors.slackware.com/slackware/ enabled
|
salix http://download.salixos.org/ yes disabled
|
||||||
slacke http://ngc891.blogdns.net/pub/ enabled
|
sbo http://slackbuilds.org/slackbuilds/ yes enabled
|
||||||
slackl http://www.slackel.gr/repo/ enabled
|
slack http://ftp.cc.uoc.gr/mirrors/linux/slackware/ yes enabled
|
||||||
slackr http://www.slackers.it/repository/ disabled
|
slacke http://ngc891.blogdns.net/pub/ yes disabled
|
||||||
slacky http://repository.slacky.eu/ enabled
|
slackl http://www.slackel.gr/repo/ yes disabled
|
||||||
slonly https://slackonly.com/pub/packages/ enabled
|
slackr http://www.slackers.it/repository/ yes disabled
|
||||||
studio http://studioware.org/files/packages/ enabled
|
slacky http://repository.slacky.eu/ yes disabled
|
||||||
|
slonly https://slackonly.com/pub/packages/ yes disabled
|
||||||
|
studio http://studioware.org/files/packages/ yes disabled
|
||||||
|
|
||||||
For enable or disable repositories edit '/etc/slpkg/slpkg.conf' file
|
For enable or disable default repositories edit '/etc/slpkg/slpkg.conf' file
|
||||||
|
|
||||||
$ slpkg repoinfo alien
|
$ slpkg repo-info alien
|
||||||
|
|
||||||
|
Default: yes
|
||||||
Last updated: Tue Dec 23 11:48:31 UTC 2014
|
Last updated: Tue Dec 23 11:48:31 UTC 2014
|
||||||
Number of packages: 3149
|
Number of packages: 3149
|
||||||
Repo id: alien
|
Repo id: alien
|
||||||
|
|
21
REPOSITORIES
21
REPOSITORIES
|
@ -2,6 +2,9 @@
|
||||||
This file was created to explain some peculiarities of repositories used by the slpkg.
|
This file was created to explain some peculiarities of repositories used by the slpkg.
|
||||||
--------------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
Default repositories:
|
||||||
|
---------------------
|
||||||
SlackBuilds.org (sbo) FAQ(15):
|
SlackBuilds.org (sbo) FAQ(15):
|
||||||
Slackware current is not supported, but as a general rule, the scripts
|
Slackware current is not supported, but as a general rule, the scripts
|
||||||
should work on it as well.
|
should work on it as well.
|
||||||
|
@ -21,12 +24,22 @@ dependence 'ffmpeg' but that is not available from the repository itself).
|
||||||
Slackonly (slonly) repository contains no dependencies on file PACKAGES.TXT and this makes
|
Slackonly (slonly) repository contains no dependencies on file PACKAGES.TXT and this makes
|
||||||
it difficult to automatically resolve dependencies and in the file PACKAGES.TXT and some
|
it difficult to automatically resolve dependencies and in the file PACKAGES.TXT and some
|
||||||
lines with 'PACKAGE NAME:' there is no package so 'slpkg' can not find package.
|
lines with 'PACKAGE NAME:' there is no package so 'slpkg' can not find package.
|
||||||
Users with Slackware x86_64 will use this repository should establish from the beginning
|
|
||||||
the list of packages with the command 'slpkg re-create' to be updated with new packages
|
|
||||||
and it's because the repository has not 'ChangeLog.txt' file.
|
|
||||||
|
|
||||||
Studioware (studio), Alien's ktown (ktown), Alien's multilib (multi), Slacke E17 and E18
|
Studioware (studio), Alien's ktown (ktown), Alien's multilib (multi), Slacke E17 and E18
|
||||||
repository has no reference dependencies.
|
and Alien's restricted repository has no reference dependencies.
|
||||||
|
|
||||||
Slackel.gr (slackl) repository must be used only from Slackware current users and has the
|
Slackel.gr (slackl) repository must be used only from Slackware current users and has the
|
||||||
same peculiarities in the repository 'slackr'.
|
same peculiarities in the repository 'slackr'.
|
||||||
|
|
||||||
|
|
||||||
|
Custom repositories:
|
||||||
|
--------------------
|
||||||
|
There is the possibility of adding the repository directly from the user enough to address
|
||||||
|
up to be the 'PACKAGES.TXT' files and 'CHECKSUMS.md5' least. If not is there for file
|
||||||
|
'ChangeLog.txt' will get warning messages that the 'ChangeLog.txt' file can not be read but do
|
||||||
|
not worry, the process is completed normally have each time you run the command 'slpkg update'
|
||||||
|
the package lists for such a repository will be recreated from start automatically.
|
||||||
|
|
||||||
|
Sometimes you may experience some problems with these repositories such as the not correctly
|
||||||
|
resolve dependencies, and this may happen some specificities separate list which unfortunately
|
||||||
|
can not be calculated, good is the purpose of mentioning these problems.
|
||||||
|
|
31
conf/custom-repositories
Normal file
31
conf/custom-repositories
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
# List File Repositories:
|
||||||
|
#
|
||||||
|
# custom-repositories file is part of slpkg.
|
||||||
|
#
|
||||||
|
# Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Slpkg is a user-friendly package manager for Slackware installations.
|
||||||
|
#
|
||||||
|
# https://github.com/dslackw/slpkg
|
||||||
|
#
|
||||||
|
# Slpkg is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
# END OF LEGAL NOTICE
|
||||||
|
#
|
||||||
|
# This file is used to read, write and remove custom repositories by
|
||||||
|
# the user. The repositories will be added here should have a different
|
||||||
|
# name from existing repositories and the default. Also, the link must
|
||||||
|
# contain the PACKAGES.TXT files, CHECKSUMS.md5 and optional ChangeLog.txt.
|
||||||
|
# -------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# NAME URL
|
|
@ -25,7 +25,7 @@ VERSION=stable
|
||||||
|
|
||||||
# Choose repositories want to work. Read first REPOSITORIES file.
|
# Choose repositories want to work. Read first REPOSITORIES file.
|
||||||
# Available repositories : slack,sbo,alien,rlw,slacky,studio,slackr,slonly,
|
# Available repositories : slack,sbo,alien,rlw,slacky,studio,slackr,slonly,
|
||||||
# ktown{latest},multi,slacke{18},salix,slackl
|
# ktown{latest},multi,slacke{18},salix,slackl,rested
|
||||||
# slackr (slackers.it) repository must used from Slackware64 current.
|
# slackr (slackers.it) repository must used from Slackware64 current.
|
||||||
# Ktown (Alien's ktown) repository. Default ktown{latest}.
|
# Ktown (Alien's ktown) repository. Default ktown{latest}.
|
||||||
# Slacke (Enlightenment E17 and E18) repository. Default slacke{18}.
|
# Slacke (Enlightenment E17 and E18) repository. Default slacke{18}.
|
||||||
|
@ -36,7 +36,7 @@ REPOSITORIES=slack,sbo
|
||||||
BUILD=/tmp/slpkg/build/
|
BUILD=/tmp/slpkg/build/
|
||||||
|
|
||||||
# If SBO_CHECK_MD5 is 'on' the system will check all downloaded
|
# If SBO_CHECK_MD5 is 'on' the system will check all downloaded
|
||||||
# sources from SBo repository.
|
# sources.
|
||||||
SBO_CHECK_MD5=on
|
SBO_CHECK_MD5=on
|
||||||
|
|
||||||
# Download directory for others repositories that use binaries files
|
# Download directory for others repositories that use binaries files
|
||||||
|
@ -73,3 +73,6 @@ DEL_DEPS=off
|
||||||
|
|
||||||
# Use colors for highlighting. Choose 'on' or 'off'.
|
# Use colors for highlighting. Choose 'on' or 'off'.
|
||||||
USE_COLORS=on
|
USE_COLORS=on
|
||||||
|
|
||||||
|
# Wget [OPTION]. Pass wget options. Default is '-c -N'.
|
||||||
|
WGET_OPTION=-c -N
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
PRGNAM=slpkg
|
PRGNAM=slpkg
|
||||||
VERSION=${VERSION:-2.1.5}
|
VERSION=${VERSION:-2.1.x-dev}
|
||||||
TAG=${TAG:-_dsw}
|
TAG=${TAG:-_dsw}
|
||||||
|
|
||||||
# Installation script.
|
# Installation script.
|
||||||
|
|
87
man/slpkg.8
87
man/slpkg.8
|
@ -15,18 +15,24 @@
|
||||||
.SH NAME
|
.SH NAME
|
||||||
Slpkg is a user-friendly package manager for Slackware installations
|
Slpkg is a user-friendly package manager for Slackware installations
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
Usage: slpkg [-h] [-v] [-a script.tar.gz [sources...]]
|
Usage: slpkg Commands:
|
||||||
[-b --list, --add, --remove [...]]
|
[update] [re-create] [repo-add [repository name] [URL]]
|
||||||
[-q --list, [...] --add, --remove]
|
[repo-remove [repository]] [repo-list]
|
||||||
[ --build, --install, --build-install]
|
[repo-info [repository]] [update [slpkg]]
|
||||||
[-g --config, --config=[editor]]
|
|
||||||
[-l [repository], all]
|
Optional arguments:
|
||||||
[-c [repository] --upgrade]
|
[-h] [-v] [-a [script.tar.gz] [sources...]]
|
||||||
[-s [repository] [package][
|
[-b --list, [...] --add, --remove]
|
||||||
[-t [repository] [package]]
|
[-q --list, [...] --add, --remove]
|
||||||
[-p [repository] [package], --color=[]]
|
[-q --build, --install, --build-install]
|
||||||
[-f] [-n] [-i [...]] [-u [...]]
|
[-g --config, --config=[editor]]
|
||||||
[-o [...]] [-r [...]] [-d [...]]
|
[-l all, official, non-official, --index]
|
||||||
|
[-c [repository] --upgrade]
|
||||||
|
[-s [repository] [package]
|
||||||
|
[-t [repository] [package]
|
||||||
|
[-p [repository] [package], --color=[]]
|
||||||
|
[-n] [-f [...]] [-i [...]] [-u [...]]
|
||||||
|
[-o [...]] [-r [...]] [-d [...]]
|
||||||
|
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
\fBslpkg\fP is a terminal multitool in order to easy use Slackware packages.
|
\fBslpkg\fP is a terminal multitool in order to easy use Slackware packages.
|
||||||
|
@ -38,6 +44,8 @@ Slpkg is a user-friendly package manager for Slackware installations
|
||||||
Commands:
|
Commands:
|
||||||
update update all package lists
|
update update all package lists
|
||||||
re-create recreate package lists
|
re-create recreate package lists
|
||||||
|
repo-add [repository name] [URL] add custom repository
|
||||||
|
repo-remove [repository] remove custom repository
|
||||||
repolist list all repositories
|
repolist list all repositories
|
||||||
repoinfo [repository] repository information
|
repoinfo [repository] repository information
|
||||||
update slpkg check and update slpkg
|
update slpkg check and update slpkg
|
||||||
|
@ -45,25 +53,25 @@ Commands:
|
||||||
Optional arguments:
|
Optional arguments:
|
||||||
-h, --help show this help message and exit
|
-h, --help show this help message and exit
|
||||||
-v, --version print version and exit
|
-v, --version print version and exit
|
||||||
-a, script.tar.gz [source...] auto build SBo packages
|
-a, [script.tar.gz] [source...] auto build SBo packages
|
||||||
-b, --list, [package...] --add, --remove add, remove packages in blacklist
|
-b, --list, [package...] --add, --remove add, remove packages in blacklist
|
||||||
-q, --list, [package...] --add, --remove add, remove SBo packages in queue
|
-q, --list, [package...] --add, --remove add, remove SBo packages in queue
|
||||||
--build, --install, --build-install build, install packages from queue
|
-q, --build, --install, --build-install build, install packages from queue
|
||||||
-g, --config, --config=<editor> configuration file management
|
-g, --config, --config=<editor> configuration file management
|
||||||
-l, [repository], all list of installed packages
|
-l, all, official, non-official, --index list of installed packages
|
||||||
-c, [repository] --upgrade check for updated packages
|
-c, [repository] --upgrade check for updated packages
|
||||||
-s, [repository] [package] download, build & install
|
-s, [repository] [package] download, build & install
|
||||||
-t, [repository] [package] tracking dependencies
|
-t, [repository] [package] tracking dependencies
|
||||||
-p, [repository] [package], --color=[] print package description
|
-p, [repository] [package], --color=[] print package description
|
||||||
-f, [package] find installed packages
|
|
||||||
-n, [package] view SBo packages through network
|
-n, [package] view SBo packages through network
|
||||||
|
-f, [package...] find installed packages
|
||||||
-i, [package...] install binary packages
|
-i, [package...] install binary packages
|
||||||
-u, [package...] upgrade binary packages
|
-u, [package...] upgrade binary packages
|
||||||
-o, [package...] reinstall binary packages
|
-o, [package...] reinstall binary packages
|
||||||
-r, [package...] remove binary packages
|
-r, [package...] remove binary packages
|
||||||
-d, [package...] display the contents
|
-d, [package...] display the contents
|
||||||
|
|
||||||
.SH REPOSITORIES
|
.SH DEFAULT REPOSITORIES
|
||||||
slackware.com = 'slack'
|
slackware.com = 'slack'
|
||||||
SlackBuilds.org = 'sbo'
|
SlackBuilds.org = 'sbo'
|
||||||
Alien's = 'alien'
|
Alien's = 'alien'
|
||||||
|
@ -77,9 +85,11 @@ Optional arguments:
|
||||||
Slacke E17 and E18 = 'slacke{18}'
|
Slacke E17 and E18 = 'slacke{18}'
|
||||||
SalixOS = 'salix'
|
SalixOS = 'salix'
|
||||||
Slackel.gr = 'slackel'
|
Slackel.gr = 'slackel'
|
||||||
|
Alien's restricted = 'rested'
|
||||||
|
|
||||||
Default enable repository is 'slack' and 'sbo'.
|
Default enable repository is 'slack' and 'sbo'.
|
||||||
Add or remove repository in configuration file '/etc/slpkg/slpkg.conf'
|
Add or remove default repository in configuration file '/etc/slpkg/slpkg.conf'.
|
||||||
|
Read REPOSITORIES file for explanations.
|
||||||
|
|
||||||
.SH COLORS
|
.SH COLORS
|
||||||
red, green, yellow, cyan, grey
|
red, green, yellow, cyan, grey
|
||||||
|
@ -92,25 +102,37 @@ Print the version of program and exit.
|
||||||
.PP
|
.PP
|
||||||
The following commands are available.
|
The following commands are available.
|
||||||
|
|
||||||
.SS update
|
.SS update, create and update packages list
|
||||||
\fBslpkg\fP \fBupdate\fP
|
\fBslpkg\fP \fBupdate\fP
|
||||||
.PP
|
.PP
|
||||||
Used to re-synchronize the package lists and create some important files.
|
Used to re-synchronize the package lists and create some important files.
|
||||||
This command must run every new repository is added or new updates is available.
|
This command must run every new repository is added or new updates is available.
|
||||||
|
|
||||||
.SS re-create
|
.SS re-create, recreate packages list
|
||||||
\fBslpkg\fP \fBre-create\fP
|
\fBslpkg\fP \fBre-create\fP
|
||||||
.PP
|
.PP
|
||||||
It is sometimes useful to create all of the base file from the beginning so this
|
It is sometimes useful to create all of the base file from the beginning so this
|
||||||
command deletes all the packages lists and re-created.
|
command deletes all the packages lists and re-created.
|
||||||
|
|
||||||
.SS repolist
|
.SS repo-add, add custom repository
|
||||||
\fBslpkg\fP \fBrepolist\fP
|
\fBslpkg\fP \fBrepo-add\fP <\fIrepository name\fP> <\fIURL\fP>
|
||||||
|
.PP
|
||||||
|
Add custom binary repository. The repositories will be added to this command should
|
||||||
|
contain at least the files 'PACKAGES.TXT' and 'CHECKSUMS.md5' and optional file
|
||||||
|
ChangeLog.txt.
|
||||||
|
|
||||||
|
.SS repo-remove, remove custom repository
|
||||||
|
\fBslpkg\fP \fBrepo-remove\fP <\fIrepository\fP>
|
||||||
|
.PP
|
||||||
|
Remove custom repository by name.
|
||||||
|
|
||||||
|
.SS repo-list, repositories list
|
||||||
|
\fBslpkg\fP \fBrepo-list\fP
|
||||||
.PP
|
.PP
|
||||||
Lists all enabled or disabled repositories.
|
Lists all enabled or disabled repositories.
|
||||||
|
|
||||||
.SS repoinfo
|
.SS repo-info, repository information
|
||||||
\fBslpkg\fP \fBrepoinfo\fP <\fBrepository\fP>
|
\fBslpkg\fP \fBrepo-info\fP <\fBrepository\fP>
|
||||||
.PP
|
.PP
|
||||||
View repository information.
|
View repository information.
|
||||||
|
|
||||||
|
@ -144,10 +166,11 @@ Build or install or build and install packages are queued.
|
||||||
.PP
|
.PP
|
||||||
Print configuration file or edit with editor.
|
Print configuration file or edit with editor.
|
||||||
|
|
||||||
.SS -l , list of installed packages per repository
|
.SS -l , list of installed packages
|
||||||
\fBslpkg\fP \fB-l\fP <\fIrepository\fP> \fIall\fP \fInoarch\fP
|
\fBslpkg\fP \fB-l\fP <\fIall\fP> \fIofficial\fP \fInon-official\fP \fI--index\fP
|
||||||
.PP
|
.PP
|
||||||
List of installed packages per repository or all.
|
List of installed packages by category official or non-official. The repository 'slack' must
|
||||||
|
be enabled to work properly 'official' and 'non-official' lists.
|
||||||
|
|
||||||
.SS -c , check if your packages is up to date
|
.SS -c , check if your packages is up to date
|
||||||
\fBslpkg\fP \fB-c\fP <\fIrepository\fP> \fI--upgrade\f
|
\fBslpkg\fP \fB-c\fP <\fIrepository\fP> \fI--upgrade\f
|
||||||
|
@ -174,7 +197,7 @@ The sequence shown is that you must follow to correctly install package.
|
||||||
Print package description with color. Available colors: red, green, yellow, cyan, grey
|
Print package description with color. Available colors: red, green, yellow, cyan, grey
|
||||||
|
|
||||||
.SS -f find packages
|
.SS -f find packages
|
||||||
\fBslpkg\fP \fB-f\fP <\fIname of package\fP>
|
\fBslpkg\fP \fB-f\fP <\fIname of packages\fP>
|
||||||
.PP
|
.PP
|
||||||
Find installed packages with view total file size.
|
Find installed packages with view total file size.
|
||||||
|
|
||||||
|
@ -241,12 +264,18 @@ For example:
|
||||||
/etc/slpkg/slackware-mirrors
|
/etc/slpkg/slackware-mirrors
|
||||||
List of Slackware Mirrors
|
List of Slackware Mirrors
|
||||||
|
|
||||||
|
/etc/slpkg/custom-repositories
|
||||||
|
List of custom repositories
|
||||||
|
|
||||||
/var/log/slpkg
|
/var/log/slpkg
|
||||||
ChangeLog.txt repositories files
|
ChangeLog.txt repositories files
|
||||||
SlackBuilds logs and dependencies files
|
SlackBuilds logs and dependencies files
|
||||||
|
|
||||||
/var/lib/slpkg
|
/var/lib/slpkg
|
||||||
PACKAGES.TXT files and SLACKBUILDS.TXT file
|
PACKAGES.TXT files
|
||||||
|
SLACKBUILDS.TXT files
|
||||||
|
CHECKSUMS.md5 files
|
||||||
|
FILELIST.TXT files
|
||||||
|
|
||||||
/tmp/slpkg
|
/tmp/slpkg
|
||||||
Slpkg temponary donwloaded files and build packages
|
Slpkg temponary donwloaded files and build packages
|
||||||
|
|
3
setup.py
3
setup.py
|
@ -90,7 +90,8 @@ if "install" in sys.argv:
|
||||||
conf_file = [
|
conf_file = [
|
||||||
'conf/slpkg.conf',
|
'conf/slpkg.conf',
|
||||||
'conf/blacklist',
|
'conf/blacklist',
|
||||||
'conf/slackware-mirrors'
|
'conf/slackware-mirrors',
|
||||||
|
'conf/custom-repositories'
|
||||||
]
|
]
|
||||||
if not os.path.exists(conf_path):
|
if not os.path.exists(conf_path):
|
||||||
os.system("mkdir -p {0}".format(conf_path))
|
os.system("mkdir -p {0}".format(conf_path))
|
||||||
|
|
|
@ -8,7 +8,7 @@ config() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
CONFIGS="slpkg.conf blacklist slackware-mirrors"
|
CONFIGS="slpkg.conf blacklist slackware-mirrors custom-repositories"
|
||||||
for file in $CONFIGS; do
|
for file in $CONFIGS; do
|
||||||
config etc/slpkg/${file}.new
|
config etc/slpkg/${file}.new
|
||||||
done
|
done
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
PRGNAM=slpkg
|
PRGNAM=slpkg
|
||||||
VERSION=${VERSION:-2.1.5}
|
VERSION=${VERSION:-2.1.x-dev}
|
||||||
BUILD=${BUILD:-1}
|
BUILD=${BUILD:-1}
|
||||||
TAG=${TAG:-_dsw}
|
TAG=${TAG:-_dsw}
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | gr
|
||||||
|
|
||||||
mkdir -p $PKG/etc/slpkg
|
mkdir -p $PKG/etc/slpkg
|
||||||
# install configurations files
|
# install configurations files
|
||||||
CONFIGS="slpkg.conf blacklist slackware-mirrors"
|
CONFIGS="slpkg.conf blacklist slackware-mirrors custom-repositories"
|
||||||
for file in $CONFIGS; do
|
for file in $CONFIGS; do
|
||||||
install -D -m0644 conf/$file $PKG/etc/slpkg/${file}.new
|
install -D -m0644 conf/$file $PKG/etc/slpkg/${file}.new
|
||||||
done
|
done
|
||||||
|
|
|
@ -30,11 +30,13 @@ __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"
|
||||||
|
|
||||||
# temponary path
|
|
||||||
tmp = "/tmp/"
|
|
||||||
|
|
||||||
# Default configuration values
|
# Default configuration values
|
||||||
slack_rel = "stable"
|
slack_rel = "stable"
|
||||||
|
|
||||||
|
# Configuration path
|
||||||
|
conf_path = "/etc/{0}/".format(__all__)
|
||||||
|
|
||||||
repositories = [
|
repositories = [
|
||||||
'slack',
|
'slack',
|
||||||
'sbo',
|
'sbo',
|
||||||
|
@ -48,9 +50,30 @@ repositories = [
|
||||||
'multi',
|
'multi',
|
||||||
'slacke{18}',
|
'slacke{18}',
|
||||||
'salix',
|
'salix',
|
||||||
'slackl'
|
'slackl',
|
||||||
|
'rested'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
default_repositories = repositories[8] = 'ktown'
|
||||||
|
default_repositories = repositories[10] = 'slacke'
|
||||||
|
default_repositories = repositories
|
||||||
|
|
||||||
|
|
||||||
|
def update_repositories(repositories):
|
||||||
|
'''
|
||||||
|
Upadate with user custom repositories
|
||||||
|
'''
|
||||||
|
repo_file = "{0}custom-repositories".format(conf_path)
|
||||||
|
if os.path.isfile(repo_file):
|
||||||
|
f = open(repo_file, "r")
|
||||||
|
repositories_list = f.read()
|
||||||
|
f.close()
|
||||||
|
for line in repositories_list.splitlines():
|
||||||
|
line = line.lstrip()
|
||||||
|
if line and not line.startswith("#"):
|
||||||
|
repositories.append(line.split()[0])
|
||||||
|
return repositories
|
||||||
|
|
||||||
|
|
||||||
def ktown_repo(repositories):
|
def ktown_repo(repositories):
|
||||||
'''
|
'''
|
||||||
|
@ -75,6 +98,8 @@ def slacke_repo(repositories):
|
||||||
repositories[i] = 'slacke'
|
repositories[i] = 'slacke'
|
||||||
return sub
|
return sub
|
||||||
|
|
||||||
|
tmp = "/tmp/"
|
||||||
|
tmp_path = "{0}{1}/".format(tmp, __all__)
|
||||||
build_path = "/tmp/slpkg/build/"
|
build_path = "/tmp/slpkg/build/"
|
||||||
slpkg_tmp_packages = tmp + "slpkg/packages/"
|
slpkg_tmp_packages = tmp + "slpkg/packages/"
|
||||||
slpkg_tmp_patches = tmp + "slpkg/patches/"
|
slpkg_tmp_patches = tmp + "slpkg/patches/"
|
||||||
|
@ -87,6 +112,7 @@ remove_deps_answer = "n"
|
||||||
skip_unst = "n"
|
skip_unst = "n"
|
||||||
del_deps = "on"
|
del_deps = "on"
|
||||||
use_colors = "on"
|
use_colors = "on"
|
||||||
|
wget_option = '-c -N'
|
||||||
|
|
||||||
if os.path.isfile("/etc/slpkg/slpkg.conf"):
|
if os.path.isfile("/etc/slpkg/slpkg.conf"):
|
||||||
f = open("/etc/slpkg/slpkg.conf", "r")
|
f = open("/etc/slpkg/slpkg.conf", "r")
|
||||||
|
@ -124,9 +150,13 @@ if os.path.isfile("/etc/slpkg/slpkg.conf"):
|
||||||
del_deps = line[9:].strip()
|
del_deps = line[9:].strip()
|
||||||
if line.startswith("USE_COLORS"):
|
if line.startswith("USE_COLORS"):
|
||||||
use_colors = line[11:].strip()
|
use_colors = line[11:].strip()
|
||||||
|
if line.startswith("WGET_OPTION"):
|
||||||
|
wget_option = line[12:].strip()
|
||||||
|
|
||||||
|
|
||||||
ktown_kde_repo = ktown_repo(repositories)
|
ktown_kde_repo = ktown_repo(repositories)
|
||||||
slacke_sub_repo = slacke_repo(repositories)
|
slacke_sub_repo = slacke_repo(repositories)
|
||||||
|
update_repositories(repositories)
|
||||||
|
|
||||||
color = {
|
color = {
|
||||||
'RED': '\x1b[31m',
|
'RED': '\x1b[31m',
|
||||||
|
@ -147,6 +177,9 @@ if use_colors == "off":
|
||||||
'ENDC': ''
|
'ENDC': ''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CHECKSUMS_link = ("https://raw.githubusercontent.com/{0}/{1}/"
|
||||||
|
"master/CHECKSUMS.md5".format(__author__, __all__))
|
||||||
|
|
||||||
# file spacer
|
# file spacer
|
||||||
sp = "-"
|
sp = "-"
|
||||||
|
|
||||||
|
|
|
@ -33,38 +33,40 @@ from __metadata__ import (
|
||||||
def options():
|
def options():
|
||||||
arguments = [
|
arguments = [
|
||||||
"\nslpkg - version {0}\n".format(__version__),
|
"\nslpkg - version {0}\n".format(__version__),
|
||||||
"Slpkg is a user-friendly package manager for Slackware " +
|
"Slpkg is a user-friendly package manager for Slackware "
|
||||||
"installations\n",
|
"installations\n",
|
||||||
"Commands:",
|
"Commands:",
|
||||||
" update update all package " +
|
" update update all package "
|
||||||
"lists",
|
"lists",
|
||||||
" re-create recreate package lists",
|
" re-create recreate package lists",
|
||||||
" repolist list all repositories",
|
" repo-add [repository name] [URL] add custom repository",
|
||||||
" repoinfo [repository] repository information",
|
" repo-remove [repository] remove custom repository",
|
||||||
|
" repo-list list all repositories",
|
||||||
|
" repo-info [repository] repository information",
|
||||||
" update slpkg check and update slpkg\n",
|
" update slpkg check and update slpkg\n",
|
||||||
"Optional arguments:",
|
"Optional arguments:",
|
||||||
" -h, --help show this help message " +
|
" -h, --help show this help message "
|
||||||
"and exit",
|
"and exit",
|
||||||
" -v, --version print version and exit",
|
" -v, --version print version and exit",
|
||||||
" -a, script.tar.gz [source...] auto build SBo packages",
|
" -a, [script.tar.gz] [source...] auto build SBo packages",
|
||||||
" -b, --list, [package...] --add, --remove add, remove packages in " +
|
" -b, --list, [package...] --add, --remove add, remove packages in "
|
||||||
"blacklist",
|
"blacklist",
|
||||||
" -q, --list, [package...] --add, --remove add, remove SBo packages "
|
" -q, --list, [package...] --add, --remove add, remove SBo packages "
|
||||||
"in queue",
|
"in queue",
|
||||||
" --build, --install, --build-install build, install packages "
|
" -q, --build, --install, --build-install build, install packages "
|
||||||
"from queue",
|
"from queue",
|
||||||
" -g, --config, --config=[editor] configuration file " +
|
" -g, --config, --config=[editor] configuration file "
|
||||||
"management",
|
"management",
|
||||||
" -l, [repository], all list of installed " +
|
" -l, all, official, non-official, --index list of installed "
|
||||||
"packages",
|
"packages",
|
||||||
" -c, [repository] --upgrade check for updated " +
|
" -c, [repository] --upgrade check for updated "
|
||||||
"packages",
|
"packages",
|
||||||
" -s, [repository] [package] download, build & install",
|
" -s, [repository] [package] download, build & install",
|
||||||
" -t, [repository] [package] tracking dependencies",
|
" -t, [repository] [package] tracking dependencies",
|
||||||
" -p, [repository] [package], --color=[] print package description",
|
" -p, [repository] [package], --color=[] print package description",
|
||||||
" -f, [package] find installed packages",
|
|
||||||
" -n, [package] view SBo packages "
|
" -n, [package] view SBo packages "
|
||||||
"through network",
|
"through network",
|
||||||
|
" -f, [package...] find installed packages",
|
||||||
" -i, [package...] install binary packages",
|
" -i, [package...] install binary packages",
|
||||||
" -u, [package...] upgrade binary packages",
|
" -u, [package...] upgrade binary packages",
|
||||||
" -o, [package...] reinstall binary packages",
|
" -o, [package...] reinstall binary packages",
|
||||||
|
@ -89,17 +91,22 @@ def usage(repo):
|
||||||
"\n".format(repo))
|
"\n".format(repo))
|
||||||
view = [
|
view = [
|
||||||
"slpkg - version {0}\n".format(__version__),
|
"slpkg - version {0}\n".format(__version__),
|
||||||
"Usage: slpkg [-h] [-v] [-a script.tar.gz [sources...]]",
|
"Usage: slpkg Commands:",
|
||||||
|
" [update] [re-create] [repo-add [repository name] [URL]]",
|
||||||
|
" [repo-remove [repository]] [repo-list]",
|
||||||
|
" [repo-info [repository]] [update [slpkg]]\n",
|
||||||
|
" Optional arguments:",
|
||||||
|
" [-h] [-v] [-a [script.tar.gz] [sources...]]",
|
||||||
" [-b --list, [...] --add, --remove]",
|
" [-b --list, [...] --add, --remove]",
|
||||||
" [-q --list, [...] --add, --remove]",
|
" [-q --list, [...] --add, --remove]",
|
||||||
" [ --build, --install, --build-install]",
|
" [-q --build, --install, --build-install]",
|
||||||
" [-g --config, --config=[editor]]",
|
" [-g --config, --config=[editor]]",
|
||||||
" [-l [repository], all]",
|
" [-l all, official, non-official, --index]",
|
||||||
" [-c [repository] --upgrade]",
|
" [-c [repository] --upgrade]",
|
||||||
" [-s [repository] [package]",
|
" [-s [repository] [package]",
|
||||||
" [-t [repository] [package]",
|
" [-t [repository] [package]",
|
||||||
" [-p [repository] [package], --color=[]]",
|
" [-p [repository] [package], --color=[]]",
|
||||||
" [-f] [-n] [-i [...]] [-u [...]]",
|
" [-n] [-f [...]] [-i [...]] [-u [...]]",
|
||||||
" [-o [...]] [-r [...]] [-d [...]]\n",
|
" [-o [...]] [-r [...]] [-d [...]]\n",
|
||||||
error_repo,
|
error_repo,
|
||||||
"For more information try 'slpkg --help' or view manpage\n"
|
"For more information try 'slpkg --help' or view manpage\n"
|
||||||
|
|
|
@ -50,7 +50,8 @@ class Config(object):
|
||||||
'REMOVE_DEPS_ANSWER',
|
'REMOVE_DEPS_ANSWER',
|
||||||
'SKIP_UNST',
|
'SKIP_UNST',
|
||||||
'DEL_DEPS',
|
'DEL_DEPS',
|
||||||
'USE_COLORS'
|
'USE_COLORS',
|
||||||
|
'WGET_OPTION'
|
||||||
]
|
]
|
||||||
f = open(self.config_file, "r")
|
f = open(self.config_file, "r")
|
||||||
read_conf = f.read()
|
read_conf = f.read()
|
||||||
|
|
|
@ -24,7 +24,10 @@
|
||||||
import sys
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
from __metadata__ import color
|
from __metadata__ import (
|
||||||
|
color,
|
||||||
|
wget_option
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class Download(object):
|
class Download(object):
|
||||||
|
@ -45,8 +48,8 @@ class Download(object):
|
||||||
color['ENDC'],
|
color['ENDC'],
|
||||||
file_name))
|
file_name))
|
||||||
try:
|
try:
|
||||||
subprocess.call("wget -c -N --directory-prefix={0} {1}".format(
|
subprocess.call("wget {0} --directory-prefix={1} {2}".format(
|
||||||
self.path, dwn), shell=True)
|
wget_option, self.path, dwn), shell=True)
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print # new line at cancel
|
print # new line at cancel
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
|
@ -40,8 +40,7 @@ class FileSize(object):
|
||||||
meta = tar.info()
|
meta = tar.info()
|
||||||
return int(meta.getheaders("Content-Length")[0])
|
return int(meta.getheaders("Content-Length")[0])
|
||||||
except (urllib2.URLError, IndexError):
|
except (urllib2.URLError, IndexError):
|
||||||
print("\nError: connection refused\n")
|
return ' '
|
||||||
sys.exit(0)
|
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print("") # new line at cancel
|
print("") # new line at cancel
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
|
@ -25,6 +25,7 @@ from slack.mirrors import mirrors
|
||||||
|
|
||||||
from url_read import URL
|
from url_read import URL
|
||||||
from __metadata__ import (
|
from __metadata__ import (
|
||||||
|
CHECKSUMS_link,
|
||||||
lib_path,
|
lib_path,
|
||||||
slack_rel
|
slack_rel
|
||||||
)
|
)
|
||||||
|
@ -39,6 +40,8 @@ def pkg_checksum(binary, repo):
|
||||||
CHECKSUMS_md5 = URL(mirrors("CHECKSUMS.md5", "patches/")).reading()
|
CHECKSUMS_md5 = URL(mirrors("CHECKSUMS.md5", "patches/")).reading()
|
||||||
elif repo == "slack_patches" and slack_rel == "current":
|
elif repo == "slack_patches" and slack_rel == "current":
|
||||||
CHECKSUMS_md5 = URL(mirrors("CHECKSUMS.md5", "")).reading()
|
CHECKSUMS_md5 = URL(mirrors("CHECKSUMS.md5", "")).reading()
|
||||||
|
elif repo == "slpkg":
|
||||||
|
CHECKSUMS_md5 = URL(CHECKSUMS_link).reading()
|
||||||
else:
|
else:
|
||||||
lib = '{0}{1}_repo/CHECKSUMS.md5'.format(lib_path, repo)
|
lib = '{0}{1}_repo/CHECKSUMS.md5'.format(lib_path, repo)
|
||||||
f = open(lib, "r")
|
f = open(lib, "r")
|
||||||
|
|
|
@ -32,11 +32,14 @@ from __metadata__ import (
|
||||||
color,
|
color,
|
||||||
log_path,
|
log_path,
|
||||||
lib_path,
|
lib_path,
|
||||||
|
tmp_path,
|
||||||
|
conf_path,
|
||||||
build_path,
|
build_path,
|
||||||
repositories,
|
repositories,
|
||||||
slpkg_tmp_packages,
|
slpkg_tmp_packages,
|
||||||
slpkg_tmp_patches,
|
slpkg_tmp_patches,
|
||||||
slacke_sub_repo
|
slacke_sub_repo,
|
||||||
|
default_repositories
|
||||||
)
|
)
|
||||||
|
|
||||||
from slack.mirrors import mirrors
|
from slack.mirrors import mirrors
|
||||||
|
@ -46,14 +49,14 @@ from slack.slack_version import slack_ver
|
||||||
class Initialization(object):
|
class Initialization(object):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
if not os.path.exists("/etc/slpkg/"):
|
if not os.path.exists(conf_path):
|
||||||
os.mkdir("/etc/slpkg/")
|
os.mkdir(conf_path)
|
||||||
if not os.path.exists(log_path):
|
if not os.path.exists(log_path):
|
||||||
os.mkdir(log_path)
|
os.mkdir(log_path)
|
||||||
if not os.path.exists(lib_path):
|
if not os.path.exists(lib_path):
|
||||||
os.mkdir(lib_path)
|
os.mkdir(lib_path)
|
||||||
if not os.path.exists("/tmp/slpkg/"):
|
if not os.path.exists(tmp_path):
|
||||||
os.mkdir("/tmp/slpkg/")
|
os.mkdir(tmp_path)
|
||||||
if not os.path.exists(build_path):
|
if not os.path.exists(build_path):
|
||||||
os.makedirs(build_path)
|
os.makedirs(build_path)
|
||||||
if not os.path.exists(slpkg_tmp_packages):
|
if not os.path.exists(slpkg_tmp_packages):
|
||||||
|
@ -61,6 +64,32 @@ class Initialization(object):
|
||||||
if not os.path.exists(slpkg_tmp_patches):
|
if not os.path.exists(slpkg_tmp_patches):
|
||||||
os.makedirs(slpkg_tmp_patches)
|
os.makedirs(slpkg_tmp_patches)
|
||||||
|
|
||||||
|
def custom(self, name):
|
||||||
|
'''
|
||||||
|
Creating user select repository local library
|
||||||
|
'''
|
||||||
|
repo = Repo().custom_repository()[name]
|
||||||
|
log = log_path + name + "/"
|
||||||
|
lib = lib_path + "{0}_repo/".format(name)
|
||||||
|
lib_file = "PACKAGES.TXT"
|
||||||
|
lst_file = ""
|
||||||
|
md5_file = "CHECKSUMS.md5"
|
||||||
|
log_file = "ChangeLog.txt"
|
||||||
|
if not os.path.exists(log):
|
||||||
|
os.mkdir(log)
|
||||||
|
if not os.path.exists(lib):
|
||||||
|
os.mkdir(lib)
|
||||||
|
packages_txt = "{0}{1}".format(repo, lib_file)
|
||||||
|
filelist_txt = ""
|
||||||
|
checksums_md5 = "{0}{1}".format(repo, md5_file)
|
||||||
|
changelog_txt = "{0}{1}".format(repo, log_file)
|
||||||
|
self.write(lib, lib_file, packages_txt)
|
||||||
|
self.write(lib, md5_file, checksums_md5)
|
||||||
|
self.write(log, log_file, changelog_txt)
|
||||||
|
self.remote(log, log_file, changelog_txt, lib, lib_file,
|
||||||
|
packages_txt, md5_file, checksums_md5, lst_file,
|
||||||
|
filelist_txt)
|
||||||
|
|
||||||
def slack(self):
|
def slack(self):
|
||||||
'''
|
'''
|
||||||
Creating slack local libraries
|
Creating slack local libraries
|
||||||
|
@ -82,10 +111,12 @@ class Initialization(object):
|
||||||
ext_checksums = mirrors(md5_file, "extra/")
|
ext_checksums = mirrors(md5_file, "extra/")
|
||||||
pasture = mirrors(lib_file, "pasture/")
|
pasture = mirrors(lib_file, "pasture/")
|
||||||
pas_checksums = mirrors(md5_file, "pasture/")
|
pas_checksums = mirrors(md5_file, "pasture/")
|
||||||
packages_txt = ("{0} {1} {2}".format(packages, extra, pasture))
|
patches_txt = mirrors(lib_file, "patches/")
|
||||||
|
patches_md5 = mirrors(md5_file, "patches/")
|
||||||
checksums_md5 = ("{0} {1} {2}".format(pkg_checksums, ext_checksums,
|
packages_txt = ("{0} {1} {2} {3}".format(packages, extra, pasture,
|
||||||
pas_checksums))
|
patches_txt))
|
||||||
|
checksums_md5 = ("{0} {1} {2} {3}".format(pkg_checksums, ext_checksums,
|
||||||
|
pas_checksums, patches_md5))
|
||||||
changelog_txt = mirrors(log_file, "")
|
changelog_txt = mirrors(log_file, "")
|
||||||
self.write(lib, lib_file, packages_txt)
|
self.write(lib, lib_file, packages_txt)
|
||||||
self.write(lib, md5_file, checksums_md5)
|
self.write(lib, md5_file, checksums_md5)
|
||||||
|
@ -431,6 +462,31 @@ class Initialization(object):
|
||||||
self.remote(log, log_file, changelog_txt, lib, lib_file, packages_txt,
|
self.remote(log, log_file, changelog_txt, lib, lib_file, packages_txt,
|
||||||
md5_file, checksums_md5, lst_file, filelist_txt)
|
md5_file, checksums_md5, lst_file, filelist_txt)
|
||||||
|
|
||||||
|
def rested(self):
|
||||||
|
'''
|
||||||
|
Creating alien local library
|
||||||
|
'''
|
||||||
|
repo = Repo().restricted()
|
||||||
|
log = log_path + "rested/"
|
||||||
|
lib = lib_path + "rested_repo/"
|
||||||
|
lib_file = "PACKAGES.TXT"
|
||||||
|
lst_file = ""
|
||||||
|
md5_file = "CHECKSUMS.md5"
|
||||||
|
log_file = "ChangeLog.txt"
|
||||||
|
if not os.path.exists(log):
|
||||||
|
os.mkdir(log)
|
||||||
|
if not os.path.exists(lib):
|
||||||
|
os.mkdir(lib)
|
||||||
|
packages_txt = "{0}{1}".format(repo, lib_file)
|
||||||
|
filelist_txt = ""
|
||||||
|
checksums_md5 = "{0}{1}".format(repo, md5_file)
|
||||||
|
changelog_txt = "{0}{1}".format(repo, log_file)
|
||||||
|
self.write(lib, lib_file, packages_txt)
|
||||||
|
self.write(lib, md5_file, checksums_md5)
|
||||||
|
self.write(log, log_file, changelog_txt)
|
||||||
|
self.remote(log, log_file, changelog_txt, lib, lib_file, packages_txt,
|
||||||
|
md5_file, checksums_md5, lst_file, filelist_txt)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def write(path, data_file, file_url):
|
def write(path, data_file, file_url):
|
||||||
'''
|
'''
|
||||||
|
@ -481,6 +537,7 @@ class Initialization(object):
|
||||||
# remove FILELIST.TXT
|
# remove FILELIST.TXT
|
||||||
if args[8]:
|
if args[8]:
|
||||||
os.remove("{0}{1}".format(args[3], args[8]))
|
os.remove("{0}{1}".format(args[3], args[8]))
|
||||||
|
# read URL's
|
||||||
for fu in args[5].split():
|
for fu in args[5].split():
|
||||||
PACKAGES_TXT += URL(fu).reading()
|
PACKAGES_TXT += URL(fu).reading()
|
||||||
CHANGELOG_TXT = URL(args[2]).reading()
|
CHANGELOG_TXT = URL(args[2]).reading()
|
||||||
|
@ -547,7 +604,10 @@ class Update(object):
|
||||||
sys.stdout.write("{0}Update repository {1} ...{2}".format(
|
sys.stdout.write("{0}Update repository {1} ...{2}".format(
|
||||||
color['GREY'], repo, color['ENDC']))
|
color['GREY'], repo, color['ENDC']))
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
exec('{0}.{1}()'.format(self._init, repo))
|
if repo in default_repositories:
|
||||||
|
exec('{0}.{1}()'.format(self._init, repo))
|
||||||
|
else:
|
||||||
|
Initialization().custom(repo)
|
||||||
sys.stdout.write("{0}Done{1}\n".format(color['GREY'],
|
sys.stdout.write("{0}Done{1}\n".format(color['GREY'],
|
||||||
color['ENDC']))
|
color['ENDC']))
|
||||||
print("") # new line at end
|
print("") # new line at end
|
||||||
|
@ -556,12 +616,16 @@ class Update(object):
|
||||||
|
|
||||||
def check_exists_repositories():
|
def check_exists_repositories():
|
||||||
'''
|
'''
|
||||||
Checking if repositories exists by ChangeLog.txt file
|
Checking if repositories exists by PACKAGES.TXT file
|
||||||
'''
|
'''
|
||||||
update = False
|
update = False
|
||||||
|
pkg_list = "PACKAGES.TXT"
|
||||||
for repo in repositories:
|
for repo in repositories:
|
||||||
if not os.path.isfile("{0}{1}{2}".format(log_path, repo,
|
pkg_list = "PACKAGES.TXT"
|
||||||
"/ChangeLog.txt")):
|
if repo == "sbo":
|
||||||
|
pkg_list = "SLACKBUILDS.TXT"
|
||||||
|
if not os.path.isfile("{0}{1}{2}".format(lib_path, repo,
|
||||||
|
"_repo/{0}".format(pkg_list))):
|
||||||
update = True
|
update = True
|
||||||
if update:
|
if update:
|
||||||
print("\n Please update packages lists. Run 'slpkg update'.\n" +
|
print("\n Please update packages lists. Run 'slpkg update'.\n" +
|
||||||
|
|
|
@ -24,13 +24,13 @@
|
||||||
import sys
|
import sys
|
||||||
import getpass
|
import getpass
|
||||||
|
|
||||||
from repoinfo import RepoInfo
|
|
||||||
from repolist import RepoList
|
|
||||||
|
|
||||||
from desc import PkgDesc
|
from desc import PkgDesc
|
||||||
from config import Config
|
from config import Config
|
||||||
from queue import QueuePkgs
|
from queue import QueuePkgs
|
||||||
from messages import s_user
|
from messages import s_user
|
||||||
|
from repoinfo import RepoInfo
|
||||||
|
from repolist import RepoList
|
||||||
|
from repositories import Repo
|
||||||
from tracking import track_dep
|
from tracking import track_dep
|
||||||
from blacklist import BlackList
|
from blacklist import BlackList
|
||||||
from version import prog_version
|
from version import prog_version
|
||||||
|
@ -94,7 +94,8 @@ def main():
|
||||||
queue = QueuePkgs()
|
queue = QueuePkgs()
|
||||||
|
|
||||||
# all_args = [
|
# all_args = [
|
||||||
# 'update', 're-create', 'repolist', 'repoinfo',
|
# 'update', 're-create', 'repo-add', 'repo-remove',
|
||||||
|
# 'repo-list', 'repo-info',
|
||||||
# '-h', '--help', '-v', '-a', '-b',
|
# '-h', '--help', '-v', '-a', '-b',
|
||||||
# '-q', '-g', '-l', '-c', '-s', '-t', '-p', '-f',
|
# '-q', '-g', '-l', '-c', '-s', '-t', '-p', '-f',
|
||||||
# '-n', '-i', '-u', '-o', '-r', '-d'
|
# '-n', '-i', '-u', '-o', '-r', '-d'
|
||||||
|
@ -112,7 +113,7 @@ def main():
|
||||||
if len(args) == 2 and args[0] == "update" and args[1] == "slpkg":
|
if len(args) == 2 and args[0] == "update" and args[1] == "slpkg":
|
||||||
it_self_update()
|
it_self_update()
|
||||||
|
|
||||||
if len(args) == 1 and args[0] == "repolist":
|
if len(args) == 1 and args[0] == "repo-list":
|
||||||
RepoList().repos()
|
RepoList().repos()
|
||||||
|
|
||||||
if len(args) == 0:
|
if len(args) == 0:
|
||||||
|
@ -125,26 +126,36 @@ def main():
|
||||||
args[0] == "--version" and args[1:] == []):
|
args[0] == "--version" and args[1:] == []):
|
||||||
prog_version()
|
prog_version()
|
||||||
|
|
||||||
|
if len(args) == 3 and args[0] == "repo-add":
|
||||||
|
Repo().add(args[1], args[2])
|
||||||
|
|
||||||
|
if len(args) == 2 and args[0] == "repo-remove":
|
||||||
|
Repo().remove(args[1])
|
||||||
|
|
||||||
# checking if repositories exists
|
# checking if repositories exists
|
||||||
check_exists_repositories()
|
check_exists_repositories()
|
||||||
|
|
||||||
if len(args) == 1 and args[0] == "re-create":
|
if len(args) == 1 and args[0] == "re-create":
|
||||||
Initialization().re_create()
|
Initialization().re_create()
|
||||||
|
|
||||||
if (len(args) == 2 and args[0] == "repoinfo" and
|
if (len(args) == 2 and args[0] == "repo-info" and
|
||||||
args[1] in RepoList().all_repos):
|
args[1] in RepoList().all_repos):
|
||||||
del RepoList().all_repos
|
del RepoList().all_repos
|
||||||
RepoInfo().view(args[1])
|
RepoInfo().view(args[1])
|
||||||
elif (len(args) == 2 and args[0] == "repoinfo" and
|
elif (len(args) == 2 and args[0] == "repo-info" and
|
||||||
args[1] not in RepoList().all_repos):
|
args[1] not in RepoList().all_repos):
|
||||||
usage(args[1])
|
usage(args[1])
|
||||||
|
|
||||||
if len(args) == 3 and args[0] == "-a":
|
if len(args) == 3 and args[0] == "-a":
|
||||||
BuildPackage(args[1], args[2:], path).build()
|
BuildPackage(args[1], args[2:], path).build()
|
||||||
elif len(args) == 2 and args[0] == "-l":
|
elif len(args) == 2 and args[0] == "-l":
|
||||||
pkg_list = ["all"] + repositories
|
if args[1] in ['all', 'official', 'non-official']:
|
||||||
if args[1] in pkg_list:
|
PackageManager(None).list(args[1], False)
|
||||||
PackageManager(None).list(args[1])
|
else:
|
||||||
|
usage('')
|
||||||
|
elif len(args) == 3 and args[0] == "-l" and args[2] == '--index':
|
||||||
|
if args[1] in ['all', 'official', 'non-official']:
|
||||||
|
PackageManager(None).list(args[1], True)
|
||||||
else:
|
else:
|
||||||
usage('')
|
usage('')
|
||||||
elif len(args) == 3 and args[0] == "-c" and args[2] == "--upgrade":
|
elif len(args) == 3 and args[0] == "-c" and args[2] == "--upgrade":
|
||||||
|
@ -200,7 +211,7 @@ def main():
|
||||||
PackageManager(args[1:]).reinstall()
|
PackageManager(args[1:]).reinstall()
|
||||||
elif len(args) > 1 and args[0] == "-r":
|
elif len(args) > 1 and args[0] == "-r":
|
||||||
PackageManager(args[1:]).remove()
|
PackageManager(args[1:]).remove()
|
||||||
elif len(args) == 2 and args[0] == "-f":
|
elif len(args) > 1 and args[0] == "-f":
|
||||||
PackageManager(args[1:]).find()
|
PackageManager(args[1:]).find()
|
||||||
elif len(args) == 3 and args[0] == "-p" and args[1] in repositories:
|
elif len(args) == 3 and args[0] == "-p" and args[1] in repositories:
|
||||||
PkgDesc(args[2], args[1], "").view()
|
PkgDesc(args[2], args[1], "").view()
|
||||||
|
|
|
@ -40,7 +40,8 @@ from slpkg.__metadata__ import (
|
||||||
slpkg_tmp_packages,
|
slpkg_tmp_packages,
|
||||||
default_answer,
|
default_answer,
|
||||||
color,
|
color,
|
||||||
slacke_sub_repo
|
slacke_sub_repo,
|
||||||
|
default_repositories
|
||||||
)
|
)
|
||||||
|
|
||||||
from slpkg.pkg.find import find_package
|
from slpkg.pkg.find import find_package
|
||||||
|
@ -62,12 +63,19 @@ class OthersUpgrade(object):
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
self.step = 700
|
self.step = 700
|
||||||
|
|
||||||
exec('self._init_{0}()'.format(self.repo))
|
if repo in default_repositories:
|
||||||
|
exec('self._init_{0}()'.format(self.repo))
|
||||||
|
else:
|
||||||
|
exec('self._init_custom()')
|
||||||
|
|
||||||
f = open(self.lib, "r")
|
f = open(self.lib, "r")
|
||||||
self.PACKAGES_TXT = f.read()
|
self.PACKAGES_TXT = f.read()
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
|
def _init_custom(self):
|
||||||
|
self.lib = lib_path + "{0}_repo/PACKAGES.TXT".format(self.repo)
|
||||||
|
self.mirror = "{0}".format(Repo().custom_repository()[self.repo])
|
||||||
|
|
||||||
def _init_rlw(self):
|
def _init_rlw(self):
|
||||||
self.lib = lib_path + "rlw_repo/PACKAGES.TXT"
|
self.lib = lib_path + "rlw_repo/PACKAGES.TXT"
|
||||||
self.mirror = "{0}{1}/".format(Repo().rlw(), slack_ver())
|
self.mirror = "{0}{1}/".format(Repo().rlw(), slack_ver())
|
||||||
|
@ -145,6 +153,11 @@ class OthersUpgrade(object):
|
||||||
self.mirror = "{0}{1}/current/".format(Repo().slackel(), arch)
|
self.mirror = "{0}{1}/current/".format(Repo().slackel(), arch)
|
||||||
self.step = self.step * 2
|
self.step = self.step * 2
|
||||||
|
|
||||||
|
def _init_rested(self):
|
||||||
|
self.lib = lib_path + "rested_repo/PACKAGES.TXT"
|
||||||
|
self.mirror = Repo().restricted()
|
||||||
|
self.step = self.step * 2
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
'''
|
'''
|
||||||
Install packages from official Slackware distribution
|
Install packages from official Slackware distribution
|
||||||
|
|
|
@ -24,7 +24,6 @@
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from slpkg.toolbar import status
|
from slpkg.toolbar import status
|
||||||
from slpkg.splitting import split_package
|
|
||||||
from slpkg.slack.slack_version import slack_ver
|
from slpkg.slack.slack_version import slack_ver
|
||||||
from slpkg.__metadata__ import (
|
from slpkg.__metadata__ import (
|
||||||
lib_path,
|
lib_path,
|
||||||
|
@ -59,7 +58,7 @@ def repo_data(PACKAGES_TXT, step, repo, version):
|
||||||
rsize,
|
rsize,
|
||||||
runsize
|
runsize
|
||||||
) = rlw_filter(name, location, size, unsize)
|
) = rlw_filter(name, location, size, unsize)
|
||||||
elif repo == "alien":
|
elif repo == "alien" or repo == "rested":
|
||||||
(rname,
|
(rname,
|
||||||
rlocation,
|
rlocation,
|
||||||
rsize,
|
rsize,
|
||||||
|
@ -77,8 +76,7 @@ def repo_data(PACKAGES_TXT, step, repo, version):
|
||||||
rsize,
|
rsize,
|
||||||
runsize
|
runsize
|
||||||
) = multi_filter(name, location, size, unsize, version)
|
) = multi_filter(name, location, size, unsize, version)
|
||||||
elif repo in ["slacky", "studio", "slackr", "slonly", "slacke",
|
else:
|
||||||
"salix", "slackl"]:
|
|
||||||
rname, rlocation, rsize, runsize = name, location, size, unsize
|
rname, rlocation, rsize, runsize = name, location, size, unsize
|
||||||
return [rname, rlocation, rsize, runsize]
|
return [rname, rlocation, rsize, runsize]
|
||||||
|
|
||||||
|
@ -187,29 +185,7 @@ class Requires(object):
|
||||||
'''
|
'''
|
||||||
Grap package requirements from repositories
|
Grap package requirements from repositories
|
||||||
'''
|
'''
|
||||||
if self.repo in ["alien", "slacky", "slackr", "salix", "slackl"]:
|
if self.repo == "rlw":
|
||||||
lib = '{0}{1}_repo/PACKAGES.TXT'.format(lib_path, self.repo)
|
|
||||||
f = open(lib, "r")
|
|
||||||
PACKAGES_TXT = f.read()
|
|
||||||
f.close()
|
|
||||||
for line in PACKAGES_TXT.splitlines():
|
|
||||||
if line.startswith("PACKAGE NAME: "):
|
|
||||||
if self.repo == "slackr":
|
|
||||||
pkg_name = line[14:].strip()
|
|
||||||
else:
|
|
||||||
pkg = line[14:].strip()
|
|
||||||
pkg_name = split_package(pkg)[0]
|
|
||||||
if line.startswith("PACKAGE REQUIRED: "):
|
|
||||||
if pkg_name == self.name:
|
|
||||||
if line[17:].strip():
|
|
||||||
if self.repo in ["slacky", "salix", "slackl"]:
|
|
||||||
return self._req_fix(line)
|
|
||||||
elif self.repo == "alien":
|
|
||||||
return line[18:].strip().split(",")
|
|
||||||
else:
|
|
||||||
return line[18:].strip().split()
|
|
||||||
|
|
||||||
elif self.repo == "rlw":
|
|
||||||
# Robby's repository dependencies as shown in the central page
|
# Robby's repository dependencies as shown in the central page
|
||||||
# http://rlworkman.net/pkgs/
|
# http://rlworkman.net/pkgs/
|
||||||
dependencies = {
|
dependencies = {
|
||||||
|
@ -224,6 +200,18 @@ class Requires(object):
|
||||||
return dependencies[self.name].split()
|
return dependencies[self.name].split()
|
||||||
else:
|
else:
|
||||||
return ""
|
return ""
|
||||||
|
else:
|
||||||
|
lib = '{0}{1}_repo/PACKAGES.TXT'.format(lib_path, self.repo)
|
||||||
|
f = open(lib, "r")
|
||||||
|
PACKAGES_TXT = f.read()
|
||||||
|
f.close()
|
||||||
|
for line in PACKAGES_TXT.splitlines():
|
||||||
|
if line.startswith("PACKAGE NAME: "):
|
||||||
|
pkg_name = line[14:].strip().split('-')[0]
|
||||||
|
if line.startswith("PACKAGE REQUIRED: "):
|
||||||
|
if pkg_name == self.name:
|
||||||
|
if line[17:].strip():
|
||||||
|
return self._req_fix(line)
|
||||||
|
|
||||||
def _req_fix(self, line):
|
def _req_fix(self, line):
|
||||||
'''
|
'''
|
||||||
|
@ -231,7 +219,7 @@ class Requires(object):
|
||||||
with ',' and others with '|'
|
with ',' and others with '|'
|
||||||
'''
|
'''
|
||||||
deps = []
|
deps = []
|
||||||
for dep in line[18:].strip().split(","):
|
for dep in line[18:].strip().split(','):
|
||||||
dep = dep.split("|")
|
dep = dep.split("|")
|
||||||
if self.repo == 'slacky':
|
if self.repo == 'slacky':
|
||||||
if len(dep) > 1:
|
if len(dep) > 1:
|
||||||
|
|
|
@ -43,7 +43,8 @@ from slpkg.__metadata__ import (
|
||||||
slpkg_tmp_packages,
|
slpkg_tmp_packages,
|
||||||
default_answer,
|
default_answer,
|
||||||
color,
|
color,
|
||||||
slacke_sub_repo
|
slacke_sub_repo,
|
||||||
|
default_repositories
|
||||||
)
|
)
|
||||||
|
|
||||||
from slpkg.pkg.find import find_package
|
from slpkg.pkg.find import find_package
|
||||||
|
@ -69,13 +70,20 @@ class OthersInstall(object):
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
self.step = 700
|
self.step = 700
|
||||||
|
|
||||||
exec('self._init_{0}()'.format(self.repo))
|
if repo in default_repositories:
|
||||||
|
exec('self._init_{0}()'.format(self.repo))
|
||||||
|
else:
|
||||||
|
exec('self._init_custom()')
|
||||||
|
|
||||||
f = open(self.lib, "r")
|
f = open(self.lib, "r")
|
||||||
self.PACKAGES_TXT = f.read()
|
self.PACKAGES_TXT = f.read()
|
||||||
f.close()
|
f.close()
|
||||||
sys.stdout.write("{0}Done{1}\n".format(color['GREY'], color['ENDC']))
|
sys.stdout.write("{0}Done{1}\n".format(color['GREY'], color['ENDC']))
|
||||||
|
|
||||||
|
def _init_custom(self):
|
||||||
|
self.lib = lib_path + "{0}_repo/PACKAGES.TXT".format(self.repo)
|
||||||
|
self.mirror = "{0}".format(Repo().custom_repository()[self.repo])
|
||||||
|
|
||||||
def _init_rlw(self):
|
def _init_rlw(self):
|
||||||
self.lib = lib_path + "rlw_repo/PACKAGES.TXT"
|
self.lib = lib_path + "rlw_repo/PACKAGES.TXT"
|
||||||
self.mirror = "{0}{1}/".format(Repo().rlw(), slack_ver())
|
self.mirror = "{0}{1}/".format(Repo().rlw(), slack_ver())
|
||||||
|
@ -153,6 +161,11 @@ class OthersInstall(object):
|
||||||
self.mirror = "{0}{1}/current/".format(Repo().slackel(), arch)
|
self.mirror = "{0}{1}/current/".format(Repo().slackel(), arch)
|
||||||
self.step = self.step * 2
|
self.step = self.step * 2
|
||||||
|
|
||||||
|
def _init_rested(self):
|
||||||
|
self.lib = lib_path + "rested_repo/PACKAGES.TXT"
|
||||||
|
self.mirror = Repo().restricted()
|
||||||
|
self.step = self.step * 2
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
'''
|
'''
|
||||||
Install packages from official Slackware distribution
|
Install packages from official Slackware distribution
|
||||||
|
@ -161,6 +174,7 @@ class OthersInstall(object):
|
||||||
dependencies = resolving_deps(self.package, self.repo)
|
dependencies = resolving_deps(self.package, self.repo)
|
||||||
(dwn_links, install_all, comp_sum, uncomp_sum
|
(dwn_links, install_all, comp_sum, uncomp_sum
|
||||||
) = self.store(dependencies)
|
) = self.store(dependencies)
|
||||||
|
dependencies = equal_deps_and_install(dependencies, install_all)
|
||||||
sys.stdout.write("{0}Done{1}\n".format(color['GREY'],
|
sys.stdout.write("{0}Done{1}\n".format(color['GREY'],
|
||||||
color['ENDC']))
|
color['ENDC']))
|
||||||
print("") # new line at start
|
print("") # new line at start
|
||||||
|
@ -246,6 +260,21 @@ class OthersInstall(object):
|
||||||
return [dwn, install, comp_sum, uncomp_sum]
|
return [dwn, install, comp_sum, uncomp_sum]
|
||||||
|
|
||||||
|
|
||||||
|
def equal_deps_and_install(dependencies, install_all):
|
||||||
|
'''
|
||||||
|
This fixes be written dependencies equal to those that
|
||||||
|
will be installed because some repositories like 'salix'
|
||||||
|
said dependencies that exist in the distribution but not
|
||||||
|
in the repository itself.
|
||||||
|
'''
|
||||||
|
deps = []
|
||||||
|
for dep in dependencies:
|
||||||
|
for inst in install_all:
|
||||||
|
if inst.startswith(dep + '-'):
|
||||||
|
deps.append(dep)
|
||||||
|
return deps
|
||||||
|
|
||||||
|
|
||||||
def views(install_all, comp_sum, repository, dependencies):
|
def views(install_all, comp_sum, repository, dependencies):
|
||||||
'''
|
'''
|
||||||
Views packages
|
Views packages
|
||||||
|
@ -347,15 +376,16 @@ def write_deps(dependencies):
|
||||||
Write dependencies in a log file
|
Write dependencies in a log file
|
||||||
into directory `/var/log/slpkg/dep/`
|
into directory `/var/log/slpkg/dep/`
|
||||||
'''
|
'''
|
||||||
name = dependencies[-1]
|
if len(dependencies) > 1:
|
||||||
if find_package(name + "-", pkg_path):
|
name = dependencies[-1]
|
||||||
dep_path = log_path + "dep/"
|
if find_package(name + "-", pkg_path):
|
||||||
if not os.path.exists(dep_path):
|
dep_path = log_path + "dep/"
|
||||||
os.mkdir(dep_path)
|
if not os.path.exists(dep_path):
|
||||||
if os.path.isfile(dep_path + name):
|
os.mkdir(dep_path)
|
||||||
os.remove(dep_path + name)
|
if os.path.isfile(dep_path + name):
|
||||||
if len(dependencies[:-1]) > 0:
|
os.remove(dep_path + name)
|
||||||
with open(dep_path + name, "w") as f:
|
if len(dependencies[:-1]) > 0:
|
||||||
for dep in dependencies[:-1]:
|
with open(dep_path + name, "w") as f:
|
||||||
f.write(dep + "\n")
|
for dep in dependencies[:-1]:
|
||||||
|
f.write(dep + "\n")
|
||||||
f.close()
|
f.close()
|
||||||
|
|
|
@ -30,6 +30,7 @@ from slpkg.messages import (
|
||||||
template
|
template
|
||||||
)
|
)
|
||||||
from slpkg.__metadata__ import (
|
from slpkg.__metadata__ import (
|
||||||
|
lib_path,
|
||||||
pkg_path,
|
pkg_path,
|
||||||
sp,
|
sp,
|
||||||
log_path,
|
log_path,
|
||||||
|
@ -40,7 +41,6 @@ from slpkg.__metadata__ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
from slpkg.pkg.find import find_package
|
from slpkg.pkg.find import find_package
|
||||||
from slpkg.slack.slack_version import slack_ver
|
|
||||||
|
|
||||||
|
|
||||||
class PackageManager(object):
|
class PackageManager(object):
|
||||||
|
@ -230,34 +230,35 @@ class PackageManager(object):
|
||||||
'''
|
'''
|
||||||
matching = size = 0
|
matching = size = 0
|
||||||
print("\nPackages with matching name [ {0}{1}{2} ]\n".format(
|
print("\nPackages with matching name [ {0}{1}{2} ]\n".format(
|
||||||
color['CYAN'], ''.join(self.binary), color['ENDC']))
|
color['CYAN'], ', '.join(self.binary), color['ENDC']))
|
||||||
for match in find_package(''.join(self.binary), pkg_path):
|
for pkg in self.binary:
|
||||||
if ''.join(self.binary) in match:
|
for match in find_package(pkg, pkg_path):
|
||||||
matching += 1
|
if pkg in match:
|
||||||
print("[ {0}installed{1} ] - {2}".format(
|
matching += 1
|
||||||
color['GREEN'], color['ENDC'], match))
|
print("[ {0}installed{1} ] - {2}".format(
|
||||||
with open(pkg_path + match, "r") as f:
|
color['GREEN'], color['ENDC'], match))
|
||||||
data = f.read()
|
with open(pkg_path + match, "r") as f:
|
||||||
f.close()
|
data = f.read()
|
||||||
for line in data.splitlines():
|
f.close()
|
||||||
if line.startswith("UNCOMPRESSED PACKAGE SIZE:"):
|
for line in data.splitlines():
|
||||||
if "M" in line[26:]:
|
if line.startswith("UNCOMPRESSED PACKAGE SIZE:"):
|
||||||
size += float(line[26:-1]) * 1024
|
if "M" in line[26:]:
|
||||||
else:
|
size += float(line[26:-1]) * 1024
|
||||||
size += float(line[26:-1])
|
else:
|
||||||
break
|
size += float(line[26:-1])
|
||||||
|
break
|
||||||
if matching == 0:
|
if matching == 0:
|
||||||
message = "Can't find"
|
message = "Can't find"
|
||||||
pkg_not_found("", self.binary, message, "\n")
|
pkg_not_found("", pkg, message, "\n")
|
||||||
else:
|
else:
|
||||||
print("\n{0}Total found {1} matching packages.{2}".format(
|
print("\n{0}Total found {1} matching packages.{2}".format(
|
||||||
color['GREY'], matching, color['ENDC']))
|
color['GREY'], matching, color['ENDC']))
|
||||||
unit = "Kb"
|
unit = "Kb"
|
||||||
if size > 1024:
|
if size > 1024:
|
||||||
unit = "Mb"
|
unit = "Mb"
|
||||||
size = (size / 1024)
|
size = (size / 1024)
|
||||||
print("{0}Size of installed packages {1} {2}.{3}\n".format(
|
print("{0}Size of installed packages {1} {2}.{3}\n".format(
|
||||||
color['GREY'], round(size, 2), unit, color['ENDC']))
|
color['GREY'], round(size, 2), unit, color['ENDC']))
|
||||||
|
|
||||||
def display(self):
|
def display(self):
|
||||||
'''
|
'''
|
||||||
|
@ -278,46 +279,44 @@ class PackageManager(object):
|
||||||
bol = eol = "\n"
|
bol = eol = "\n"
|
||||||
pkg_not_found(bol, pkg, message, eol)
|
pkg_not_found(bol, pkg, message, eol)
|
||||||
|
|
||||||
def list(self, pattern):
|
def list(self, pattern, INDEX):
|
||||||
'''
|
'''
|
||||||
List with the installed packages
|
List with the installed packages
|
||||||
'''
|
'''
|
||||||
tty_size = os.popen('stty size', 'r').read().split()
|
tty_size = os.popen('stty size', 'r').read().split()
|
||||||
row = int(tty_size[0]) - 2
|
row = int(tty_size[0]) - 2
|
||||||
|
pkg_list = []
|
||||||
try:
|
try:
|
||||||
pkg_list = {
|
index, page, official, r = 0, row, [], ''
|
||||||
'sbo': ['_SBo'],
|
if os.path.isfile(lib_path + 'slack_repo/PACKAGES.TXT'):
|
||||||
'slack': ['_slack{0}'.format(slack_ver())],
|
f = open(lib_path + 'slack_repo/PACKAGES.TXT', 'r')
|
||||||
'rlw': ['_rlw'],
|
r = f.read()
|
||||||
'alien': ['alien'],
|
f.close()
|
||||||
'slacky': ['sl'],
|
for line in r.splitlines():
|
||||||
'studio': ['se'],
|
if line.startswith("PACKAGE NAME: "):
|
||||||
'slackr': ['cf'],
|
official.append(line[15:-4].strip())
|
||||||
'slonly': ['_slack'],
|
|
||||||
'ktown': ['alien'],
|
|
||||||
'multi': ['alien', 'alien_slack{0}'.format(slack_ver()),
|
|
||||||
'compat32'],
|
|
||||||
'slacke': ['jp'],
|
|
||||||
'salix': ['gv', 'rl', 'msb', 'dj', 'tg', 'cp', 'tjb', 'alien'],
|
|
||||||
'slackl': [''],
|
|
||||||
'all': ['']
|
|
||||||
}
|
|
||||||
search = pkg_list[pattern]
|
|
||||||
index, page = 0, row
|
|
||||||
for pkg in find_package("", pkg_path):
|
for pkg in find_package("", pkg_path):
|
||||||
for tag in search:
|
if pattern == 'all':
|
||||||
if pkg.endswith(tag):
|
pkg_list.append(pkg)
|
||||||
index += 1
|
elif pattern == 'official' and pkg in official:
|
||||||
print("{0}{1}:{2} {3}".format(color['GREY'], index,
|
pkg_list.append(pkg)
|
||||||
color['ENDC'], pkg))
|
elif pattern == 'non-official' and pkg not in official:
|
||||||
if index == page:
|
pkg_list.append(pkg)
|
||||||
read = raw_input("\nPress {0}Enter{1} to "
|
for pkg in sorted(pkg_list):
|
||||||
"continue... ".format(
|
if INDEX:
|
||||||
color['CYAN'], color['ENDC']))
|
index += 1
|
||||||
if read in ['Q', 'q']:
|
print("{0}{1}:{2} {3}".format(color['GREY'], index,
|
||||||
break
|
color['ENDC'], pkg))
|
||||||
print("") # new line after page
|
if index == page:
|
||||||
page += row
|
read = raw_input("\nPress {0}Enter{1} to "
|
||||||
|
"continue... ".format(color['CYAN'],
|
||||||
|
color['ENDC']))
|
||||||
|
if read in ['Q', 'q']:
|
||||||
|
break
|
||||||
|
print("") # new line after page
|
||||||
|
page += row
|
||||||
|
else:
|
||||||
|
print pkg
|
||||||
print("") # new line at end
|
print("") # new line at end
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print("") # new line at exit
|
print("") # new line at exit
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
from collections import OrderedDict
|
||||||
|
|
||||||
from downloader import Download
|
from downloader import Download
|
||||||
from __metadata__ import (
|
from __metadata__ import (
|
||||||
|
@ -96,7 +97,7 @@ class QueuePkgs(object):
|
||||||
Add packages in queue if not exist
|
Add packages in queue if not exist
|
||||||
'''
|
'''
|
||||||
queue_list = self.packages()
|
queue_list = self.packages()
|
||||||
pkgs = set(pkgs)
|
pkgs = list(OrderedDict.fromkeys(pkgs))
|
||||||
print("\nAdd packages in queue:\n")
|
print("\nAdd packages in queue:\n")
|
||||||
with open(self.queue_list, "a") as queue:
|
with open(self.queue_list, "a") as queue:
|
||||||
for pkg in pkgs:
|
for pkg in pkgs:
|
||||||
|
@ -146,9 +147,9 @@ class QueuePkgs(object):
|
||||||
sources = []
|
sources = []
|
||||||
os.chdir(build_path)
|
os.chdir(build_path)
|
||||||
script = sbo_dwn.split("/")[-1]
|
script = sbo_dwn.split("/")[-1]
|
||||||
Download(build_path, sbo_dwn).start()
|
Download(build_path, sbo_dwn.split()).start()
|
||||||
for src in source_dwn:
|
for src in source_dwn:
|
||||||
Download(build_path, src).start()
|
Download(build_path, src.split()).start()
|
||||||
sources.append(src.split("/")[-1])
|
sources.append(src.split("/")[-1])
|
||||||
BuildPackage(script, sources, build_path).build()
|
BuildPackage(script, sources, build_path).build()
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -24,9 +24,11 @@
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
from repositories import Repo
|
||||||
from sizes import units
|
from sizes import units
|
||||||
from repolist import RepoList
|
from repolist import RepoList
|
||||||
from __metadata__ import (
|
from __metadata__ import (
|
||||||
|
default_repositories,
|
||||||
lib_path,
|
lib_path,
|
||||||
log_path,
|
log_path,
|
||||||
repositories,
|
repositories,
|
||||||
|
@ -41,6 +43,7 @@ class RepoInfo(object):
|
||||||
'Last updated:': '',
|
'Last updated:': '',
|
||||||
'Number of packages:': '',
|
'Number of packages:': '',
|
||||||
'Repo id:': '',
|
'Repo id:': '',
|
||||||
|
'Default:': '',
|
||||||
'Repo url:': '',
|
'Repo url:': '',
|
||||||
'Status:': '',
|
'Status:': '',
|
||||||
'Total compressed packages:': '',
|
'Total compressed packages:': '',
|
||||||
|
@ -48,6 +51,7 @@ class RepoInfo(object):
|
||||||
}
|
}
|
||||||
|
|
||||||
self.all_repos = RepoList().all_repos
|
self.all_repos = RepoList().all_repos
|
||||||
|
self.all_repos.update(Repo().custom_repository())
|
||||||
del RepoList().all_repos
|
del RepoList().all_repos
|
||||||
|
|
||||||
def view(self, repo):
|
def view(self, repo):
|
||||||
|
@ -56,8 +60,12 @@ class RepoInfo(object):
|
||||||
'''
|
'''
|
||||||
status = '{0}disabled{1}'.format(color['RED'], color['ENDC'])
|
status = '{0}disabled{1}'.format(color['RED'], color['ENDC'])
|
||||||
self.form['Status:'] = status
|
self.form['Status:'] = status
|
||||||
|
self.form['Default:'] = 'no'
|
||||||
|
if repo in default_repositories:
|
||||||
|
self.form['Default:'] = 'yes'
|
||||||
if (repo in repositories and
|
if (repo in repositories and
|
||||||
os.path.isfile(log_path + '{0}/ChangeLog.txt'.format(repo))):
|
os.path.isfile(lib_path + '{0}_repo/PACKAGES.TXT'.format(
|
||||||
|
repo))):
|
||||||
status = '{0}enabled{1}'.format(color['GREEN'], color['ENDC'])
|
status = '{0}enabled{1}'.format(color['GREEN'], color['ENDC'])
|
||||||
if repo != 'sbo':
|
if repo != 'sbo':
|
||||||
data = self.repository_data(repo)
|
data = self.repository_data(repo)
|
||||||
|
@ -71,20 +79,22 @@ class RepoInfo(object):
|
||||||
self.form['Number of packages:'] = data[0]
|
self.form['Number of packages:'] = data[0]
|
||||||
self.form['Status:'] = status
|
self.form['Status:'] = status
|
||||||
self.form['Last updated:'] = data[3]
|
self.form['Last updated:'] = data[3]
|
||||||
elif repo == 'sbo':
|
elif (repo == 'sbo' and os.path.isfile(lib_path + '{0}_repo/'
|
||||||
sum_sbo_pkgs = 0
|
'SLACKBUILDS.TXT'.format(repo))):
|
||||||
for line in open(lib_path + 'sbo_repo/SLACKBUILDS.TXT', 'r'):
|
status = '{0}enabled{1}'.format(color['GREEN'], color['ENDC'])
|
||||||
if line.startswith('SLACKBUILD NAME: '):
|
sum_sbo_pkgs = 0
|
||||||
sum_sbo_pkgs += 1
|
for line in open(lib_path + 'sbo_repo/SLACKBUILDS.TXT', 'r'):
|
||||||
with open(log_path + 'sbo/ChangeLog.txt', 'r') as changelog_txt:
|
if line.startswith('SLACKBUILD NAME: '):
|
||||||
last_upd = changelog_txt.readline().replace('\n', '')
|
sum_sbo_pkgs += 1
|
||||||
self.form['Repo id:'] = repo
|
with open(log_path + 'sbo/ChangeLog.txt', 'r') as changelog_txt:
|
||||||
self.form['Repo url:'] = self.all_repos[repo]
|
last_upd = changelog_txt.readline().replace('\n', '')
|
||||||
self.form['Total compressed packages:'] = ''
|
self.form['Repo id:'] = repo
|
||||||
self.form['Total uncompressed packages:'] = ''
|
self.form['Repo url:'] = self.all_repos[repo]
|
||||||
self.form['Number of packages:'] = sum_sbo_pkgs
|
self.form['Total compressed packages:'] = ''
|
||||||
self.form['Status:'] = status
|
self.form['Total uncompressed packages:'] = ''
|
||||||
self.form['Last updated:'] = last_upd
|
self.form['Number of packages:'] = sum_sbo_pkgs
|
||||||
|
self.form['Status:'] = status
|
||||||
|
self.form['Last updated:'] = last_upd
|
||||||
print('')
|
print('')
|
||||||
for key, value in sorted(self.form.iteritems()):
|
for key, value in sorted(self.form.iteritems()):
|
||||||
print color['GREY'] + key + color['ENDC'], value
|
print color['GREY'] + key + color['ENDC'], value
|
||||||
|
|
|
@ -27,6 +27,7 @@ import sys
|
||||||
from repositories import Repo
|
from repositories import Repo
|
||||||
from messages import template
|
from messages import template
|
||||||
from __metadata__ import (
|
from __metadata__ import (
|
||||||
|
default_repositories,
|
||||||
repositories,
|
repositories,
|
||||||
color
|
color
|
||||||
)
|
)
|
||||||
|
@ -48,8 +49,10 @@ class RepoList(object):
|
||||||
'multi': Repo().multi(),
|
'multi': Repo().multi(),
|
||||||
'slacke': Repo().slacke(),
|
'slacke': Repo().slacke(),
|
||||||
'salix': Repo().salix(),
|
'salix': Repo().salix(),
|
||||||
'slackl': Repo().slackel()
|
'slackl': Repo().slackel(),
|
||||||
|
'rested': Repo().restricted()
|
||||||
}
|
}
|
||||||
|
self.all_repos.update(Repo().custom_repository())
|
||||||
|
|
||||||
def repos(self):
|
def repos(self):
|
||||||
'''
|
'''
|
||||||
|
@ -57,19 +60,26 @@ class RepoList(object):
|
||||||
'''
|
'''
|
||||||
print('')
|
print('')
|
||||||
template(78)
|
template(78)
|
||||||
print('{0}{1}{2}{3}{4}'.format(
|
print('{0}{1}{2}{3}{4}{5}{6}'.format(
|
||||||
'| Repo id', ' ' * 10,
|
'| Repo id', ' ' * 2,
|
||||||
'Repo name', ' ' * 45,
|
'Repo URL', ' ' * 44,
|
||||||
|
'Default', ' ' * 3,
|
||||||
'Status'))
|
'Status'))
|
||||||
template(78)
|
template(78)
|
||||||
for repo_id, repo_name in sorted(self.all_repos.iteritems()):
|
for repo_id, repo_URL in sorted(self.all_repos.iteritems()):
|
||||||
status, COLOR = 'disabled', color['RED']
|
status, COLOR = 'disabled', color['RED']
|
||||||
|
default = 'yes'
|
||||||
|
if len(repo_URL) > 49:
|
||||||
|
repo_URL = repo_URL[:48] + '~'
|
||||||
if repo_id in repositories:
|
if repo_id in repositories:
|
||||||
status, COLOR = 'enabled', color['GREEN']
|
status, COLOR = 'enabled', color['GREEN']
|
||||||
print(' {0}{1}{2}{3}{4}{5:>15}{6}'.format(
|
if repo_id not in default_repositories:
|
||||||
repo_id, ' ' * (17 - len(repo_id)),
|
default = 'no'
|
||||||
repo_name, ' ' * (45 - len(repo_name)),
|
print(' {0}{1}{2}{3}{4}{5}{6}{7:>8}{8}'.format(
|
||||||
|
repo_id, ' ' * (9 - len(repo_id)),
|
||||||
|
repo_URL, ' ' * (52 - len(repo_URL)),
|
||||||
|
default, ' ' * (8 - len(default)),
|
||||||
COLOR, status, color['ENDC']))
|
COLOR, status, color['ENDC']))
|
||||||
print("\nFor enable or disable repositories edit "
|
print("\nFor enable or disable default repositories edit "
|
||||||
"'/etc/slpkg/slpkg.conf' file\n")
|
"'/etc/slpkg/slpkg.conf' file\n")
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
|
@ -23,12 +23,82 @@
|
||||||
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
from __metadata__ import (
|
||||||
|
default_repositories,
|
||||||
|
repositories
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class Repo(object):
|
class Repo(object):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
self.repo_file = "/etc/slpkg/custom-repositories"
|
||||||
|
f = open(self.repo_file, "r")
|
||||||
|
self.repositories_list = f.read()
|
||||||
|
f.close()
|
||||||
|
|
||||||
|
def add(self, repo, url):
|
||||||
|
'''
|
||||||
|
Write custom repository name and url in a file
|
||||||
|
'''
|
||||||
|
repo_name = []
|
||||||
|
if not url.endswith('/'):
|
||||||
|
url = url + '/'
|
||||||
|
for line in self.repositories_list.splitlines():
|
||||||
|
line = line.lstrip()
|
||||||
|
if line and not line.startswith("#"):
|
||||||
|
repo_name.append(line.split()[0])
|
||||||
|
if (repo in repositories or repo in repo_name or
|
||||||
|
repo in default_repositories):
|
||||||
|
print("\nRepository name '{0}' exist, select different name.\n"
|
||||||
|
"View all repositories with command 'repo-list'.\n".format(
|
||||||
|
repo))
|
||||||
|
sys.exit(0)
|
||||||
|
elif len(repo) > 6:
|
||||||
|
print("\nMaximum repository name length must be six (6) "
|
||||||
|
"characters\n")
|
||||||
|
sys.exit(0)
|
||||||
|
elif not url.startswith('http') or url.startswith('ftp'):
|
||||||
|
print("\nWrong type URL '{0}'\n".format(url))
|
||||||
|
sys.exit(0)
|
||||||
|
with open(self.repo_file, "a") as repos:
|
||||||
|
new_line = " {0}{1}{2}\n".format(repo, ' ' * (10 - len(repo)), url)
|
||||||
|
repos.write(new_line)
|
||||||
|
repos.close()
|
||||||
|
print("\nRepository '{0}' successfully added\n".format(repo))
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
|
def remove(self, repo):
|
||||||
|
'''
|
||||||
|
Remove custom repository
|
||||||
|
'''
|
||||||
|
rem_repo = False
|
||||||
|
with open(self.repo_file, "w") as repos:
|
||||||
|
for line in self.repositories_list.splitlines():
|
||||||
|
repo_name = line.split()[0]
|
||||||
|
if repo_name != repo:
|
||||||
|
repos.write(line + "\n")
|
||||||
|
else:
|
||||||
|
print("\nRepository '{0}' successfully "
|
||||||
|
"removed\n".format(repo))
|
||||||
|
rem_repo = True
|
||||||
|
repos.close()
|
||||||
|
if not rem_repo:
|
||||||
|
print("\nRepository '{0}' doesn't exist\n".format(repo))
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
|
def custom_repository(self):
|
||||||
|
'''
|
||||||
|
Return dictionary with repo name and url
|
||||||
|
'''
|
||||||
|
dict_repo = {}
|
||||||
|
for line in self.repositories_list.splitlines():
|
||||||
|
line = line.lstrip()
|
||||||
|
if not line.startswith("#"):
|
||||||
|
dict_repo[line.split()[0]] = line.split()[1]
|
||||||
|
return dict_repo
|
||||||
|
|
||||||
def slack(self):
|
def slack(self):
|
||||||
'''
|
'''
|
||||||
|
@ -116,3 +186,10 @@ class Repo(object):
|
||||||
Slackel.gr slackel repository
|
Slackel.gr slackel repository
|
||||||
'''
|
'''
|
||||||
return "http://www.slackel.gr/repo/"
|
return "http://www.slackel.gr/repo/"
|
||||||
|
|
||||||
|
def restricted(self):
|
||||||
|
'''
|
||||||
|
Slackel.gr slackel repository
|
||||||
|
'''
|
||||||
|
return ("http://taper.alienbase.nl/mirrors/people/alien/"
|
||||||
|
"restricted_slackbuilds/")
|
||||||
|
|
|
@ -151,7 +151,7 @@ class SBoCheck(object):
|
||||||
|
|
||||||
def exists(self):
|
def exists(self):
|
||||||
'''
|
'''
|
||||||
search packages if exists in the repository
|
Search packages if exists in the repository
|
||||||
and it gets to avoidable modified packages
|
and it gets to avoidable modified packages
|
||||||
from the user with the tag _SBo
|
from the user with the tag _SBo
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -134,7 +134,7 @@ def views(install_all, comp_sum):
|
||||||
Views packages
|
Views packages
|
||||||
'''
|
'''
|
||||||
pkg_sum = uni_sum = upg_sum = 0
|
pkg_sum = uni_sum = upg_sum = 0
|
||||||
for pkg, comp in zip(install_all, comp_sum):
|
for pkg, comp in sorted(zip(install_all, comp_sum)):
|
||||||
pkg_split = split_package(pkg[:-4])
|
pkg_split = split_package(pkg[:-4])
|
||||||
if os.path.isfile(pkg_path + pkg[:-4]):
|
if os.path.isfile(pkg_path + pkg[:-4]):
|
||||||
pkg_sum += 1
|
pkg_sum += 1
|
||||||
|
|
|
@ -142,7 +142,8 @@ def views(pkg_for_upgrade, upgrade_all, comp_sum):
|
||||||
'''
|
'''
|
||||||
Views packages
|
Views packages
|
||||||
'''
|
'''
|
||||||
for upg, upgrade, size in zip(pkg_for_upgrade, upgrade_all, comp_sum):
|
for upg, upgrade, size in sorted(zip(pkg_for_upgrade, upgrade_all,
|
||||||
|
comp_sum)):
|
||||||
pkg_split = split_package(upgrade[:-4])
|
pkg_split = split_package(upgrade[:-4])
|
||||||
print(" {0}{1}{2}{3} {4}{5} {6}{7}{8}{9}{10}{11:>12}{12}".format(
|
print(" {0}{1}{2}{3} {4}{5} {6}{7}{8}{9}{10}{11:>12}{12}".format(
|
||||||
color['YELLOW'], upg, color['ENDC'],
|
color['YELLOW'], upg, color['ENDC'],
|
||||||
|
|
|
@ -28,6 +28,8 @@ import sys
|
||||||
import tarfile
|
import tarfile
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
from checksum import check_md5
|
||||||
|
from grep_md5 import pkg_checksum
|
||||||
from url_read import URL
|
from url_read import URL
|
||||||
from downloader import Download
|
from downloader import Download
|
||||||
from __metadata__ import (
|
from __metadata__ import (
|
||||||
|
@ -60,7 +62,7 @@ def it_self_update():
|
||||||
else:
|
else:
|
||||||
print("\nNew version '{0}-{1}' is available !\n".format(
|
print("\nNew version '{0}-{1}' is available !\n".format(
|
||||||
__all__, __new_version__))
|
__all__, __new_version__))
|
||||||
answer = raw_input("Would you like to continue [Y/n]? ")
|
answer = raw_input("Would you like to upgrade [Y/n]? ")
|
||||||
if answer in ['y', 'Y']:
|
if answer in ['y', 'Y']:
|
||||||
print("") # new line after answer
|
print("") # new line after answer
|
||||||
else:
|
else:
|
||||||
|
@ -70,11 +72,14 @@ def it_self_update():
|
||||||
__new_version__)]
|
__new_version__)]
|
||||||
Download(build_path, dwn_link).start()
|
Download(build_path, dwn_link).start()
|
||||||
os.chdir(build_path)
|
os.chdir(build_path)
|
||||||
tar = tarfile.open('v' + __new_version__ + '.tar.gz')
|
slpkg_tar_file = 'v' + __new_version__ + '.tar.gz'
|
||||||
|
tar = tarfile.open(slpkg_tar_file)
|
||||||
tar.extractall()
|
tar.extractall()
|
||||||
tar.close()
|
tar.close()
|
||||||
file_name = '{0}-{1}'.format(__all__, __new_version__)
|
file_name = '{0}-{1}'.format(__all__, __new_version__)
|
||||||
os.chdir(file_name)
|
os.chdir(file_name)
|
||||||
|
check_md5(pkg_checksum(slpkg_tar_file, "slpkg"),
|
||||||
|
build_path + slpkg_tar_file)
|
||||||
subprocess.call('chmod +x {0}'.format(file_name), shell=True)
|
subprocess.call('chmod +x {0}'.format(file_name), shell=True)
|
||||||
subprocess.call('sh install.sh', shell=True)
|
subprocess.call('sh install.sh', shell=True)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -24,6 +24,8 @@
|
||||||
import sys
|
import sys
|
||||||
import urllib2
|
import urllib2
|
||||||
|
|
||||||
|
from __metadata__ import color
|
||||||
|
|
||||||
|
|
||||||
class URL(object):
|
class URL(object):
|
||||||
|
|
||||||
|
@ -38,8 +40,9 @@ class URL(object):
|
||||||
f = urllib2.urlopen(self.link)
|
f = urllib2.urlopen(self.link)
|
||||||
return f.read()
|
return f.read()
|
||||||
except (urllib2.URLError, ValueError):
|
except (urllib2.URLError, ValueError):
|
||||||
print("\nslpkg: error: connection refused\n")
|
print("\n{0}Can't read file '{1}'{2}".format(
|
||||||
sys.exit(0)
|
color['RED'], self.link.split('/')[-1], color['ENDC']))
|
||||||
|
return ' '
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print("") # new line at exit
|
print("") # new line at exit
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
Loading…
Reference in a new issue