Updated to version 3.4.0

Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
Dimitris Zlatanidis 2019-01-23 09:51:02 +01:00
commit 425595b7d9
24 changed files with 1653 additions and 1661 deletions

View file

@ -1,3 +1,13 @@
3.4.0 - 21/01/2019
Updated:
- Updated manpage
- Convert examples, repositories and install text files to markdown format
- Merge sbo/remove.py in the slpkg/remove.py file
Fixed:
- Bugfix: update slpkg itself from gitlab repository
Added:
- Command 'clean-tmp' to remove the packages and the sources from /tmp/slpkg/ directory
3.3.9 - 14/01/2019
Updated:
- Readme file and added example text file

1412
EXAMPLES.md Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

29
INSTALL
View file

@ -1,29 +0,0 @@
Installation
============
Python & OS Support
-------------------
Slpkg works with Python versions 2.7.5+ .
Slpkg works on Slackware distribution and possibly in some Slackware based
distribution like SalixOS, Slackel etc.
Install slpkg
-------------
There are mainly 3 ways:
1) Suggested method, download latest slpkg version from:
https://gitlab.com/dslackw/slpkg/releases
Untar or unzip the archive, change directory in slpkg-<version>
and run './install.sh'.
slpkg auto-installed as Slackware package (root privileges are required).
2) Download binary package from https://sourceforge.net/projects/slpkg/files/binary/
and use Slackware command `upgradepkg --install-new <slpkg binary>`
3) Using pip: pip install slpkg --upgrade

25
INSTALL.md Normal file
View file

@ -0,0 +1,25 @@
### Installation
##### Python & OS Support
Slpkg works with Python versions 2.7.5+ .
Slpkg works on Slackware distribution and possibly in some Slackware based
distribution like SalixOS, Slackel etc.
##### Install slpkg
There are mainly 3 ways:
1. Suggested method, download latest slpkg version from:
'`https://gitlab.com/dslackw/slpkg/releases`'
Untar or unzip the archive, change directory in '`slpkg-<version>`'
and run '`./install.sh`'.
slpkg auto-installed as Slackware package (root privileges are required).
2. Download binary package from '`https://sourceforge.net/projects/slpkg/files/binary/`'
and use Slackware command '`upgradepkg --install-new <slpkg binary>`'
3. Using pip: '`pip install slpkg --upgrade`'

View file

@ -1,14 +1,18 @@
# slpkg
# slpkg 3.4.0
Slpkg is a powerful software package manager that installs, updates, and removes packages on
Slackware based systems. It automatically computes dependencies and figures out what things
should occur to install packages. Slpkg makes it easier to maintain groups of machines without
having to manually update.
Slpkg is a powerful software package manager that installs, updates, and removes packages on
[Slackware](http://www.slackware.com/) based systems. It automatically computes dependencies and
figures out what things should occur to install packages. Slpkg makes it easier to maintain groups
of machines without having to manually update.
Slpkg works in accordance with the standards of the organization slackbuilds.org
Slpkg works in accordance with the standards of the organization [SlackBuilds.org](https://www.slackbuilds.org)
to builds packages. Also uses the Slackware Linux instructions for installation,
upgrading or removing packages.
upgrading or removing packages.
What makes slpkg to distinguish it from the other tools; The user friendliness it's a primary
target as well as easy to understand and use, also use colors to highlight packages and
What makes slpkg to distinguish it from the other tools; The user friendliness it's a primary
target as well as easy to understand and use, also use colors to highlight packages and
display warning messages, etc.
##### Copyright
Copyright 2014-2019 © Dimitris Zlatanidis. Slackware® is a Registered Trademark of Patrick Volkerding. Linux is a Registered Trademark of Linus Torvalds.

View file

@ -1,52 +0,0 @@
--------------------------------------------------------------------------------------
This file was created to explain some peculiarities of repositories used by the slpkg.
--------------------------------------------------------------------------------------
*** NOTE: For more informations, refer directly to the repositories ***
Default repositories:
---------------------
For -current users use sbo repository:
SlackBuilds.org (sbo) FAQ(15):
Slackware current is not supported, but as a general rule, the scripts
should work on it as well.
Rworkman's (rlw) repository use dependencies where displayed in central site
'http://rlworkman.net/pkgs/' and only those. Unfortunately there is no fixed reference
dependencies file PACKAGES.TXT. You can make changes in /etc/slpkg/rlworkman.deps file.
Conraid's (conrad) repository must be used only from Slackware64 current users
and has no reference dependencies.
Slackel.gr (slackl) repository must be used only from Slackware{x86, x86_64} -current users.
MSB (msb) repository has one ChangeLog.txt file for three sub-repositories {1.14, 1.16, latest}.
So if you have updated the list of packages with version 1.14 and want to switch to version
1.16 then run "slpkg upgrade" instead of "slpkg update". MSB (msb) repository has no reference
dependencies. Similarly apply and for the repository Cinnamon (csb) but with the different
versions. Both repositories Mate and Cinnamon support Slackware -current x86_64 but not x86.
Slonly repository do not support -current for x86 arch.
Alien's ktown (ktown), Alien's multilib (multi), Slacke E17 and E18, slack-n-free, csb,
mles and Alien's restricted repository has no reference dependencies.
IMPORTANT: For Alien's (Eric Hameleers) repositories (alien, multi and ktown) should run
'slpkg upgrade' instant 'slpkg update', if you want to spend from -stable in -current or not
because there is not different file 'ChangeLog.txt' for each version.
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 file 'ChangeLog.txt'
will get warning messages that the 'ChangeLog.txt' file can not be read but 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 report these problems.
Slackware ARM repositories:
---------------------------
Slackware ARM users will must use only two repositories at the moment slack and sbo.

56
REPOSITORIES.md Normal file
View file

@ -0,0 +1,56 @@
### This file was created to explain some peculiarities of repositories used by the slpkg.
*NOTE: For more informations, refer directly to the repositories*
##### Default repositories:
For the -current users who they use the sbo repository:
SlackBuilds.org (sbo) FAQ(15):
Slackware current is not supported, but as a general rule, the scripts
should work on it as well.
Rworkman's (rlw) repository use dependencies where displayed in central site
'`http://rlworkman.net/pkgs/`' and only those. Unfortunately there is no fixed reference
dependencies in the file PACKAGES.TXT. You can make changes in '`/etc/slpkg/rlworkman.deps`'
file.
Conraid's (conrad) repository must be used only from Slackware64 current users and it has no
reference dependencies.
Slackel.gr (slackl) repository must be used only from Slackware{x86, x86_64} -current users.
MSB (msb) repository has one ChangeLog.txt file for three sub-repositories {1.14, 1.16, latest}.
So if you have updated the list of packages with the version 1.14 and you want to switch to
version 1.16 you must run '`slpkg upgrade`' instead of '`slpkg update`'. MSB (msb) repository
has no reference to the dependencies. Similarly apply and for the repository Cinnamon (csb)
but with the different versions. Both repositories Mate and Cinnamon support Slackware -current
x86_64 but not x86.
Slonly repository don't support -current for x86 arch.
Alien's ktown (ktown), Alien's multilib (multi), Slacke E17 and E18, slack-n-free, csb,
mles and Alien's restricted repository has no reference dependencies.
IMPORTANT: For Alien's (Eric Hameleers) repositories (alien, multi and ktown) should run
'`slpkg upgrade`' instant '`slpkg update`', if you want to spend from -stable in -current or
not, because there is not different file '`ChangeLog.txt`' for each version.
##### 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 file '`ChangeLog.txt`'
will get warning messages that the '`ChangeLog.txt`' file can not be read but 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 report these problems.
##### Slackware ARM repositories:
Slackware ARM users will must use only two repositories at the moment slack and sbo.

View file

@ -30,9 +30,8 @@ class Clean(object):
"""Clean all data like man page, log files, PACKAGES.TXT and
configuration files. This is useful if "slpkg" installed via
"pip" because pip uninstalls only Python packages and script
and not data. So if uninstall "# pip uninstall slpkg" after run
"# python clean.py" to remove all data and configuration file.
keep this script if you want to remove data some time.
and not data. So if uninstall with "# pip uninstall slpkg" after
run "# python clean.py" to remove all data and configuration files.
NOTE: Run this script as root."""
def __init__(self):
self.files = [
@ -57,5 +56,6 @@ class Clean(object):
print("Remove directory --> {0}".format(d))
shutil.rmtree(d)
if __name__ == "__main__":
Clean().start()

View file

@ -16,10 +16,10 @@
Slpkg is a user-friendly package manager for Slackware installations
.SH SYNOPSIS
Usage: slpkg [COMMANDS|OPTIONS] {repository|package...}
Commands:
[update, --only=[...]]
[upgrade, --only=[...]]
Commands:
[update, --repositories=[...]]
[upgrade, --repositories=[...]]
[repo-add [repository name] [URL]]
[repo-remove [repository]]
[repo-enable]
@ -29,6 +29,7 @@ Usage: slpkg [COMMANDS|OPTIONS] {repository|package...}
[health, --silent]
[deps-status, --tree, --graph=[type]]
[new-config]
[clean]
Optional arguments:
[-h] [-v]
@ -59,9 +60,9 @@ Usage: slpkg [COMMANDS|OPTIONS] {repository|package...}
.SH DESCRIPTION
Slpkg is a powerful software package manager that installs, updates, and
removes packages on Slackware based systems. It automatically computes
dependencies and figures out what things should occur to install packages.
Slpkg makes it easier to maintain groups of machines without having to
removes packages on Slackware based systems. It automatically computes
dependencies and figures out what things should occur to install packages.
Slpkg makes it easier to maintain groups of machines without having to
manually update.
.SH GLOBAL OPTIONS
@ -74,34 +75,34 @@ Print the version of program and exit.
The following commands are available.
.SS update, create and update packages list
\fBslpkg\fP \fBupdate\fP, \fB--only=[repositories...]\fP
\fBslpkg\fP \fBupdate\fP, \fB--repositories=[repositories...]\fP
.PP
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.
.PP
Additional options:
.PP
\fB--only=[repositories...]\fP : Update at specifically repositories separate by comma.
\fB--repositories=[repositories...]\fP : Update at specifically repositories separate by comma.
.SS upgrade, recreate packages list
\fBslpkg\fP \fBupgrade\fP, \fB--only=[repositories...]\fP
\fBslpkg\fP \fBupgrade\fP, \fB--repositories=[repositories...]\fP
.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 delete all the package lists and recreated.
.PP
Additional options:
.PP
\fB--only=[repositories...]\fP : Update at specifically repositories separate by comma.
\fB--repositories=[repositories...]\fP : Update at specifically repositories separate by comma.
.SS repo-add, add custom repository
\fBslpkg\fP \fBrepo-add\fP <\fIrepository name\fP> <\fIURL\fP>
.PP
Add custom binary repository. The repositories will be added to this command should
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" used to control changes.
.SS repo-remove, remove custom repository
\fBslpkg\fP \fBrepo-remove\fP <\fIrepository\fP>
\fBslpkg\fP \fBrepo-remove\fP <\fIrepository\fP>
.PP
Remove custom repository by name.
@ -137,7 +138,7 @@ Additional options:
.SS deps-status, print dependencies status
\fBslpkg\fP \fBdeps-status\fP \fB--graph=[type]\fP
.PP
Print dependencies status used by packages. Prerequisite packages have been installed
Print dependencies status used by packages. Prerequisite packages have been installed
with the option "# slpkg -s <repository> <packages>".
.PP
Additional options:
@ -152,6 +153,11 @@ Additional options:
This command searches for .new configuration files in /etc/ path and ask the user what todo with those
files.
.SS clean-tmp, the tmp/ directory
\fBslpkg\fP \fBclean-tmp\fP
.PP
Clean the /tmp/slpkg/ directory from downloaded packages and sources.
.SH OPTIONS
.PP
The following arguments are available.
@ -159,15 +165,15 @@ The following arguments are available.
.SS -a, --autobuild, auto build packages
\fBslpkg\fP \fB-a\fP <\fIscript.tar.gz\fP> <\fIsources\fP>
.PP
If you already have download the script and source with this argument you can build Slackware
package from source quickly and easy. Slpkg will grab checksum from the .info file to make control
if he does not agree with the versions you will get the wrong message. If you want switch off
If you already have download the script and source with this argument you can build Slackware
package from source quickly and easy. Slpkg will grab checksum from the .info file to make control
if he does not agree with the versions you will get the wrong message. If you want switch off
checksum from the configuration file.
.SS -b, --blacklist, add, remove, view packages in blacklist
\fBslpkg\fP \fB-b\fP <\fIname of packages\fP> \fB--add\fP, \fB--remove\fP, \fBlist\fP
.PP
Add, remove or listed packages from blacklist file. The settings here affect
Add, remove or listed packages from blacklist file. The settings here affect
all repositories. Remove all packages from blacklist use argument like
"# slpkg -b --remove". Use asterisk "*" to match pagkages like "# slpkg -b
py* --add", this add all installed packages with starts string "py" or "# slpkg -b
@ -179,7 +185,7 @@ multi:*multilib* --add", this add all multilib packages from repository "multi".
\fBslpkg\fP \fB-q\fP \fBlist\fP, \fBbuild\fP, \fBinstall\fP, \fBbuild-install\fP
.PP
Add, remove and listed sbo packages from queue. This argument is very useful if you want
to build and install multiple packages together. Note the correct order if there are
to build and install multiple packages together. Note the correct order if there are
dependencies. If you want to remove all the packages from the list run "# slpkg -q --remove".
(these arguments only working for the sbo repository)
Build or install or build and install packages are queued.
@ -192,7 +198,7 @@ Print, reset or edit configuration file.
.SS -l, --list, list of installed packages
\fBslpkg\fP \fB-l\fP <\fIrepository\fP>, \fB--index\fP, \fB--installed\fP, \fB--name\fP
.PP
Print a list of all available packages from repository, index or print only packages installed on the
Print a list of all available packages from repository, index or print only packages installed on the
system. Support command "grep" like "# slpkg -l sbo | grep python".
.PP
Additional options:
@ -207,9 +213,9 @@ Additional options:
\fBslpkg\fP \fB-c\fP <\fIrepository\fP> \fB--upgrade\fP \fB--rebuild\fP \fB--skip=[packages...]\fP,
\fB--resolve-off\fP, \fB--checklist\fP
.PP
Check your packages if up to date. Slackware patches repository works independently of the
others i.e not need before updating the list of packages by choosing "# slpkg update", works
directly with the official repository and so always you can have updated your system.
Check your packages if up to date. Slackware patches repository works independently of the
others i.e not need before updating the list of packages by choosing "# slpkg update", works
directly with the official repository and so always you can have updated your system.
.PP
Additional options:
.PP
@ -228,7 +234,7 @@ Additional options:
.SS -s, --sync, synchronize packages, download, build and install package with all dependencies
\fBslpkg\fP \fB-s\fP <\fIrepository\fP> <\fInames of packages\fP>, \fB--resolve-off\fP, \fB--case-ins\fP, \fB--patches\fP
.PP
Installs or upgrade packages from the repositories with automatically resolving all
Installs or upgrade packages from the repositories with automatically resolving all
dependencies of the package.
.PP
Additional options:
@ -265,7 +271,7 @@ Additional options:
.SS -p, --desc, print packages description
\fBslpkg\fP \fB-p\fP <\fIrepository\fP> <\fIname of package\fP>, \fB--color=[]\fP
.PP
Print package description from remote repository with color. Available colors:
Print package description from remote repository with color. Available colors:
red, green, yellow, cyan, grey
.PP
Additional options:
@ -273,9 +279,9 @@ Additional options:
\fB--color=[]\fP : Change color print.
.SS -F, --FIND, find packages from repositories
\fBslpkg\fP \fB-F\fP <\fInames of packages\fP>, \fI--case-ins\fP
\fBslpkg\fP \fB-F\fP <\fInames of packages\fP>, \fI--case-ins\fP
.PP
Find packages from all repositories are enabled. Useful command to find all available
Find packages from all repositories are enabled. Useful command to find all available
packages per repository.
.PP
Additional options:
@ -285,7 +291,7 @@ Additional options:
.SS -f, --find, find installed packages
\fBslpkg\fP \fB-f\fP <\fInames of packages\fP>, \fB--case-ins\fP, \fB--third-party\fP
.PP
Find installed packages with view total file size.
Find installed packages with view total file size.
Example you can view all installed sbo packages like "# slpkg -f _SBo".
.PP
Additional options:
@ -297,7 +303,7 @@ Additional options:
.SS -n, --network, view SBo packages
\fBslpkg\fP \fB-n\fP <\fIname of package\fP>, <\fI[pattern], --checklist\fP>, \fB--case-ins\fP
.PP
View complete slackbuilds.org site in your terminal. Read file, download,
View complete slackbuilds.org site in your terminal. Read file, download,
build or install etc. Use "--checklist" additional option to load all repository, example:
"# slpkg -n --checklist".
.PP
@ -308,26 +314,26 @@ Additional options:
\fB--case-ins\fP : Search package name in repository with case insensitive.
.SS -i, --installpkg, install Slackware binary packages
\fBslpkg\fP \fB-i\fP \fB[--warn, --md5sum, --root /otherroot, --infobox, --menu, --terse,
\fBslpkg\fP \fB-i\fP \fB[--warn, --md5sum, --root /otherroot, --infobox, --menu, --terse,
--ask, --priority ADD|REC|OPT|SKP, --tagfile /somedir/tagfile]\fP <\fIpackages.t?z\fP>
.PP
Installs single binary packages designed for use with the Slackware Linux
Installs single binary packages designed for use with the Slackware Linux
distribution into your system. More information please read "man installpkg".
.SS -u, --upgradepkg, install-upgrade Slackware binary packages with new
\fBslpkg\fP \fB-u\fP \fB[--dry-run, --install-new, --reinstall, --verbose]\fP <\fIpackages.t?z\fP>
.PP
Normally upgrade only upgrades packages that are already installed on the system,
and will skip any packages that do not already have a version installed.
Normally upgrade only upgrades packages that are already installed on the system,
and will skip any packages that do not already have a version installed.
More information please read "man upgradepkg".
.SS -r, --removepkg, remove previously installed Slackware binary packages
\fBslpkg\fP \fB-r\fP \fB[-copy, -keep, -preserve, -warn]\fP <\fInames of packages\fP>, \fB--deps\fP, \fB--check-deps\fP, \fB--tag\fP, \fB--checklist\fP, \fB--third-party\fP
.PP
Removes a previously installed Slackware package, while writing a progress report to
the standard output. A package may be specified either by the full package name (as
Removes a previously installed Slackware package, while writing a progress report to
the standard output. A package may be specified either by the full package name (as
you'd see listed in /var/log/packages/), or by the base package name. If installed
packages with command "# slpkg -s <repo> <packages>" then write a file in /var/log/slpkg/dep/
packages with command "# slpkg -s <repo> <packages>" then write a file in /var/log/slpkg/dep/
with all dependencies and it allows you can remove them all together.
More information please read "man removepkg".
.PP
@ -355,7 +361,7 @@ command.
For example:
\fBslpkg \-\-help\fP - display help for slpkg
.SH DEFAULT REPOSITORIES
.SH DEFAULT REPOSITORIES
slackware.com = "slack"
SlackBuilds.org = "sbo"
Alien's = "alien"
@ -373,7 +379,7 @@ For example:
Cinnamon Desktop Environment = "csb"
Connochaetos slack-n-free = "connos"
Microlinux mles = "mles"
Default enable repository is "slack" and "sbo".
Add or remove default repository in configuration file "/etc/slpkg/repositories.conf".
Read REPOSITORIES file for particularities.
@ -388,8 +394,8 @@ For example:
All packages ends with: "*string"
All packages include: "*string*"
.SH PASS VARIABLES TO SCRIPT
If you want to pass variables to the script exported as:
.SH PASS VARIABLES TO THE SCRIPT
If you want to pass variables to the script exported as:
Usage: <NAME_VARIABLE=value>
Example:
@ -425,7 +431,7 @@ For example:
SlackBuilds logs and dependencies files
/var/lib/slpkg
PACKAGES.TXT files
PACKAGES.TXT files
SLACKBUILDS.TXT files
CHECKSUMS.md5 files
FILELIST.TXT files
@ -437,7 +443,7 @@ For example:
.SH AUTHOR
Dimitris Zlatanidis <d.zlatanidis@gmail.com>
.SH HOMEPAGE
https://gitlab.com/dslackw/slpkg
https://dslackw.gitlab.io/slpkg/
.SH COPYRIGHT
Copyright \(co 2014-2019 Dimitris Zlatanidis

View file

@ -69,7 +69,7 @@ setup(
"view", "slackpkg", "tool", "build"],
author=_meta_.__author__,
author_email=_meta_.__email__,
url="https://gitlab.com/dslackw/slpkg",
url="https://dslackw.gitlab.io/slpkg/",
package_data={"": ["LICENSE", "README.md", "CHANGELOG"]},
data_files=[("man/man8", ["man/slpkg.8"]),
("/etc/bash_completion.d", ["conf/slpkg.bash-completion"]),

View file

@ -14,6 +14,6 @@ slpkg: computes dependencies and figures out what things should occur
slpkg: to install packages. Slpkg makes it easier to maintain groups of
slpkg: of machines without having to manually update.
slpkg:
slpkg: Homepage: https://gitlab.com/dslackw/slpkg
slpkg: Homepage: https://dslackw.gitlab.io/slpkg/
slpkg:
slpkg:

View file

@ -110,8 +110,8 @@ find $PKG/usr/man -type f -exec gzip -9 {} \;
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a README.md ChangeLog.txt LICENSE TESTING ISSUES KNOWN_ISSUES REPOSITORIES \
requirements.txt $PKG/usr/doc/$PRGNAM-$VERSION
cp -a README.md ChangeLog.txt LICENSE TESTING ISSUES KNOWN_ISSUES REPOSITORIES.md \
INSTALL.md requirements.txt $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install

View file

@ -78,11 +78,13 @@ class MetaData(object):
__all__ = "slpkg"
__author__ = "dslackw"
__version_info__ = (3, 3, 9)
__version_info__ = (3, 4, 0)
__version__ = "{0}.{1}.{2}".format(*__version_info__)
__license__ = "GNU General Public License v3 (GPLv3)"
__email__ = "d.zlatanidis@gmail.com"
__maintainer__ = "Dimitris Zlatanidis (dslackw)"
__twitter__ = "https://twitter.com/dslackw"
__homepage__ = "https://dslackw.gitlab.io/slpkg/"
# Default Slackware release
slack_rel = "stable"
@ -159,7 +161,7 @@ class MetaData(object):
slpkg_tmp_patches = _conf_slpkg["PATCHES"]
checkmd5 = _conf_slpkg["CHECKMD5"]
del_all = _conf_slpkg["DEL_ALL"]
del_build = _conf_slpkg["DEL_BUILD"]
del_folder = _conf_slpkg["DEL_BUILD"]
sbo_build_log = _conf_slpkg["SBO_BUILD_LOG"]
makeflags = _conf_slpkg["MAKEFLAGS"]
default_answer = _conf_slpkg["DEFAULT_ANSWER"]
@ -215,7 +217,7 @@ class MetaData(object):
"ENDC": ""
}
CHECKSUMS_link = ("https://raw.gitlabusercontent.com/{0}/{1}/"
CHECKSUMS_link = ("https://gitlab.com/{0}/{1}/raw/"
"master/CHECKSUMS.md5".format(__author__, __all__))
# file spacer

View file

@ -48,10 +48,10 @@ Usage: slpkg [COMMANDS|OPTIONS] {repository|package...}
_Slackware package manager_______
Commands:
update, --only=[...] Run this command to update all
the packages list.
update, --repositories=[...] Run this command to update all
the packages lists.
upgrade, --only=[...] Delete and recreate all packages
upgrade, --repositories=[...] Delete and recreate all packages
lists.
repo-add [repository name] [URL] Add custom repository.
@ -78,13 +78,15 @@ Commands:
new-config Manage .new configuration files.
clean-tmp Clean the tmp/ directory from
downloaded packages and sources.
Optional arguments:
-h | --help Print this help message and exit.
-v | --version Print program version and exit.
-a | --autobuild, [script] [source...] Auto build SBo packages.
If you already have downloaded the
If you have already downloaded the
script and the source code you can
build a new package with this
command.
@ -163,7 +165,7 @@ Optional arguments:
You can read more about slpkg from manpage or see examples from readme file.
Issues: https://gitlab.com/dslackw/slpkg/issues
Homepage: https://gitlab.com/dslackw/slpkg
Homepage: https://dslackw.gitlab.io/slpkg/
"""
header()
print(options.__doc__)
@ -173,8 +175,8 @@ def usage(repo):
"""Usage: slpkg [COMMANDS|OPTIONS] {repository|package...}
Commands:
[update, --only=[...]]
[upgrade, --only=[...]]
[update, --repositories=[...]]
[upgrade, --repositories=[...]]
[repo-add [repository name] [URL]]
[repo-remove [repository]]
[repo-enable]
@ -184,6 +186,7 @@ def usage(repo):
[health, --silent]
[deps-status, --tree, --graph=[type]]
[new-config]
[clean-tmp]
Optional arguments:
[-h] [-v]

View file

@ -1,7 +1,7 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# remove.py file is part of slpkg.
# clean.py file is part of slpkg.
# Copyright 2014-2019 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved.
@ -28,8 +28,22 @@ import shutil
from slpkg.__metadata__ import MetaData as _meta_
def delete(build_folder):
"""Delete build directory and all its contents.
def clean_tmp():
"""Delete packages and sources from tmp/ directory
"""
if _meta_.del_build in ["on", "ON"] and os.path.exists(build_folder):
shutil.rmtree(build_folder)
tmps = [_meta_.tmp_path, # /tmp/slpkg/
_meta_.build_path, # /tmp/slpkg/build/
_meta_.slpkg_tmp_packages, # /tmp/slpkg/packages/
_meta_.slpkg_tmp_patches # /tmp/slpkg/patches/
]
# Delete a whole slpkg folder from the tmp directory
if os.path.exists(tmps[0]):
shutil.rmtree(tmps[0])
print("All packages and sources were deleted from: {0}".format(
tmps[0]))
# Recreate the paths again
if not os.path.exists(tmps[0]):
for tmp in tmps:
print("Created directory: {0}".format(tmp))
os.mkdir(tmp)
print("Done!")

View file

@ -25,6 +25,7 @@
import os
import sys
from slpkg.clean import clean_tmp
from slpkg.load import Regex
from slpkg.desc import PkgDesc
from slpkg.messages import Msg
@ -82,7 +83,8 @@ class ArgParse(object):
"update-slpkg",
"health",
"deps-status",
"new-config"
"new-config",
"clean"
]
# checking if repositories exists
@ -122,7 +124,7 @@ class ArgParse(object):
if len(self.args) == 1 and self.args[0] == "update":
Update().repository(only="")
elif (len(self.args) == 2 and self.args[0] == "update" and
self.args[1].startswith("--only=")):
self.args[1].startswith("--repositories=")):
repos = self.args[1].split("=")[-1].split(",")
for rp in repos:
if rp not in self.meta.repositories:
@ -178,7 +180,7 @@ class ArgParse(object):
if len(self.args) == 1 and self.args[0] == "upgrade":
Initialization(False).upgrade(only="")
elif (len(self.args) == 2 and self.args[0] == "upgrade" and
self.args[1].startswith("--only=")):
self.args[1].startswith("--repositories=")):
repos = self.args[1].split("=")[-1].split(",")
for rp in repos:
if rp not in self.meta.repositories:
@ -239,6 +241,13 @@ class ArgParse(object):
else:
usage("")
def command_clean_tmp(self):
"""Clean all downloaded packages and sources"""
if len(self.args) == 1 and self.args[0] == "clean-tmp":
clean_tmp()
else:
usage("")
def auto_build(self):
"""Auto built tool
"""
@ -806,6 +815,7 @@ def main():
"health": argparse.command_health,
"deps-status": argparse.command_deps_status,
"new-config": argparse.command_new_config,
"clean-tmp": argparse.command_clean_tmp,
"-a": argparse.auto_build,
"--autobuild": argparse.auto_build,
"-l": argparse.pkg_list,

View file

@ -226,7 +226,7 @@ class PackageManager(object):
print("| {0}{1}*** WARNING ***{2}").format(
" " * 27, self.meta.color["RED"], self.meta.color["ENDC"])
print("| Before you use third-party option, be sure you have"
" updated the package \n| lists. Run the command"
" updated the packages \n| lists. Run the command"
" 'slpkg update' and 'slpkg -c slack --upgrade'")
self.msg.template(78)
return removed

View file

@ -23,13 +23,22 @@
import os
import shutil
from slpkg.__metadata__ import MetaData as _meta_
def delete_package(path, packages):
"""Remove downloaded packages
"""Delete downloaded packages
"""
if _meta_.del_all in ["on", "ON"]:
for pkg in packages:
os.remove(path + pkg)
def delete_folder(folder):
"""Delete folder with all files.
"""
if _meta_.del_folder in ["on", "ON"] and os.path.exists(folder):
shutil.rmtree(folder)

View file

@ -30,6 +30,7 @@ from slpkg.utils import Utils
from slpkg.messages import Msg
from slpkg.blacklist import BlackList
from slpkg.downloader import Download
from slpkg.remove import delete_folder
from slpkg.dialog_box import DialogUtil
from slpkg.security import pkg_security
from slpkg.__metadata__ import MetaData as _meta_
@ -39,7 +40,6 @@ from slpkg.pkg.build import BuildPackage
from slpkg.pkg.manager import PackageManager
from slpkg.sbo.read import ReadSBo
from slpkg.sbo.remove import delete
from slpkg.sbo.greps import SBoGrep
from slpkg.sbo.sbo_arch import SBoArch
from slpkg.sbo.compressed import SBoLink
@ -223,7 +223,7 @@ class SBoNetwork(object):
"""Build package
"""
self.build()
delete(self.build_folder)
delete_folder(self.build_folder)
raise SystemExit()
def choice_install(self):

View file

@ -32,6 +32,7 @@ from slpkg.toolbar import status
from slpkg.log_deps import write_deps
from slpkg.blacklist import BlackList
from slpkg.downloader import Download
from slpkg.remove import delete_folder
from slpkg.security import pkg_security
from slpkg.__metadata__ import MetaData as _meta_
@ -41,7 +42,6 @@ from slpkg.pkg.manager import PackageManager
from slpkg.pkg.installed import GetFromInstalled
from slpkg.sbo.greps import SBoGrep
from slpkg.sbo.remove import delete
from slpkg.sbo.sbo_arch import SBoArch
from slpkg.sbo.compressed import SBoLink
from slpkg.sbo.dependency import Requires
@ -196,7 +196,7 @@ class SBoInstall(object):
raise SystemExit()
self.msg.reference(installs, upgraded)
write_deps(self.deps_dict)
delete(self.build_folder)
delete_folder(self.build_folder)
def view_installing_for_deps(self):
"""View installing message for dependencies

View file

@ -130,7 +130,7 @@ class Patches(object):
if self.meta.arch == "x86_64":
slack_arch = "64"
print("\nSlackware{0} '{1}' v{2} distribution is up to "
"date\n".format(slack_arch, self.version, slack_ver()))
"date!\n".format(slack_arch, self.version, slack_ver()))
def store(self):
"""

View file

@ -39,11 +39,13 @@ def it_self_update():
download and update itself
"""
__new_version__ = ""
repository = "gitlab.com"
repository = "gitlab"
branch = "master"
ver_link = ("https://{0}/{1}/{2}/raw/"
"{3}/{4}/__metadata__.py".format(repository, _meta_.__author__,
_meta_.__all__, branch,
ver_link = ("https://{0}.com/{1}/{2}/raw/"
"{3}/{4}/__metadata__.py".format(repository,
_meta_.__author__,
_meta_.__all__,
branch,
_meta_.__all__))
version_data = URL(ver_link).reading()
for line in version_data.splitlines():
@ -65,12 +67,13 @@ def it_self_update():
print("") # new line after answer
else:
raise SystemExit()
dwn_link = ["https://{0}.com/{1}/{2}/archive/"
"v{3}/{4}-{5}.tar.gz".format(repository, _meta_.__author__,
_meta_.__all__,
__new_version__,
_meta_.__all__,
__new_version__)]
dwn_link = ["https://{0}.com/{1}/{2}/-/archive/"
"{3}/{4}-{5}.tar.gz".format(repository,
_meta_.__author__,
_meta_.__all__,
__new_version__,
_meta_.__all__,
__new_version__)]
if not os.path.exists(_meta_.build_path):
os.makedirs(_meta_.build_path)
Download(_meta_.build_path, dwn_link, repo="").start()

View file

@ -31,7 +31,11 @@ def prog_version():
print("Version : {0}\n"
"Licence : {1}\n"
"Email : {2}\n"
"Maintainer: {3}".format(_meta_.__version__,
"Homepage : {3}\n"
"Twitter : {4}\n"
"Maintainer: {5}".format(_meta_.__version__,
_meta_.__license__,
_meta_.__email__,
_meta_.__homepage__,
_meta_.__twitter__,
_meta_.__maintainer__))