updated for version 2.0.7

This commit is contained in:
Dimitris Zlatanidis 2014-11-22 12:04:11 +02:00
parent a3abfba873
commit 03d6b3ad46
28 changed files with 400 additions and 333 deletions

View file

@ -1,3 +1,11 @@
Version 2.0.7
22-11-2014
[Feature] - Add more option in slpkg.conf file.
- Add slackware-mirrors file in /etc/slpkg
[Updated] - Fix upgrade Slackware packages if installed.
Version 2.0.6
18-11-2014

24
INSTALL
View file

@ -17,30 +17,10 @@ There are mainly five ways:
Untar or unzip the archive, cd in slpkg-?.?.? directory.
Run install.sh in this directory `./install.sh` and slpkg auto-installed.
2) Using the SlackBuild script in the directory slpkg-?.?.?/slackbuild.
2) Download slpkg package from slackbuilds.org.
Untar the archive `tar xvf slpkg-?.?.?.tar.gz`
Copy the source tar archive `cp slpkg-?.?.?.tar.gz slpkg-?.?.?/slackbuild`,
change directory `cd slpkg-?.?.?/slackbuild`, fix the version if need in
SlackBuild.slpkg give execution permissions to script `chmod +x SlackBuild.slpkg`
and run as root ./SlackBuild.slpkg.
SlackBuild package created so install package with `upgradepkg --install-new
/tmp/slpkg-?.?.?-x86_64-1_dsw.tgz` (x86_64 for Slackware64).
3) Using pip:
`pip install slpkg` or upgrade `pip install --upgrade slpkg`
4) Download slpkg package from slackbuilds.org and run the second procedure described above.
5) Download binary package from sourceforge:
3) Download binary package from sourceforge:
https://sourceforge.net/projects/slpkg/
and use Slackware command `upgradepkg --install-new <slpkg binary>`
Proposed mode if you want to have installed the most updated version is 1 or 2 and 3
process.

View file

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

View file

@ -11,9 +11,9 @@
Latest Release:
- Version: 2.0.6
- Version: 2.0.7
- `Package <https://sourceforge.net/projects/slpkg/files/slpkg/binary/>`_
- `Source <https://github.com/dslackw/slpkg/archive/v2.0.6.tar.gz>`_
- `Source <https://github.com/dslackw/slpkg/archive/v2.0.7.tar.gz>`_
- `CHANGELOG <https://github.com/dslackw/slpkg/blob/master/CHANGELOG>`_
.. image:: https://raw.githubusercontent.com/dslackw/images/master/slpkg/logo.png
@ -32,10 +32,20 @@ Python language. It's use is for managing packages in Slackware linux distributi
Supported Repositories:
- SBo - `slackbuilds.org <http://slackbuilds.org/>`_
Arch: {x86, x86_64}
Versions: {11.0, 12.0, 12.1, 12.2, 13.0, 13.1, 13.37, 14.0, 14.1}
- Slack - `slackware.com <http://www.slackware.com/>`_
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}
- Alien - `alien bob <http://www.slackware.com/~alien/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}
- Slacky - `slacky.eu <http://repository.slacky.eu/>`_
Arch: {x86, x86_64}
Versions: {11.0, 12.0, 12.1, 12.2, 13.0, 13.1, 13.37, 14.0, 14.1}
- Robby's - `rworkman's <http://rlworkman.net/pkgs/>`_
Arch: {x86, x86_64}
Versions: {11.0, 12.0, 12.1, 12.2, 13.0, 13.1, 13.37, 14.0, 14.1}
Slpkg works in accordance with the standards of the organization slackbuilds.org
to builds packages. Also uses the Slackware linux instructions for installation,
@ -102,29 +112,38 @@ Untar the archive and run install.sh script:
.. code-block:: bash
$ tar xvf slpkg-2.0.6.tar.gz
$ cd slpkg-2.0.6
$ tar xvf slpkg-2.0.7.tar.gz
$ cd slpkg-2.0.7
$ ./install.sh
Using `pip <https://pip.pypa.io/en/latest/>`_ :
.. code-block:: bash
$ pip install --upgrade slpkg
uninstall:
$ pip uninstall slpkg
Using Slackware command:
From SourceForge:
Download binary package from `SourceForge <https://sourceforge.net/projects/slpkg/>`_
Upgrade
-------------
In each upgrade should track the configuration files in the file '/etc/slpkg' for
new updates.
Slackware Current
-----------------
For Slackware 'current' users must change the variable VERSION in /etc/slpkg.conf file.
.. code-block:: bash
$ slpkg -g --config=nano
Slackware Mirrors
-----------------
Slpkg uses the central mirror "http://mirrors.slackware.com/slackware/"
to find the nearest one. If however for some reason this troublesome
please edit the file in /etc/slpkg/slackware-mirrors
Command Line Tool Usage
-----------------------

183
conf/slackware-mirrors Normal file
View file

@ -0,0 +1,183 @@
# List of Slackware Mirrors copy from :
# http://mirrors.slackware.com/mirrorlist/
#
# slackware-mirrors file is part of slpkg.
#
# Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved.
#
# Utility for easy management packages in Slackware
#
# 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
#
#
# Slpkg uses the central mirror "http://mirrors.slackware.com/slackware/"
# to find the nearest one. If however for some reason this troublesome
# please uncomment (remove the '#' character) only one mirror from
# the list available below. You can also add a new mirror in the list
# below. Be careful is the template that the rest.
#
#
# Last Updated: Wed Nov 19 05:47:02 UTC 2014
#
# Available http mirrors:
#
# au http://ftp.swin.edu.au/slackware/
# au http://mirror.aarnet.edu.au/pub/slackware/
# au http://mirror.internode.on.net/pub/slackware/
# au http://syd.mirror.rackspace.com/slackware/
# be http://ftp.belnet.be/ftp.slackware.com/
# bg http://mirrors.unixsol.org/slackware/
# bg http://slackware.telecoms.bg/slackware/
# bg http://x.ultranet.biz/slackware/
# br http://linorg.usp.br/slackware/
# br http://mirror.ic.ufmt.br/slackware/
# ca http://mirror.csclub.uwaterloo.ca/slackware/
# ca http://mirror.its.dal.ca/slackware/
# cn http://mirror.bjtu.edu.cn/slackware/
# cz http://mirror.oss.maxcdn.com/slackware/
# de http://ftp5.gwdg.de/pub/linux/slackware/
# de http://mirror.netcologne.de/slackware/
# ec http://mirror.cedia.org.ec/slackware/
# fr http://slackware.mirrors.ovh.net/ftp.slackware.com/
# gb http://lon.mirror.rackspace.com/slackware/
# gb http://mirror.bytemark.co.uk/slackware/
# gb http://slackware.org.uk/slackware/
# gb http://www.mirrorservice.org/sites/ftp.slackware.com/pub/slackware/
# gr http://ftp.cc.uoc.gr/mirrors/linux/slackware/
# hk http://hkg.mirror.rackspace.com/slackware/
# hr http://mirror.slackware.hr/slackware/
# id http://iso.ukdw.ac.id/slackware/
# id http://mirrors.gudangteknologi.com/slackware
# id http://repo.ukdw.ac.id/slackware/
# ie http://ftp.heanet.ie/mirrors/ftp.slackware.com/pub/slackware/
# it http://slackware.muzzy.it/
# jp http://ftp.nara.wide.ad.jp/pub/Linux/slackware/
# lt http://atviras.lt/veidrodziai/slackware/
# lt http://slackware.laukas.lt
# mk http://slackware.blizoo.mk/slackware/
# nc http://mirror.lagoon.nc/pub/slackware/
# nl http://ftp.bit.nl/mirror/slackware/
# nl http://mirror.nl.leaseweb.net/slackware/
# nl http://slackware.bokxing-it.nl/mirror/
# no http://ftp.slackware.no/slackware/
# nz http://ftp.slackware.org.nz/slackware/
# ph http://mirror.pregi.net/slackware/
# pl http://ftp.slackware.pl/pub/slackware/
# pl http://piotrkosoft.net/pub/mirrors/ftp.slackware.com/pub/slackware/
# pl http://sunsite.icm.edu.pl/pub/Linux/slackware/
# pt http://darkstar.ist.utl.pt/slackware/
# pt http://ftp.rnl.tecnico.ulisboa.pt/pub/slackware/
# ru http://mirror.corbina.net/slackware/
# ru http://mirror.yandex.ru/slackware/
# ru http://slackware.tsu.ru/slackware/
# sk http://mirror.wheel.sk/slackware/
# tr http://ftp.linux.org.tr/slackware/
# tw http://ftp.yzu.edu.tw/Linux/Slackware/
# ua http://ifconfig.com.ua/slackware/
# ua http://mirror.linux.lg.ua/slackware/
# ua http://mirrors.nix.org.ua/linux/slackware/
# us http://carroll.cac.psu.edu/pub/linux/distributions/slackware
# us http://dfw.mirror.rackspace.com/slackware/
# us http://ftp.gtlib.gatech.edu/pub/slackware/
# us http://ftp.slackware.com/pub/slackware/
# us http://lug.mtu.edu/slackware/
# us http://mirror.lug.udel.edu/pub/slackware/
# us http://mirror.metrocast.net/slackware/
# us http://mirror.nexcess.net/slackware/
# us http://mirror.pw/slackware/
# us http://mirror.quintex.com/slackware/
# us http://mirrors.kingrst.com/slackware/
# us http://mirrors.xmission.com/slackware/
# us http://mirrors1.kernel.org/slackware/
# us http://mirrors2.kernel.org/slackware/
# us http://mirrors3.kernel.org/slackware/
# us http://mirrors4.kernel.org/slackware/
# us http://slackblog.com/slackware/
# us http://slackbuilds.org/mirror/slackware/
# us http://slackware.cs.utah.edu/
# us http://slackware.mirrorcatalogs.com/
# us http://slackware.mirrors.tds.net/pub/slackware/
# us http://taper.alienbase.nl/mirrors/slackware/
# za http://ftp.is.co.za/mirror/ftp.slackware.com/pub/
# za http://ftp.wa.co.za/pub/slackware/
# za http://slackware.mirror.ac.za/
#
# Available ftp mirrors:
#
# au ftp://ftp.swin.edu.au/slackware/
# au ftp://mirror.aarnet.edu.au/pub/slackware/
# au ftp://mirror.internode.on.net/pub/slackware/
# au ftp://syd.mirror.rackspace.com/slackware/
# be ftp://ftp.belnet.be/mirror/ftp.slackware.com/
# bg ftp://mirrors.unixsol.org/slackware/
# bg ftp://slackware.telecoms.bg/slackware/
# br ftp://linorg.usp.br/slackware/
# ca ftp://mirror.csclub.uwaterloo.ca/slackware/
# ca ftp://mirror.its.dal.ca/slackware/
# cz ftp://mirror.oss.maxcdn.com/slackware/
# de ftp://ftp5.gwdg.de/pub/linux/slackware/
# de ftp://mirror.netcologne.de/slackware/
# ec ftp://mirror.cedia.org.ec/slackware/
# fr ftp://slackware.mirrors.ovh.net/ftp.slackware.com/
# gb ftp://ftp.mirrorservice.org/sites/ftp.slackware.com/pub/slackware/
# gb ftp://ftp.slackware.org.uk/slackware
# gb ftp://lon.mirror.rackspace.com/slackware/
# gb ftp://mirror.bytemark.co.uk/slackware/
# gr ftp://ftp.cc.uoc.gr/mirrors/linux/slackware/
# hk ftp://hkg.mirror.rackspace.com/slackware/
# hr ftp://mirror.slackware.hr/slackware/
# ie ftp://ftp.heanet.ie/mirrors/ftp.slackware.com/pub/slackware/
# it ftp://slackware.muzzy.it/slackware/
# jp ftp://ftp.nara.wide.ad.jp/pub/Linux/slackware/
# nc ftp://mirror.lagoon.nc/pub/slackware/
# nl ftp://ftp.bit.nl/mirror/slackware/
# nl ftp://mirror.nl.leaseweb.net/slackware/
# no ftp://ftp.slackware.no/slackware/
# nz ftp://ftp.slackware.org.nz/slackware/
# ph ftp://mirror.pregi.net/slackware/
# pl ftp://ftp.piotrkosoft.net/pub/mirrors/ftp.slackware.com/pub/slackware/
# pl ftp://ftp.slackware.pl/pub/slackware/
# pl ftp://sunsite.icm.edu.pl/pub/Linux/slackware/
# pt ftp://darkstar.ist.utl.pt/pub/slackware/
# pt ftp://ftp.rnl.tecnico.ulisboa.pt/pub/slackware/
# ru ftp://mirror.corbina.net/slackware/
# ru ftp://mirror.yandex.ru/slackware/
# ru ftp://slackware.tsu.ru/slackware/
# tr ftp://ftp.linux.org.tr/slackware/
# tw ftp://ftp.yzu.edu.tw/Linux/Slackware/
# ua ftp://ifconfig.com.ua/pub/Mirror/slackware/
# ua ftp://mirrors.nix.org.ua/linux/slackware/
# us ftp://carroll.cac.psu.edu/pub/linux/distributions/slackware
# us ftp://dfw.mirror.rackspace.com/slackware/
# us ftp://ftp.gtlib.gatech.edu/pub/slackware
# us ftp://ftp.lug.udel.edu/pub/slackware/
# us ftp://ftp.slackware.com/pub/slackware/
# us ftp://lug.mtu.edu/slackware/
# us ftp://mirror.nexcess.net/slackware/
# us ftp://mirror.quintex.com/slackware/
# us ftp://mirrors.xmission.com/slackware/
# us ftp://mirrors1.kernel.org/slackware/
# us ftp://mirrors2.kernel.org/slackware/
# us ftp://mirrors3.kernel.org/slackware/
# us ftp://mirrors4.kernel.org/slackware/
# us ftp://slackware.cs.utah.edu/slackware/
# us ftp://slackware.mirrorcatalogs.com/
# us ftp://slackware.mirrors.tds.net/pub/slackware
# us ftp://taper.alienbase.nl/
# za ftp://ftp.is.co.za/mirror/ftp.slackware.com/pub/
# za ftp://ftp.wa.co.za/pub/slackware/
# za ftp://slackware.mirror.ac.za/

View file

@ -46,3 +46,11 @@ DEL_BUILD=off
# Keep build log file if SBO_BUILD_LOG is 'on'.
SBO_BUILD_LOG=on
# Define default answer to slpkg questions.
# Choose 'y' if you do not want to questions.
DEFAULT_ANSWER=n
# Define default answer for the removal of dependencies.
# Choose 'y' if you do not want to question.
REMOVE_DEPS_ANSWER=n

View file

@ -21,41 +21,25 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=slpkg
VERSION=${VERSION:-2.0.6}
VERSION=${VERSION:-2.0.7}
TAG=${TAG:-_dsw}
cd ..
# Installation script.
# With this script allows you to install the slpkg as a package SlackBuild.
# Select archive to copy in slackbuild directory
# support wget download.
if [ -f $PRGNAM-$VERSION.zip ]; then
cp $PRGNAM-$VERSION.zip $PRGNAM-$VERSION/slackbuild
cd $PRGNAM-$VERSION/slackbuild
chmod +x $PRGNAM.SlackBuild
./$PRGNAM.SlackBuild
rm $PRGNAM-$VERSION.zip
elif [ -f v$VERSION.zip ]; then
cp v$VERSION.zip $PRGNAM-$VERSION/slackbuild
cd $PRGNAM-$VERSION/slackbuild
chmod +x $PRGNAM.SlackBuild
./$PRGNAM.SlackBuild
rm v$VERSION.zip
ARCHIVES="$PRGNAM-$VERSION.tar.gz $PRGNAM-$VERSION.zip v$VERSION.tar.gz v$VERSION.zip"
cd ..
for file in $ARCHIVES; do
if [ -f $file ]; then
cp $file $PRGNAM-$VERSION/slackbuild
cd $PRGNAM-$VERSION/slackbuild
chmod +x $PRGNAM.SlackBuild
./$PRGNAM.SlackBuild
rm $file
fi
done
elif [ -f $PRGNAM-$VERSION.tar.gz ]; then
cp $PRGNAM-$VERSION.tar.gz $PRGNAM-$VERSION/slackbuild
cd $PRGNAM-$VERSION/slackbuild
chmod +x $PRGNAM.SlackBuild
./$PRGNAM.SlackBuild
rm $PRGNAM-$VERSION.tar.gz
else
cp v$VERSION.tar.gz $PRGNAM-$VERSION/slackbuild
cd $PRGNAM-$VERSION/slackbuild
chmod +x $PRGNAM.SlackBuild
./$PRGNAM.SlackBuild
rm v$VERSION.tar.gz
fi
# install or upgrade with new version
upgradepkg --install-new /tmp/$PRGNAM-$VERSION-*$TAG.tgz
upgradepkg --install-new /tmp/$PRGNAM-$VERSION-*$TAG.t?z

View file

@ -186,6 +186,9 @@ For example:
/etc/slpkg/blacklist
List of packages to skip
/etc/slpkg/slackware-mirrors
List of Slackware Mirrors
/var/log/slpkg
ChangeLog.txt repositories files
SlackBuilds logs and dependencies files

View file

@ -26,7 +26,11 @@ import sys
import gzip
import shutil
from slpkg.__metadata__ import __version__, __email__, __author__
from slpkg.__metadata__ import (
__version__,
__email__,
__author__
)
try:
from setuptools import setup
@ -81,15 +85,13 @@ if "install" in sys.argv:
os.chmod(man_path, int("444", 8))
conf_path = "/etc/slpkg/"
conf_file = "conf/slpkg.conf"
black_file = "conf/blacklist"
conf_file = [
'conf/slpkg.conf',
'conf/blacklist',
'conf/slackware-mirrors'
]
if not os.path.exists(conf_path):
os.system("mkdir -p {0}".format(conf_path))
# slpkg.conf file
if not os.path.isfile(conf_path + conf_file):
print("Installing slpkg configuration file")
shutil.copy2(conf_file, conf_path)
# blacklist file
if not os.path.isfile(conf_path + black_file):
print("Installing blacklist configuration file")
shutil.copy2(black_file, conf_path)
for conf in conf_file:
print("Installing '{0}' file".format(conf.split("/")[-1]))
shutil.copy2(conf, conf_path)

View file

@ -1,13 +0,0 @@
Slpkg is Open Source software written in Python language.
It's use is for managing packages in Slackware linux
distribution. Supported Repositories:
- SBo - slackbuilds.org
- Slack - slackware.com
- Alien - alien bob
- Slacky - slacky.eu
- Robby's - rworkman's
Slpkg works in accordance with the standards of the organization
slackbuilds.org to builds packages. Also uses the Slackware linux
instructions for installation, upgrading or removing packages.

View file

@ -8,7 +8,10 @@ config() {
fi
}
config /etc/slpkg/slpkg.conf.new
CONFIGS="slpkg.conf blacklist slackware-mirrors"
for file in $CONFIGS; do
config /etc/slpkg/${file}.new
done
if [ -x /usr/bin/update-desktop-database ]; then
/usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1

View file

@ -23,7 +23,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=slpkg
VERSION=${VERSION:-2.0.6}
VERSION=${VERSION:-2.0.7}
BUILD=${BUILD:-1}
TAG=${TAG:-_dsw}
@ -78,15 +78,11 @@ find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | gr
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
mkdir -p $PKG/etc/slpkg
# check if blacklist file if already exist in /etc/slpkg
if [ ! -f "/etc/$PRGNAM/blacklist" ]; then
mkdir -p $PKG/etc/$PRGNAM
install -D -m0644 conf/blacklist $PKG/etc/$PRGNAM/blacklist
fi
# install configuration file
mkdir -p $PKG/etc/slpkg
install -D -m0644 conf/slpkg.conf $PKG/etc/slpkg/slpkg.conf.new
# install configurations files
CONFIGS="slpkg.conf blacklist slackware-mirrors"
for file in $CONFIGS; do
install -D -m0644 conf/$file $PKG/etc/slpkg/${file}.new
done
# install man page
mkdir -p $PKG/usr/man/man8

View file

@ -1,10 +0,0 @@
PRGNAM="slpkg"
VERSION="2.0.6"
HOMEPAGE="https://github.com/dslackw/slpkg"
DOWNLOAD="https://github.com/dslackw/slpkg/archive/v2.0.6.tar.gz"
MD5SUM=""
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
MAINTAINER="Dimitris Zlatanidis"
EMAIL="d.zlatanidis@gmail.com"

View file

@ -1,7 +1,7 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# __metadata__.py
# __metadata__.py file is part of slpkg.
# Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved.
@ -24,12 +24,11 @@
import os
import getpass
from config import config_file
from messages import s_user
__all__ = "slpkg"
__author__ = "dslackw"
__version_info__ = (2, 0, 6)
__version_info__ = (2, 0, 7)
__version__ = "{0}.{1}.{2}".format(*__version_info__)
__license__ = "GNU General Public License v3 (GPLv3)"
__email__ = "d.zlatanidis@gmail.com"
@ -39,19 +38,6 @@ s_user(getpass.getuser())
# temponary path
tmp = "/tmp/"
if not os.path.exists("/etc/slpkg/"):
os.mkdir("/etc/slpkg/")
if not os.path.isfile("/etc/slpkg/slpkg.conf"):
with open("/etc/slpkg/slpkg.conf", "w") as conf:
for line in config_file():
conf.write(line)
conf.close()
f = open("/etc/slpkg/slpkg.conf", "r")
conf = f.read()
f.close()
# Default configuration values
slack_rel = "stable"
build_path = "/tmp/slpkg/build/"
@ -61,27 +47,37 @@ del_all = "on"
sbo_check_md5 = "on"
del_build = "off"
sbo_build_log = "on"
default_answer = "n"
remove_deps_answer = "n"
for line in conf.splitlines():
line = line.lstrip()
if line.startswith("VERSION"):
slack_rel = line[8:].strip()
if not slack_rel:
slack_rel = "stable"
if line.startswith("BUILD"):
build_path = line[6:].strip()
if line.startswith("PACKAGES"):
slpkg_tmp_packages = line[9:].strip()
if line.startswith("PATCHES"):
slpkg_tmp_patches = line[8:].strip()
if line.startswith("DEL_ALL"):
del_all = line[8:].strip()
if line.startswith("DEL_BUILD"):
del_build = line[10:].strip()
if line.startswith("SBO_CHECK_MD5"):
sbo_check_md5 = line[14:].strip()
if line.startswith("SBO_BUILD_LOG"):
sbo_build_log = line[14:].strip()
if os.path.isfile("/etc/slpkg/slpkg.conf"):
f = open("/etc/slpkg/slpkg.conf", "r")
conf = f.read()
f.close()
for line in conf.splitlines():
line = line.lstrip()
if line.startswith("VERSION"):
slack_rel = line[8:].strip()
if not slack_rel:
slack_rel = "stable"
if line.startswith("BUILD"):
build_path = line[6:].strip()
if line.startswith("PACKAGES"):
slpkg_tmp_packages = line[9:].strip()
if line.startswith("PATCHES"):
slpkg_tmp_patches = line[8:].strip()
if line.startswith("DEL_ALL"):
del_all = line[8:].strip()
if line.startswith("DEL_BUILD"):
del_build = line[10:].strip()
if line.startswith("SBO_CHECK_MD5"):
sbo_check_md5 = line[14:].strip()
if line.startswith("SBO_BUILD_LOG"):
sbo_build_log = line[14:].strip()
if line.startswith("DEFAULT_ANSWER"):
default_answer = line[15:].strip()
if line.startswith("REMOVE_DEPS_ANSWER"):
remove_deps_answer = line[19:].strip()
# repositories
repositories = [
@ -107,8 +103,5 @@ log_path = "/var/log/slpkg/"
# packages log files path
pkg_path = "/var/log/packages/"
# blacklist conf path
bls_path = "/etc/slpkg/"
# computer architecture
arch = os.uname()[4]

View file

@ -21,9 +21,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
from __metadata__ import bls_path
from colors import (
RED,
GREEN,
@ -37,56 +34,8 @@ class BlackList(object):
in blacklist file.
'''
def __init__(self):
'''
Initialization blacklist file if not exist in /etc/slpkg
create it by default.
'''
blacklist_conf = [
"# This is the blacklist file. Each package listed here may " +
"not be\n",
"# installed be upgraded be find or deleted.\n",
"# NOTE: The settings here affect all repositories.\n",
"#\n",
"# An example syntax is as follows:\n",
"# add a package from SBo repository:\n",
"# brasero\n",
"#\n",
"# Add package from slackware repository:\n",
"# example add package 'wicd-1.7.2.4-x86_64-4.txz':\n",
"# wicd\n",
"#\n",
"# Sometimes the automatic kernel update creates problems " +
"because you\n",
"# may need to file intervention 'lilo'. The slpkg automatically " +
"detects\n",
"# if the core has been upgraded and running 'lilo'. If you want " +
"to avoid\n",
"# any problems uncomment the lines below.\n",
"#\n",
"# kernel-firmware\n",
"# kernel-generic\n",
"# kernel-generic-smp\n",
"# kernel-headers\n",
"# kernel-huge\n",
"# kernel-huge-smp\n",
"# kernel-modules\n",
"# kernel-modules-smp\n",
"# kernel-source\n"
"#\n",
"#\n",
"# aaa_elflibs can't be updated.\n",
"aaa_elflibs\n"
]
self.quit = False
self.blackfile = bls_path + "blacklist"
if not os.path.exists(bls_path):
os.mkdir(bls_path)
if not os.path.isfile(self.blackfile):
with open(self.blackfile, "w") as conf:
for line in blacklist_conf:
conf.write(line)
conf.close()
self.blackfile = "/etc/slpkg/blacklist"
f = open(self.blackfile, "r")
self.black_conf = f.read()
f.close()

View file

@ -21,7 +21,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
import subprocess
from colors import (
@ -30,71 +29,6 @@ from colors import (
)
def config_file():
slpkg_conf = [
"# Configuration file for slpkg\n",
"\n",
"# slpkg.conf file is part of slpkg.\n",
"\n",
"# Copyright 2014 Dimitris Zlatanidis <d.zlatanidis@gmail.com>\n",
"# All rights reserved.\n",
"\n",
"# Utility for easy management packages in Slackware\n",
"\n",
"# https://github.com/dslackw/slpkg\n",
"\n",
"# Slpkg is free software: you can redistribute it and/or modify\n",
"# it under the terms of the GNU General Public License as published " +
"by\n",
"# the Free Software Foundation, either version 3 of the License, or\n",
"# (at your option) any later version.\n",
"# This program is distributed in the hope that it will be useful,\n",
"# but WITHOUT ANY WARRANTY; without even the implied warranty of\n",
"# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n",
"# GNU General Public License for more details.\n",
"# You should have received a copy of the GNU General Public License\n",
"# along with this program. If not, see <http://www.gnu.org/licenses/" +
">.\n",
"\n",
"# Slackware version 'stable' or 'current'.\n",
"VERSION=stable\n",
"\n",
"# Build directory for repository slackbuilds.org. In this directory\n",
"# downloaded sources and scripts for building.\n",
"BUILD=/tmp/slpkg/build/\n",
"\n",
"# If SBO_CHECK_MD5 is 'on' the system will check all downloaded\n",
"# sources from SBo repository.\n",
"SBO_CHECK_MD5=on\n",
"\n",
"# Download directory for others repositories that use binaries files" +
"\n",
"# for installation.\n",
"PACKAGES=/tmp/slpkg/packages/\n",
"\n",
"# Download directory for Slackware patches file.\n",
"PATCHES=/tmp/slpkg/patches/\n",
"\n",
"# Delete all downloaded files if DEL_ALL is 'on'.\n",
"DEL_ALL=on\n",
"\n",
"# Delete build directory after each process if DEL_BUILD is 'on'.\n",
"DEL_BUILD=off\n",
"\n",
"# Keep build log file if SBO_BUILD_LOG is 'on'.\n",
"SBO_BUILD_LOG=on\n"
]
if not os.path.exists("/etc/slpkg"):
os.mkdir("/etc/slpkg")
if not os.path.isfile("/etc/slpkg/slpkg.conf"):
with open("/etc/slpkg/slpkg.conf", "w") as conf:
for line in slpkg_conf:
conf.write(line)
conf.close()
return slpkg_conf
class Config(object):
def __init__(self):
@ -113,7 +47,9 @@ class Config(object):
'PATCHES',
'DEL_ALL',
'DEL_BUILD',
'SBO_BUILD_LOG'
'SBO_BUILD_LOG',
'DEFAULT_ANSWER',
'REMOVE_DEPS_ANSWER'
]
f = open(self.config_file, "r")
read_conf = f.read()
@ -129,5 +65,4 @@ class Config(object):
'''
Edit configuration file
'''
subprocess.call("{0} {1}".format(editor, self.config_file),
shell=True)
subprocess.call("{0} {1}".format(editor, self.config_file), shell=True)

View file

@ -196,7 +196,6 @@ class Initialization(object):
os.remove("{0}{1}".format(args[3], args[4]))
os.remove("{0}{1}".format(args[0], args[1]))
print("\nNEWS in " + args[1])
print("slpkg ...initialization")
sys.stdout.write("Files re-created ...")
sys.stdout.flush()
for fu in args[5].split():

View file

@ -38,7 +38,8 @@ from slpkg.colors import (
from slpkg.__metadata__ import (
pkg_path,
lib_path,
slpkg_tmp_packages
slpkg_tmp_packages,
default_answer
)
from slpkg.pkg.manager import PackageManager
@ -122,8 +123,11 @@ class OthersUpgrade(object):
unit[0]))
print("After this process, {0} {1} of additional disk "
"space will be used.{2}".format(size[1], unit[1], ENDC))
read = raw_input("\nWould you like to upgrade [Y/n]? ")
if read in ['Y', 'y']:
if default_answer == "y":
answer = default_answer
else:
answer = raw_input("\nWould you like to continue [Y/n]? ")
if answer in ['y', 'Y']:
upgrade_all.reverse()
packages_dwn(self.tmp_path, dwn_links)
upgrade(self.tmp_path, upgrade_all)

View file

@ -26,7 +26,6 @@ import os
from slpkg.toolbar import status
from slpkg.__metadata__ import lib_path
from slpkg.splitting import split_package
from slpkg.slack.slack_version import slack_ver
len_deps = 0
@ -178,6 +177,7 @@ class Requires(object):
to remove them and return only those needed.
'''
global len_deps
len_deps += len(dependencies)
name, slacky_deps = [], []
index, toolbar_width, step = 0, 700, (len_deps * 500)
for line in self.SLACK_PACKAGES_TXT.splitlines():

View file

@ -45,7 +45,8 @@ from slpkg.__metadata__ import (
pkg_path,
lib_path,
log_path,
slpkg_tmp_packages
slpkg_tmp_packages,
default_answer
)
from slpkg.pkg.find import find_package
@ -146,8 +147,12 @@ class OthersInstall(object):
print("After this process, {0} {1} of additional disk "
"space will be used.{2}".format(size[1], unit[1],
ENDC))
read = raw_input("\nWould you like to install [Y/n]? ")
if read in ['Y', 'y']:
if default_answer == "y":
answer = default_answer
else:
answer = raw_input("\nWould you like to continue " +
"[Y/n]? ")
if answer in ['y', 'Y']:
install_all.reverse()
packages_dwn(self.tmp_path, dwn_links)
install(self.tmp_path, install_all)

View file

@ -42,7 +42,8 @@ from slpkg.messages import (
from slpkg.__metadata__ import (
log_path,
sbo_build_log,
sbo_check_md5
sbo_check_md5,
default_answer
)
from slpkg.sbo.greps import SBoGrep
@ -124,8 +125,11 @@ def check_md5(sbo_md5, src):
print("| Expected: {0}".format(md5))
print("| Found: {0}".format(sbo_md5))
template(78)
read = raw_input("\nDo you want to continue [Y/n]? ")
if read == "Y" or read == "y":
if default_answer == "y":
answer = default_answer
else:
answer = raw_input("Would you like to continue [Y/n]? ")
if answer in ['y', 'Y']:
pass
else:
sys.exit()

View file

@ -39,10 +39,12 @@ from slpkg.colors import (
from slpkg.__metadata__ import (
pkg_path,
sp,
log_path
log_path,
default_answer,
remove_deps_answer
)
from find import find_package
from slpkg.pkg.find import find_package
class PackageManager(object):
@ -111,9 +113,12 @@ class PackageManager(object):
if len(removed) > 1:
msg = msg + "s"
try:
remove_pkg = raw_input(
"\nAre you sure to remove {0} {1} [Y/n]? ".format(
str(len(removed)), msg))
if default_answer == "y":
remove_pkg = default_answer
else:
remove_pkg = raw_input(
"\nAre you sure to remove {0} {1} [Y/n]? ".format(
str(len(removed)), msg))
except KeyboardInterrupt:
print("") # new line at exit
sys.exit()
@ -125,9 +130,12 @@ class PackageManager(object):
if os.path.isfile(dep_path + rmv):
dependencies = self.view_deps(dep_path, rmv)
try:
remove_dep = raw_input(
"\nRemove dependencies (maybe used by other "
"packages) [Y/n]? ")
if remove_deps_answer == "y":
remove_dep = remove_deps_answer
else:
remove_dep = raw_input(
"\nRemove dependencies (maybe used by "
"other packages) [Y/n]? ")
except KeyboardInterrupt:
print("") # new line at exit
sys.exit()

View file

@ -22,6 +22,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
class Repo(object):
def __init__(self):
@ -31,7 +34,16 @@ class Repo(object):
'''
Official slackware repository
'''
return "http://mirrors.slackware.com/slackware/"
default = "http://mirrors.slackware.com/slackware/"
if os.path.isfile("/etc/slpkg/slackware-mirrors"):
with open("/etc/slpkg/slackware-mirrors", "r") as slacks:
mirrors = slacks.read()
slacks.close()
for line in mirrors.splitlines():
line = line.rstrip()
if not line.startswith("#") and line:
default = line.split()[-1]
return default
def sbo(self):
'''

View file

@ -47,6 +47,7 @@ from slpkg.__metadata__ import (
tmp,
pkg_path,
build_path,
default_answer,
sp
)
@ -97,8 +98,11 @@ class SBoCheck(object):
# message install = msg[0]
# message upgrade = msg[1]
count, msg = view_packages(data[1], data[2], data[3])
read = raw_input("Would you like to upgrade [Y/n]? ")
if read in ['y', 'Y']:
if default_answer == "y":
answer = default_answer
else:
answer = raw_input("Would you like to continue [Y/n]? ")
if answer in ['y', 'Y']:
os.chdir(build_path)
for name, version in zip(data[0], data[2]):
prgnam = ("{0}-{1}".format(name, version))

View file

@ -34,6 +34,7 @@ from slpkg.__metadata__ import (
build_path,
log_path,
lib_path,
default_answer,
sp
)
from slpkg.colors import (
@ -118,8 +119,9 @@ class SBoInstall(object):
"{3} {4}".format(count[1], msg[0], idata[2], count[0],
msg[1]))
print("will be upgraded.{0}\n".format(ENDC))
read = arch_support(idata[3], self.UNST, idata[2], dependencies)
if read in['y', 'Y']:
answer = arch_support(idata[3], self.UNST, idata[2],
dependencies)
if answer in['y', 'Y']:
# installs = b_ins[0]
# upgraded = b_ins[1]
# versions = b_ins[2]
@ -293,12 +295,14 @@ def arch_support(source, support, package_sum, dependencies):
'''
if source in support:
print("{0}The package {1}{2}\n".format(RED, source, ENDC))
read = ""
answer = ""
elif package_sum == len(dependencies):
read = ""
answer = ""
elif default_answer == "y":
answer = default_answer
else:
read = raw_input("Do you want to continue [Y/n]? ")
return read
answer = raw_input("Would you like to continue [Y/n]? ")
return answer
def dwn_sources(sources):

View file

@ -43,7 +43,8 @@ from slpkg.colors import (
from slpkg.__metadata__ import (
pkg_path,
lib_path,
slpkg_tmp_packages
slpkg_tmp_packages,
default_answer
)
from slpkg.pkg.find import find_package
@ -104,8 +105,11 @@ class Slack(object):
unit[0]))
print("After this process, {0} {1} of additional disk space "
"will be used.{2}".format(size[1], unit[1], ENDC))
read = raw_input("\nWould you like to install [Y/n]? ")
if read in ['y', 'Y']:
if default_answer == "y":
answer = default_answer
else:
answer = raw_input("\nWould you like to continue [Y/n]? ")
if answer in ['y', 'Y']:
slack_dwn(self.tmp_path, dwn_links)
install(self.tmp_path, install_all)
delete(self.tmp_path, install_all)

View file

@ -37,9 +37,11 @@ from slpkg.colors import (
)
from slpkg.__metadata__ import (
pkg_path,
slpkg_tmp_patches
slpkg_tmp_patches,
default_answer
)
from slpkg.pkg.find import find_package
from slpkg.pkg.manager import PackageManager
from remove import delete
@ -94,8 +96,11 @@ class Patches(object):
unit[0]))
print("After this process, {0} {1} of additional disk space "
"will be used.{2}".format(size[1], unit[1], ENDC))
read = raw_input("\nWould you like to upgrade [Y/n]? ")
if read in ['y', 'Y']:
if default_answer == "y":
answer = default_answer
else:
answer = raw_input("\nWould you like to continue [Y/n]? ")
if answer in ['y', 'Y']:
slack_dwn(self.patch_path, dwn_links)
upgrade(self.patch_path, upgrade_all)
kernel(upgrade_all)
@ -117,37 +122,15 @@ class Patches(object):
(dwn, upgrade, comp_sum, uncomp_sum) = ([] for i in range(4))
data = slack_data(self.PACKAGES_TXT, self.step)
black = BlackList().packages()
if self.version == "stable": # stables versions upgrade
for name, loc, comp, uncomp in zip(data[0], data[1], data[2],
data[3]):
if (not os.path.isfile(pkg_path + name[:-4]) and split_package(
name)[0] not in black):
for name, loc, comp, uncomp in zip(data[0], data[1], data[2], data[3]):
if find_package(split_package(name)[0] + "-", pkg_path):
if (not os.path.isfile(pkg_path + name[:-4]) and
split_package(name)[0] not in black):
dwn.append("{0}{1}/{2}".format(
mirrors("", "", self.version), loc, name))
comp_sum.append(comp)
uncomp_sum.append(uncomp)
upgrade.append(name)
else: # current version upgrade
installed = []
# get all installed packages and store the package name.
for pkg in os.listdir(pkg_path):
installed.append(split_package(pkg)[0])
for name, loc, comp, uncomp in zip(data[0], data[1], data[2],
data[3]):
# If the package from the current repository is installed
# (check with the name) but not is in the path (check with
# all package like 'apr-1.5.0-x86_64-1') then add to list for
# upgrade.
# etc. 'apr' in list 'installed' ?? if yes 'apr-1.5.0-x86_64-1'
# exist in /var/log/packages ?? if no add to upgrade.
if split_package(name)[0] in installed:
if (not os.path.isfile(pkg_path + name[:-4]) and
split_package(name)[0] not in black):
dwn.append("{0}{1}/{2}".format(
mirrors("", "", self.version), loc, name))
comp_sum.append(comp)
uncomp_sum.append(uncomp)
upgrade.append(name)
return [dwn, upgrade, comp_sum, uncomp_sum]

View file

@ -37,7 +37,7 @@ class URL(object):
try:
f = urllib2.urlopen(self.link)
return f.read()
except urllib2.URLError:
except (urllib2.URLError, ValueError):
print("\nslpkg: error: connection refused\n")
sys.exit()
except KeyboardInterrupt: