mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-13 20:01:48 +01:00
updated for version 1.8.1
This commit is contained in:
parent
de141244fc
commit
5c049ea7e2
17 changed files with 174 additions and 107 deletions
|
@ -1,3 +1,10 @@
|
|||
Version 1.8.1
|
||||
04-09-2014
|
||||
|
||||
[Updated] - Fix install.sh script to install wget download tar.gz
|
||||
archive file.
|
||||
Fix install packages like adobe-reader
|
||||
|
||||
Version 1.8.0
|
||||
02-09-2014
|
||||
|
||||
|
|
4
INSTALL
4
INSTALL
|
@ -35,12 +35,14 @@ There are mainly five ways:
|
|||
|
||||
`pip install slpkg` or upgrade `pip install --upgrade slpkg`
|
||||
|
||||
4) Download slpkg package from slackbuilds.org and run the first procedure described above.
|
||||
4) Download slpkg package from slackbuilds.org and run the second procedure described above.
|
||||
|
||||
5) 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.
|
||||
|
|
2
PKG-INFO
2
PKG-INFO
|
@ -1,6 +1,6 @@
|
|||
Metadata-Version: 1.1
|
||||
Name: slpkg
|
||||
Version: 1.8.0
|
||||
Version: 1.8.1
|
||||
Author: dslackw
|
||||
Author-email: d zlatanidis at gmail com
|
||||
Maintainer: dslackw
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
.. image:: https://raw.githubusercontent.com/dslackw/images/master/slpkg/logo.png
|
||||
:target: https://github.com/dslackw/slpkg
|
||||
|
||||
slpkg 1.8.0
|
||||
slpkg 1.8.1
|
||||
===========
|
||||
|
||||
`Slpkg <https://github.com/dslackw/slpkg>`_ is a terminal multitool in order to easy use `Slackware <http://www.slackware.com/>`_
|
||||
|
@ -87,8 +87,8 @@ Untar the archive and run install.sh script:
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
$ tar xvf slpkg-1.8.0.tar.gz
|
||||
$ cd slpkg-1.8.0
|
||||
$ tar xvf slpkg-1.8.1.tar.gz
|
||||
$ cd slpkg-1.8.1
|
||||
$ ./install.sh
|
||||
|
||||
Using `pip <https://pip.pypa.io/en/latest/>`_ :
|
||||
|
|
4
THANKS
4
THANKS
|
@ -8,3 +8,7 @@ Willy Sudiarto Raharjo - https://github.com/willysr
|
|||
|
||||
For the interesting and valuable advice around the systems of Slackware
|
||||
and SBo packages.
|
||||
|
||||
LinuxQuestions.org - http://www.linuxquestions.org
|
||||
|
||||
In all members of the community of Slackware forum linuxquestions.org.
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
PRGNAM=slpkg
|
||||
VERSION=${VERSION:-1.8.0}
|
||||
VERSION=${VERSION:-1.8.1}
|
||||
TAG=${TAG:-_dsw}
|
||||
|
||||
cd ..
|
||||
|
@ -33,20 +33,25 @@ if [ -f $PRGNAM-$VERSION.zip ]; then
|
|||
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
|
||||
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
|
||||
|
|
42
man/slpkg.8
42
man/slpkg.8
|
@ -62,6 +62,17 @@ Support .tar.gz and .tar.bz2 slackbuilds archives.
|
|||
.PP
|
||||
Four display options list, sbo, slack, noarch and all packages
|
||||
items that are installed on the system.
|
||||
.SS -c , sbo, slack [sbo, slack ...] check if your packages is up to date
|
||||
\fBslpkg\fP \fB-c\fP <\fIsbo\fP> <\fIslack\fP> <\fIupgrade\fP>
|
||||
.PP
|
||||
Check your packages from Slackware official mirrors or from
|
||||
slackbuilds.org is up to date.
|
||||
.SS -s , sbo, slack [sbo, slack ...] download, build and install package with all dependencies
|
||||
\fBslpkg\fP \fB-s\fP <\fIsbo\fP> <\fIslack\fP> <\fIname of package\fP>
|
||||
.PP
|
||||
Installs packages from the repository slackbuilds.org automatically resolving all
|
||||
dependencies of the package. Also installs the official distribution Slackware
|
||||
packages.
|
||||
.SS -t , tracking dependencies
|
||||
\fBslpkg\fP \fB-t\fP <\fIname of package\fP>
|
||||
.PP
|
||||
|
@ -72,18 +83,6 @@ The sequence shown is that you must follow to correctly install package.
|
|||
.PP
|
||||
With this method you can find the SBo script that interests you through
|
||||
the network. (www.slackbuilds.org)
|
||||
.SS -c , sbo, slack [sbo, slack ...] check if your packages is up to date
|
||||
\fBslpkg\fP \fB-c\fP <\fIsbo\fP> <\fIslack\fP> <\fIupgrade\fP>
|
||||
.PP
|
||||
Check your packages from Slackware official mirrors or from
|
||||
slackbuilds.org is up to date.
|
||||
.SS -s , sbo, slack [sbo, slack ...] download, build and install package with all dependencies
|
||||
\fBslpkg\fP \fB-s\fP <\fIsbo\fP> <\fIslack\fP> <\fIname of package\fP>
|
||||
.PP
|
||||
Find package from slackbuild.org with all dependencies,
|
||||
download, build and install them if not installed or new version is
|
||||
available. Even download and install official packages from Slackware
|
||||
official mirrors and install or reinstall if already installed.
|
||||
.SS -i , install binary package
|
||||
\fBslpkg\fP \fB-i\fP <\fIpackages.t?z\fP>
|
||||
.PP
|
||||
|
@ -152,18 +151,21 @@ $ \fBslpkg -t brasero\fP
|
|||
|
||||
$ \fBslpkg -s sbo brasero\fP
|
||||
Building dependency tree...... Done
|
||||
The following packages will be automatically installed or upgraded with new version:
|
||||
|
||||
The following packages will be automatically installed or upgraded
|
||||
with new version:
|
||||
|
||||
+==============================================================================
|
||||
| Package Version Arch Repository
|
||||
| Package Version Arch Repository
|
||||
+==============================================================================
|
||||
Installing:
|
||||
brasero 3.11.3 x86_64 SBo
|
||||
brasero 3.11.3 x86_64 SBo
|
||||
Installing for dependencies:
|
||||
orc 0.4.19 x86_64 SBo
|
||||
gstreamer1 1.2.2 x86_64 SBo
|
||||
gst1-plugins-base 1.2.2 x86_64 SBo
|
||||
gst1-plugins-bad 1.2.2 x86_64 SBo
|
||||
libunique 1.1.6 x86_64 SBo
|
||||
orc 0.4.19 x86_64 SBo
|
||||
gstreamer1 1.2.2 x86_64 SBo
|
||||
gst1-plugins-base 1.2.2 x86_64 SBo
|
||||
gst1-plugins-bad 1.2.2 x86_64 SBo
|
||||
libunique 1.1.6 x86_64 SBo
|
||||
|
||||
Installing summary
|
||||
===============================================================================
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
PRGNAM=slpkg
|
||||
VERSION=${VERSION:-1.8.0}
|
||||
VERSION=${VERSION:-1.8.1}
|
||||
BUILD=${BUILD:-1}
|
||||
TAG=${TAG:-_dsw}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
PRGNAM="slpkg"
|
||||
VERSION="1.7.9"
|
||||
VERSION="1.8.1"
|
||||
HOMEPAGE="https://github.com/dslackw/slpkg"
|
||||
DOWNLOAD="https://github.com/dslackw/slpkg/archive/v1.8.0.tar.gz"
|
||||
DOWNLOAD="https://github.com/dslackw/slpkg/archive/v1.8.1.tar.gz"
|
||||
MD5SUM=""
|
||||
DOWNLOAD_x86_64=""
|
||||
MD5SUM_x86_64=""
|
||||
|
|
|
@ -26,7 +26,7 @@ import subprocess
|
|||
|
||||
__all__ = "slpkg"
|
||||
__author__ = "dslackw"
|
||||
__version_info__ = (1, 8, 0)
|
||||
__version_info__ = (1, 8, 1)
|
||||
__version__ = "{0}.{1}.{2}".format(*__version_info__)
|
||||
__license__ = "GNU General Public License v3 (GPLv3)"
|
||||
__email__ = "d.zlatanidis@gmail.com"
|
||||
|
@ -56,18 +56,6 @@ pkg_path = "/var/log/packages/"
|
|||
''' computer architecture '''
|
||||
arch = os.uname()[4]
|
||||
|
||||
''' slackbuild fietype binary packages '''
|
||||
if arch == "x86_64":
|
||||
sbo_arch = "-x86_64-"
|
||||
elif arch.startswith("i") and arch.endswith("86"):
|
||||
sbo_arch = "-i486-"
|
||||
elif "arm" in arch:
|
||||
sbo_arch = "-arm-"
|
||||
|
||||
build = "*"
|
||||
sbo_tag = "_SBo"
|
||||
sbo_filetype = ".tgz"
|
||||
|
||||
''' Slackware architectures '''
|
||||
slack_archs = [
|
||||
"-noarch-",
|
||||
|
@ -78,4 +66,3 @@ slack_archs = [
|
|||
"-x86-",
|
||||
"-fw-"
|
||||
]
|
||||
|
||||
|
|
|
@ -25,8 +25,6 @@ import os
|
|||
import sys
|
||||
import subprocess
|
||||
|
||||
from collections import OrderedDict
|
||||
|
||||
from slpkg.colors import colors
|
||||
from slpkg.messages import pkg_not_found, template
|
||||
from slpkg.__metadata__ import pkg_path, sp, log_path
|
||||
|
@ -85,7 +83,8 @@ def pkg_remove(binary):
|
|||
Remove Slackware binary packages
|
||||
'''
|
||||
dep_path = log_path + "dep/"
|
||||
removed, not_found, dependencies, rmv_dependencies = [], [], [], []
|
||||
removed, dependencies = [], []
|
||||
rmv_list, rmv_dependencies = [], []
|
||||
print("\nPackages with name matching [ {0}{1}{2} ]\n".format(
|
||||
colors.CYAN, ', '.join(binary), colors.ENDC))
|
||||
for pkg in binary:
|
||||
|
@ -95,7 +94,6 @@ def pkg_remove(binary):
|
|||
removed.append(pkg)
|
||||
else:
|
||||
message = "Can't remove"
|
||||
not_found.append(pkg)
|
||||
pkg_not_found("", pkg, message, "")
|
||||
if removed == []:
|
||||
print # new line at end
|
||||
|
@ -140,26 +138,31 @@ def pkg_remove(binary):
|
|||
for dep in dependencies:
|
||||
if find_package(dep + sp, pkg_path):
|
||||
print subprocess.check_output("removepkg {0}".format(dep), shell=True)
|
||||
rmv_list.append(dep)
|
||||
os.remove(dep_path + rmv)
|
||||
rmv_dependencies += dependencies[:-1]
|
||||
else:
|
||||
if find_package(rmv + sp, pkg_path):
|
||||
print subprocess.check_output("removepkg {0}".format(rmv), shell=True)
|
||||
rmv_list.append(rmv)
|
||||
f.close()
|
||||
os.remove(dep_path + rmv)
|
||||
else:
|
||||
if find_package(rmv + sp, pkg_path):
|
||||
print subprocess.check_output("removepkg {0}".format(rmv), shell=True)
|
||||
rmv_list.append(rmv)
|
||||
'''
|
||||
Prints all removed packages
|
||||
'''
|
||||
removed = removed + rmv_dependencies
|
||||
if len(rmv_list) > 1:
|
||||
template(78)
|
||||
print("| Total {0} packages removed".format(len(rmv_list)))
|
||||
template(78)
|
||||
for pkg in list(OrderedDict.fromkeys(removed)):
|
||||
for pkg in rmv_list:
|
||||
if find_package(pkg + sp, pkg_path) == []:
|
||||
print("| Package {0} removed".format(pkg))
|
||||
for pkg in not_found:
|
||||
print("| Package {0} not found".format(pkg))
|
||||
else:
|
||||
print("| Package {0} not found".format(pkg))
|
||||
template(78)
|
||||
print # new line at end
|
||||
|
||||
|
|
|
@ -25,14 +25,14 @@ import os
|
|||
import sys
|
||||
import subprocess
|
||||
|
||||
from slpkg.pkg.find import find_package
|
||||
from slpkg.pkg.build import build_package
|
||||
from slpkg.pkg.manager import pkg_upgrade
|
||||
|
||||
from slpkg.colors import colors
|
||||
from slpkg.messages import template
|
||||
from slpkg.functions import get_file
|
||||
from slpkg.__metadata__ import (tmp, sbo_arch, build, sbo_tag,
|
||||
sbo_filetype, pkg_path, build_path)
|
||||
from slpkg.__metadata__ import tmp, pkg_path, build_path
|
||||
|
||||
from init import initialization
|
||||
from search import sbo_search_pkg
|
||||
|
@ -50,7 +50,7 @@ def sbo_check():
|
|||
sys.stdout.write("Reading package lists ...")
|
||||
sys.stdout.flush()
|
||||
initialization()
|
||||
sbo_list = []
|
||||
sbo_list = []
|
||||
index, toolbar_width = 0, 3
|
||||
GREEN, RED, ENDC = colors.GREEN, colors.RED, colors.ENDC
|
||||
upg_name, pkg_for_upg, upg_ver, upg_arch = [], [], [], []
|
||||
|
@ -74,7 +74,7 @@ def sbo_check():
|
|||
arch = "noarch"
|
||||
else:
|
||||
arch = os.uname()[4]
|
||||
name = pkg[:-(len(arch) + len(sbo_tag) + 3)]
|
||||
name = pkg[:-(len(arch) + len("_SBo") + 3)]
|
||||
pkg_version = get_file(name, "-")[1:]
|
||||
name = name[:-(len(pkg_version) + 1)]
|
||||
sbo_version = sbo_version_pkg(name)
|
||||
|
@ -117,11 +117,29 @@ def sbo_check():
|
|||
subprocess.call("wget -N {0}".format(src), shell=True)
|
||||
sources.append(get_file(src, "/"))
|
||||
build_package(script, sources, build_path)
|
||||
binary = ("{0}{1}-{2}-{3}{4}{5}".format(
|
||||
tmp, prgnam, arch, build, sbo_tag, sbo_filetype).split())
|
||||
print("{0}[ Upgrading ] --> {1}{2}".format(GREEN, ENDC, name))
|
||||
'''
|
||||
Searches the package name and version in /tmp to install.
|
||||
If find two or more packages e.g. to build tag
|
||||
2 or 3 will fit most.
|
||||
'''
|
||||
binary_list = []
|
||||
for search in find_package(prgnam, tmp):
|
||||
if "_SBo" in search:
|
||||
binary_list.append(search)
|
||||
binary = (tmp + max(binary_list)).split()
|
||||
pkg_upgrade(binary)
|
||||
print("Completed!\n")
|
||||
print("Complete!\n")
|
||||
if len(pkg_for_upg) > 1:
|
||||
template(78)
|
||||
print("| Total {0} {1} upgraded".format(len(pkg_for_upg), msg_pkg))
|
||||
template(78)
|
||||
for pkg, upg, ver in zip(pkg_for_upg, upg_name, upg_ver):
|
||||
upgraded = ("{0}-{1}".format(upg, ver))
|
||||
if find_package(upgraded, pkg_path):
|
||||
print("| Package {0} upgraded with new package {1}-{2}".format(
|
||||
pkg, upg, ver))
|
||||
template(78)
|
||||
else:
|
||||
print("\nTotal {0} SBo packages are up to date:\n".format(len(sbo_list)))
|
||||
else:
|
||||
|
|
|
@ -62,7 +62,7 @@ def pkg_tracking(name):
|
|||
'''
|
||||
View tree of dependencies and also
|
||||
highlight packages with color green
|
||||
if allready installed and colore red
|
||||
if allready installed and color red
|
||||
if not installed.
|
||||
'''
|
||||
sys.stdout.write("Reading package lists ...")
|
||||
|
@ -87,9 +87,9 @@ def pkg_tracking(name):
|
|||
for duplicate in requires:
|
||||
if duplicate not in dependencies:
|
||||
dependencies.append(duplicate)
|
||||
pkg_len = len(name) + 24
|
||||
if dependencies == []:
|
||||
dependencies = ["No dependencies"]
|
||||
pkg_len = len(name) + 24
|
||||
template(pkg_len)
|
||||
print("| Package {0}{1}{2} dependencies :".format(CYAN, name, ENDC))
|
||||
template(pkg_len)
|
||||
|
|
|
@ -28,8 +28,7 @@ import subprocess
|
|||
from slpkg.colors import colors
|
||||
from slpkg.functions import get_file
|
||||
from slpkg.messages import pkg_not_found, pkg_found, template
|
||||
from slpkg.__metadata__ import (tmp, pkg_path, build_path, log_path,
|
||||
sp, build, sbo_tag, sbo_filetype)
|
||||
from slpkg.__metadata__ import tmp, pkg_path, build_path, log_path, sp
|
||||
|
||||
from slpkg.pkg.find import find_package
|
||||
from slpkg.pkg.build import build_package
|
||||
|
@ -53,11 +52,13 @@ def sbo_build(name):
|
|||
dependencies_list = sbo_dependencies_pkg(name)
|
||||
try:
|
||||
if dependencies_list is not None:
|
||||
pkg_sum = 0
|
||||
pkg_sum = 0
|
||||
arch = os.uname()[4]
|
||||
sbo_ver, pkg_arch = [], []
|
||||
sbo_ver, pkg_arch = [], []
|
||||
installs, versions = [], []
|
||||
requires, dependencies = [], []
|
||||
PKG_COLOR, DEP_COLOR, ARCH_COLOR, ENDC = "", "", "", colors.ENDC
|
||||
PKG_COLOR, DEP_COLOR, ARCH_COLOR = "", "", ""
|
||||
ENDC = colors.ENDC
|
||||
'''
|
||||
Insert master package in list to
|
||||
install it after dependencies
|
||||
|
@ -98,8 +99,9 @@ def sbo_build(name):
|
|||
elif "UNTESTED" in src:
|
||||
pkg_arch.append("UNTESTED")
|
||||
sbo_pkg = ("{0}-{1}".format(pkg, version))
|
||||
if find_package(sbo_pkg + sp, pkg_path):
|
||||
if find_package(sbo_pkg, pkg_path):
|
||||
pkg_sum += 1
|
||||
|
||||
sys.stdout.write("Done\n")
|
||||
'''
|
||||
Tag with color green if package already installed
|
||||
|
@ -108,7 +110,7 @@ def sbo_build(name):
|
|||
UNTESTED with color yellow.
|
||||
'''
|
||||
master_pkg = ("{0}-{1}".format(name, sbo_ver[-1]))
|
||||
if find_package(master_pkg + sp, pkg_path):
|
||||
if find_package(master_pkg, pkg_path):
|
||||
PKG_COLOR = colors.GREEN
|
||||
else:
|
||||
PKG_COLOR = colors.RED
|
||||
|
@ -130,7 +132,7 @@ def sbo_build(name):
|
|||
ARCH_COLOR = "" # reset arch color for dependencies packages
|
||||
for dep, ver, dep_arch in zip(dependencies[:-1], sbo_ver[:-1], pkg_arch[:-1]):
|
||||
dep_pkg = ("{0}-{1}".format(dep, ver))
|
||||
if find_package(dep_pkg + sp, pkg_path):
|
||||
if find_package(dep_pkg, pkg_path):
|
||||
DEP_COLOR = colors.GREEN
|
||||
else:
|
||||
DEP_COLOR = colors.RED
|
||||
|
@ -153,13 +155,23 @@ def sbo_build(name):
|
|||
print("Total {0} {1}.".format(len(dependencies), msg_pkg))
|
||||
print("{0} {1} will be installed, {2} allready installed.".format(
|
||||
(len(dependencies) - pkg_sum), msg_2_pkg, pkg_sum))
|
||||
'''
|
||||
Check if package supported by arch
|
||||
before proceed to install
|
||||
'''
|
||||
UNST = ["UNSUPPORTED", "UNTESTED"]
|
||||
for item in UNST:
|
||||
for un in pkg_arch:
|
||||
if item == un:
|
||||
print("\n{0}The package {1}{2}\n".format(colors.RED, item, ENDC))
|
||||
sys.exit()
|
||||
read = raw_input("\nDo you want to continue [Y/n]? ")
|
||||
if read == "Y" or read == "y":
|
||||
if not os.path.exists(build_path):
|
||||
os.mkdir(build_path)
|
||||
os.chdir(build_path)
|
||||
for pkg, ver in zip(dependencies, sbo_ver):
|
||||
sbo_file = "".join(find_package(pkg + sp, pkg_path))
|
||||
sbo_file = "".join(find_package(pkg, pkg_path))
|
||||
sbo_file_version = sbo_file[len(pkg) + 1:-len(arch) - 7]
|
||||
if ver > sbo_file_version:
|
||||
prgnam = ("{0}-{1}".format(pkg, ver))
|
||||
|
@ -167,31 +179,48 @@ def sbo_build(name):
|
|||
sbo_link = sbo_slackbuild_dwn(sbo_url)
|
||||
src_link = sbo_source_dwn(pkg).split()
|
||||
script = get_file(sbo_link, "/")
|
||||
print("\n{0}Start -->{1} {2}\n".format(colors.GREEN, colors.ENDC, pkg))
|
||||
print("\n{0}Start -->{1} {2}\n".format(colors.GREEN, ENDC, pkg))
|
||||
subprocess.call("wget -N {0}".format(sbo_link), shell=True)
|
||||
sources = []
|
||||
for src in src_link:
|
||||
subprocess.call("wget -N {0}".format(src), shell=True)
|
||||
sources.append(get_file(src, "/"))
|
||||
build_package(script, sources, build_path)
|
||||
'''
|
||||
Before installing new binary package look if arch is noarch.
|
||||
This is because some maintainers changes arch manualy.
|
||||
'''
|
||||
if "-noarch-" in "".join(find_package(prgnam, tmp)):
|
||||
sbo_arch = "-noarch-"
|
||||
else:
|
||||
from slpkg.__metadata__ import sbo_arch
|
||||
binary = ("{0}{1}{2}{3}{4}{5}".format(
|
||||
tmp, prgnam, sbo_arch, build, sbo_tag, sbo_filetype).split())
|
||||
print("{0}[ Installing ] --> {1}{2}".format(
|
||||
colors.GREEN, colors.ENDC, pkg))
|
||||
colors.GREEN, ENDC, pkg))
|
||||
'''
|
||||
Searches the package name and version in /tmp to install.
|
||||
If find two or more packages e.g. to build tag
|
||||
2 or 3 will fit most.
|
||||
'''
|
||||
binary_list = []
|
||||
for search in find_package(prgnam, tmp):
|
||||
if "_SBo" in search:
|
||||
binary_list.append(search)
|
||||
binary = (tmp + max(binary_list)).split()
|
||||
pkg_upgrade(binary)
|
||||
print("Complete!\n")
|
||||
installs.append(pkg)
|
||||
versions.append(ver)
|
||||
else:
|
||||
template(78)
|
||||
pkg_found(pkg, sbo_file_version)
|
||||
template(78)
|
||||
'''
|
||||
Reference list only packages installed
|
||||
'''
|
||||
if len(installs) > 1:
|
||||
template(78)
|
||||
print("| Total {0} packages installed".format(len(installs)))
|
||||
template(78)
|
||||
for pkg, ver in zip(installs, versions):
|
||||
installed = ("{0}-{1}".format(pkg, ver))
|
||||
if find_package(installed, pkg_path):
|
||||
print("| Package {0} installed successfully".format(installed))
|
||||
else:
|
||||
print("| Package {0} NOT installed".format(installed))
|
||||
template(78)
|
||||
'''
|
||||
Write dependencies in a log file
|
||||
into directory `/var/log/slpkg/dep/`
|
||||
'''
|
||||
|
|
|
@ -28,8 +28,7 @@ import subprocess
|
|||
from slpkg.colors import colors
|
||||
from slpkg.functions import get_file
|
||||
from slpkg.messages import pkg_not_found, pkg_found, view_sbo, template
|
||||
from slpkg.__metadata__ import (tmp, build, sbo_tag, sbo_filetype, build_path,
|
||||
pkg_path, slpkg_tmp, sp)
|
||||
from slpkg.__metadata__ import tmp, build_path, pkg_path, slpkg_tmp, sp
|
||||
|
||||
from slpkg.pkg.build import build_package
|
||||
from slpkg.pkg.find import find_package
|
||||
|
@ -59,6 +58,16 @@ def sbo_network(name):
|
|||
view_sbo(name, sbo_url, get_file(sbo_dwn, "/"), \
|
||||
", ".join([get_file(src, "/") for src in source_dwn]), \
|
||||
sbo_req)
|
||||
'''
|
||||
Check if package supported by arch
|
||||
before proceed to install
|
||||
'''
|
||||
FAULT = ""
|
||||
UNST = ["UNSUPPORTED", "UNTESTED"]
|
||||
for item in UNST:
|
||||
for un in source_dwn:
|
||||
if item == un:
|
||||
FAULT = item
|
||||
while True:
|
||||
try:
|
||||
read = raw_input("_ ")
|
||||
|
@ -88,6 +97,9 @@ def sbo_network(name):
|
|||
subprocess.call("less {0}{1}{2}".format(rdm_path, name, site), shell=True)
|
||||
os.remove("{0}{1}{2}".format(rdm_path, name, site))
|
||||
elif read == "B" or read == "b":
|
||||
if FAULT:
|
||||
print("\n{0}The package {1}{2}\n".format(colors.RED, FAULT, colors.ENDC))
|
||||
sys.exit()
|
||||
if not os.path.exists(build_path):
|
||||
os.mkdir(build_path)
|
||||
sources = []
|
||||
|
@ -102,6 +114,9 @@ def sbo_network(name):
|
|||
print("Complete!\n")
|
||||
break
|
||||
elif read == "I" or read == "i":
|
||||
if FAULT:
|
||||
print("\n{0}The package {1}{2}\n".format(colors.RED, FAULT, colors.ENDC))
|
||||
sys.exit()
|
||||
if not os.path.exists(build_path):
|
||||
os.mkdir(build_path)
|
||||
sbo_version = sbo_version_pkg(name)
|
||||
|
@ -116,22 +131,19 @@ def sbo_network(name):
|
|||
subprocess.call("wget -N {0}".format(src), shell=True)
|
||||
sources.append(get_file(src, "/"))
|
||||
build_package(script, sources, build_path)
|
||||
print("{0}[ Installing ] --> {1}{2}".format(colors.GREEN, colors.ENDC, name))
|
||||
'''
|
||||
Before installing new binary package look if arch is noarch.
|
||||
This is because some maintainers changes arch manualy.
|
||||
Searches the package name and version in /tmp to install.
|
||||
If find two or more packages e.g. to build tag
|
||||
2 or 3 will fit most.
|
||||
'''
|
||||
if "-noarch-" in "".join(find_package(prgnam, tmp)):
|
||||
sbo_arch = "-noarch-"
|
||||
else:
|
||||
from slpkg.__metadata__ import sbo_arch
|
||||
binary = ("{0}{1}{2}{3}{4}{5}".format(
|
||||
tmp, prgnam, sbo_arch, build, sbo_tag, sbo_filetype).split())
|
||||
print("{0}[ Installing ] --> {0}{1}".format(colors.GREEN, colors.ENDC, name))
|
||||
binary_list = []
|
||||
for search in find_package(prgnam, tmp):
|
||||
if "_SBo" in search:
|
||||
binary_list.append(search)
|
||||
binary = (tmp + max(binary_list)).split()
|
||||
pkg_upgrade(binary)
|
||||
if find_package(name + sp, pkg_path):
|
||||
print("Complete!\n")
|
||||
else:
|
||||
print("The package {0} not installed successfully".format(name))
|
||||
print("Complete!\n")
|
||||
break
|
||||
else:
|
||||
template(78)
|
||||
|
|
|
@ -120,20 +120,20 @@ def install(slack_pkg):
|
|||
(len(install_all) - pkg_sum), msg_2_pkg, pkg_sum))
|
||||
print("Need to get {0} {1} of archives.".format(compressed, comp_unit))
|
||||
print("After this process, {0} {1} of additional disk space will be used.".format(
|
||||
uncompressed, uncomp_unit))
|
||||
uncompressed, uncomp_unit))
|
||||
read = raw_input("\nWould you like to install [Y/n]? ")
|
||||
if read == "Y" or read == "y":
|
||||
for dwn in dwn_list:
|
||||
subprocess.call("wget -N --directory-prefix={0} {1} {2}.asc".format(
|
||||
tmp_path, dwn, dwn), shell=True)
|
||||
tmp_path, dwn, dwn), shell=True)
|
||||
for install in install_all:
|
||||
if not os.path.isfile(pkg_path + install[:-4]):
|
||||
print("{0}[ installing ] --> {1}{2}".format(
|
||||
colors.GREEN, ENDC, install))
|
||||
colors.GREEN, ENDC, install))
|
||||
pkg_upgrade((tmp_path + install).split())
|
||||
else:
|
||||
print("{0}[ reinstalling ] --> {1}{2}".format(
|
||||
colors.GREEN, ENDC, install))
|
||||
colors.GREEN, ENDC, install))
|
||||
pkg_reinstall((tmp_path + install).split())
|
||||
print("Completed!\n")
|
||||
read = raw_input("Removal downloaded packages [Y/n]? ")
|
||||
|
@ -144,11 +144,9 @@ def install(slack_pkg):
|
|||
if os.listdir(tmp_path) == []:
|
||||
print("Packages removed")
|
||||
else:
|
||||
print("\nThere are packages in directory {0}\n".format(
|
||||
tmp_path))
|
||||
print("\nThere are packages in directory {0}\n".format(tmp_path))
|
||||
else:
|
||||
print("\nThere are packages in directory {0}\n".format(
|
||||
tmp_path))
|
||||
print("\nThere are packages in directory {0}\n".format(tmp_path))
|
||||
else:
|
||||
message = "No matching"
|
||||
pkg_not_found("", slack_pkg, message, "\n")
|
||||
|
|
|
@ -115,12 +115,12 @@ def patches():
|
|||
print("Total {0} {1} will be upgraded.".format(len(upgrade_all), msg_pkg))
|
||||
print("Need to get {0} {1} of archives.".format(compressed, comp_unit))
|
||||
print("After this process, {0} {1} of additional disk space will be used.".format(
|
||||
uncompressed, uncomp_unit))
|
||||
uncompressed, uncomp_unit))
|
||||
read = raw_input("\nWould you like to upgrade [Y/n]? ")
|
||||
if read == "Y" or read == "y":
|
||||
for dwn in dwn_patches:
|
||||
subprocess.call("wget -N --directory-prefix={0} {1} {2}.asc".format(
|
||||
patch_path, dwn, dwn), shell=True)
|
||||
patch_path, dwn, dwn), shell=True)
|
||||
for pkg in upgrade_all:
|
||||
print("{0}[ upgrading ] --> {1}{2}".format(GREEN, ENDC, pkg[:-4]))
|
||||
pkg_upgrade((patch_path + pkg).split())
|
||||
|
@ -145,7 +145,7 @@ def patches():
|
|||
if os.uname()[4] == "x86_64":
|
||||
slack_arch = 64
|
||||
print("\nSlackware{0} v{1} distribution is up to date\n".format(
|
||||
slack_arch, slack_ver()))
|
||||
slack_arch, slack_ver()))
|
||||
except KeyboardInterrupt:
|
||||
print # new line at exit
|
||||
sys.exit()
|
||||
|
|
Loading…
Reference in a new issue