mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-30 20:34:38 +01:00
Dev: updated mess, add install for slack
This commit is contained in:
parent
8e56968a1f
commit
bb54655f09
18 changed files with 305 additions and 107 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
29-07-2014
|
||||||
|
Version 1.6.5
|
||||||
|
|
||||||
|
[Feature] - Added slack, noarch and other in list (slpkg -l)
|
||||||
|
Added index in list (slpkg -l)
|
||||||
|
Added install packages via official Slackware mirrors
|
||||||
|
|
||||||
|
[Updated] - Arguments views
|
||||||
|
|
||||||
28-07-2014
|
28-07-2014
|
||||||
Version 1.6.4
|
Version 1.6.4
|
||||||
|
|
||||||
|
|
46
README.rst
46
README.rst
|
@ -5,7 +5,7 @@
|
||||||
.. image:: https://pypip.in/license/slpkg/badge.png
|
.. image:: https://pypip.in/license/slpkg/badge.png
|
||||||
:target: https://pypi.python.org/pypi/slpkg
|
:target: https://pypi.python.org/pypi/slpkg
|
||||||
|
|
||||||
Slpkg is a terminal tool in order to easy use Slackware packages.
|
Slpkg is a terminal multitool in order to easy use Slackware packages.
|
||||||
|
|
||||||
.. image:: https://raw.githubusercontent.com/dslackw/slpkg/master/logo/slpkg.png
|
.. image:: https://raw.githubusercontent.com/dslackw/slpkg/master/logo/slpkg.png
|
||||||
:alt: logo
|
:alt: logo
|
||||||
|
@ -67,31 +67,35 @@ Command Line Tool Usage
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
usage: slpkg [-h] [-v] [-a script [source ...]] [-l all, sbo [all, sbo ...]]
|
usage: slpkg [-h] [-v] [-a script [source ...]]
|
||||||
[-t] [-n] [-c] [-s] [-i [...]] [-u [...]] [-o [...]]
|
[-l all, sbo, slack, noarch, other [all, sbo, slack, noarch, other ...]]
|
||||||
[-r [...]] [-f [...]] [-d [...]]
|
[-c sbo, slack [sbo, slack ...]]
|
||||||
|
[-s sbo, slack [sbo, slack ...]] [-t] [-n] [-i [...]]
|
||||||
|
[-u [...]] [-o [...]] [-r [...]] [-f [...]] [-d [...]]
|
||||||
|
|
||||||
Utility to help package management in Slackware
|
Utility for easy management packages in Slackware
|
||||||
|
|
||||||
optional arguments:
|
optional arguments:
|
||||||
-h, --help show this help message and exit
|
-h, --help show this help message and exit
|
||||||
-v, --verbose print version and exit
|
-v, --verbose print version and exit
|
||||||
-a script [source ...]
|
-a script [source ...]
|
||||||
auto build package
|
auto build package
|
||||||
-l all, sbo [all, sbo ...]
|
-l all, sbo, slack, noarch, other [all, sbo, slack, noarch, other ...]
|
||||||
list of installed packages
|
list of installed packages
|
||||||
-t tracking dependencies
|
|
||||||
-n find from SBo repositority
|
|
||||||
-c sbo, slack [sbo, slack ...]
|
-c sbo, slack [sbo, slack ...]
|
||||||
check if your packages is up to date
|
check if your packages is up to date
|
||||||
-s download, build & install pkg from SBo
|
-s sbo, slack [sbo, slack ...]
|
||||||
|
download, build & install packages
|
||||||
|
-t tracking dependencies
|
||||||
|
-n find packages from SBo repository
|
||||||
-i [ ...] install binary packages
|
-i [ ...] install binary packages
|
||||||
-u [ ...] install-upgrade packages with new
|
-u [ ...] upgrade binary packages
|
||||||
-o [ ...] reinstall the same packages
|
-o [ ...] reinstall binary packages
|
||||||
-r [ ...] remove packages
|
-r [ ...] remove packages
|
||||||
-f [ ...] find if packages installed
|
-f [ ...] find if packages installed
|
||||||
-d [ ...] display the contents of the packages
|
-d [ ...] display the contents of the packages
|
||||||
|
|
||||||
|
|
||||||
Slpkg Examples
|
Slpkg Examples
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
|
@ -153,14 +157,14 @@ Tracking all dependencies of packages:
|
||||||
|
|
|
|
||||||
+-- 1 gst1-plugins-base
|
+-- 1 gst1-plugins-base
|
||||||
|
|
|
|
||||||
+-- 2 libunique gst1-plugins-bad
|
+-- 2 libunique, gst1-plugins-bad
|
||||||
|
|
||||||
Check if your packages is up to date from slackbuilds.org:
|
Check if your packages is up to date from slackbuilds.org:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ slpkg -c sbo flashplayer-plugin
|
$ slpkg -c sbo flashplayer-plugin
|
||||||
Searching `flashplayer-plugin` from slackbuilds.org ...
|
Searching [ flashplayer-plugin ] from slackbuilds.org ...
|
||||||
|
|
||||||
New version is available:
|
New version is available:
|
||||||
+==============================================================================
|
+==============================================================================
|
||||||
|
@ -170,11 +174,11 @@ Check if your packages is up to date from slackbuilds.org:
|
||||||
Would you like to install ? [Y/y]
|
Would you like to install ? [Y/y]
|
||||||
|
|
||||||
$ slpkg -c sbo ranger
|
$ slpkg -c sbo ranger
|
||||||
Searching `ranger` from slackbuilds.org ...
|
Searching [ ranger ] from slackbuilds.org ...
|
||||||
|
|
||||||
Package ranger is up to date
|
Package ranger is up to date
|
||||||
|
|
||||||
$ slpkg -c termcolor
|
$ slpkg -c sbo termcolor
|
||||||
|
|
||||||
No such package termcolor: Can't find
|
No such package termcolor: Can't find
|
||||||
|
|
||||||
|
@ -191,15 +195,15 @@ Find slackbuild from slackbuilds.org:
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ slpkg -n bitfighter
|
$ slpkg -n bitfighter
|
||||||
Searching `bitfighter` from slackbuilds.org ...
|
Searching [ bitfighter ] from slackbuilds.org ...
|
||||||
|
|
||||||
+===============================================================================
|
+===============================================================================
|
||||||
| Package bitfighter --> http://slackbuilds.org/repository/14.1/games/bitfighter/
|
| Package bitfighter --> http://slackbuilds.org/repository/14.1/games/bitfighter/
|
||||||
+===============================================================================
|
+===============================================================================
|
||||||
| SlackBuild : http://slackbuilds.org/slackbuilds/14.1/games/bitfighter.tar.gz
|
| SlackBuild : bitfighter.tar.gz
|
||||||
| Source : http://bitfighter.org/files/bitfighter-019c.tar.gz
|
| Source : bitfighter-019c.tar.gz
|
||||||
| Extra : https://bitfighter.googlecode.com/files/classic_level_pack.zip
|
| Extra : classic_level_pack.zip
|
||||||
| Requirements : OpenAL SDL2 speex libmodplug
|
| Requirements : OpenAL, SDL2, speex, libmodplug
|
||||||
+===============================================================================
|
+===============================================================================
|
||||||
README View the README file
|
README View the README file
|
||||||
SlackBuild View the SlackBuild file
|
SlackBuild View the SlackBuild file
|
||||||
|
|
|
@ -33,7 +33,7 @@ It's a quick and easy way to manage your packages in slackware to a command.
|
||||||
\fB-n find from SBo repositority\fP
|
\fB-n find from SBo repositority\fP
|
||||||
\fB-c sbo, slack [sbo, slack ...]\fp
|
\fB-c sbo, slack [sbo, slack ...]\fp
|
||||||
\fb check if your package is up to date\fP
|
\fb check if your package is up to date\fP
|
||||||
\fB-s download, build & install pkg from SBo\fP
|
\fB-s download, build & install packages from SBo\fP
|
||||||
\fB-i [ ...] install binary packages\fP
|
\fB-i [ ...] install binary packages\fP
|
||||||
\fB-u [ ...] install-upgrade packages with new\fP
|
\fB-u [ ...] install-upgrade packages with new\fP
|
||||||
\fB-o [ ...] reinstall the same packages\fP
|
\fB-o [ ...] reinstall the same packages\fP
|
||||||
|
|
|
@ -9,4 +9,5 @@ class colors:
|
||||||
GREEN = "\x1b[32m"
|
GREEN = "\x1b[32m"
|
||||||
YELLOW = "\x1b[33m"
|
YELLOW = "\x1b[33m"
|
||||||
CYAN = "\x1b[36m"
|
CYAN = "\x1b[36m"
|
||||||
|
WHEAT = "\x1b[38;5;101m"
|
||||||
ENDC = "\x1b[0m"
|
ENDC = "\x1b[0m"
|
||||||
|
|
|
@ -2,27 +2,30 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
'''
|
'''
|
||||||
usage: main.py [-h] [-v] [-a script [source ...]] [-l all, sbo [all, sbo ...]]
|
usage: slpkg [-h] [-v] [-a script [source ...]]
|
||||||
[-t] [-n] [-c sbo, slack [sbo, slack ...]] [-s] [-i [...]]
|
[-l all, sbo, slack, noarch, other [all, sbo, slack, noarch, other ...]]
|
||||||
|
[-c sbo, slack [sbo, slack ...]]
|
||||||
|
[-s sbo, slack [sbo, slack ...]] [-t] [-n] [-i [...]]
|
||||||
[-u [...]] [-o [...]] [-r [...]] [-f [...]] [-d [...]]
|
[-u [...]] [-o [...]] [-r [...]] [-f [...]] [-d [...]]
|
||||||
|
|
||||||
Utility to help package management in Slackware
|
Utility for easy management packages in Slackware
|
||||||
|
|
||||||
optional arguments:
|
optional arguments:
|
||||||
-h, --help show this help message and exit
|
-h, --help show this help message and exit
|
||||||
-v, --verbose print version and exit
|
-v, --verbose print version and exit
|
||||||
-a script [source ...]
|
-a script [source ...]
|
||||||
auto build package
|
auto build package
|
||||||
-l all, sbo [all, sbo ...]
|
-l all, sbo, slack, noarch, other [all, sbo, slack, noarch, other ...]
|
||||||
list of installed packages
|
list of installed packages
|
||||||
-t tracking dependencies
|
|
||||||
-n find from SBo repositority
|
|
||||||
-c sbo, slack [sbo, slack ...]
|
-c sbo, slack [sbo, slack ...]
|
||||||
check if your packages is up to date
|
check if your packages is up to date
|
||||||
-s download, build & install pkg from SBo
|
-s sbo, slack [sbo, slack ...]
|
||||||
|
download, build & install packages
|
||||||
|
-t tracking dependencies
|
||||||
|
-n find packages from SBo repository
|
||||||
-i [ ...] install binary packages
|
-i [ ...] install binary packages
|
||||||
-u [ ...] install-upgrade packages with new
|
-u [ ...] upgrade binary packages
|
||||||
-o [ ...] reinstall the same packages
|
-o [ ...] reinstall binary packages
|
||||||
-r [ ...] remove packages
|
-r [ ...] remove packages
|
||||||
-f [ ...] find if packages installed
|
-f [ ...] find if packages installed
|
||||||
-d [ ...] display the contents of the packages
|
-d [ ...] display the contents of the packages
|
||||||
|
@ -32,37 +35,43 @@ import argparse
|
||||||
from version import *
|
from version import *
|
||||||
from functions import *
|
from functions import *
|
||||||
from colors import colors
|
from colors import colors
|
||||||
from messages import err_args
|
from messages import ext_err_args
|
||||||
|
from messages import err1_args, err2_args
|
||||||
|
|
||||||
from pkg.build import *
|
from pkg.build import *
|
||||||
from pkg.manager import *
|
from pkg.manager import *
|
||||||
|
|
||||||
from sbo.slackbuild import *
|
from sbo.slackbuild import *
|
||||||
from sbo.dependency import *
|
from sbo.dependency import *
|
||||||
from sbo.check import sbo_check
|
from sbo.check import sbo_check
|
||||||
from sbo.views import sbo_network
|
from sbo.views import sbo_network
|
||||||
|
|
||||||
from slack.patches import patches
|
from slack.patches import patches
|
||||||
|
from slack.install import install
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
description = "Utility to help package management in Slackware"
|
description = "Utility for easy management packages in Slackware"
|
||||||
parser = argparse.ArgumentParser(description=description)
|
parser = argparse.ArgumentParser(description=description)
|
||||||
parser.add_argument("-v", "--verbose", help="print version and exit",
|
parser.add_argument("-v", "--verbose", help="print version and exit",
|
||||||
action="store_true")
|
action="store_true")
|
||||||
parser.add_argument("-a", help="auto build package",
|
parser.add_argument("-a", help="auto build package",
|
||||||
type=str, nargs="+", metavar=('script', 'source'))
|
type=str, nargs="+", metavar=('script', 'source'))
|
||||||
parser.add_argument("-l", help="list of installed packages", nargs="+",
|
parser.add_argument("-l", help="list of installed packages", nargs="+",
|
||||||
choices="all sbo".split(), metavar=('all, sbo'))
|
choices="all sbo slack noarch other".split(),
|
||||||
parser.add_argument("-t", help="tracking dependencies",
|
metavar=('all, sbo, slack, noarch, other'))
|
||||||
type=str, metavar=(''))
|
|
||||||
parser.add_argument("-n", help="find from SBo repositority",
|
|
||||||
type=str, metavar=(''))
|
|
||||||
parser.add_argument("-c", help="check if your packages is up to date",
|
parser.add_argument("-c", help="check if your packages is up to date",
|
||||||
type=str, nargs="+", metavar=('sbo, slack'))
|
type=str, nargs="+", metavar=('sbo, slack'))
|
||||||
parser.add_argument("-s", help="download, build & install pkg from SBo",
|
parser.add_argument("-s", help="download, build & install packages",
|
||||||
|
type=str, nargs="+", metavar=('sbo, slack'))
|
||||||
|
parser.add_argument("-t", help="tracking dependencies",
|
||||||
|
type=str, metavar=(''))
|
||||||
|
parser.add_argument("-n", help="find packages from SBo repository",
|
||||||
type=str, metavar=(''))
|
type=str, metavar=(''))
|
||||||
parser.add_argument("-i", help="install binary packages",
|
parser.add_argument("-i", help="install binary packages",
|
||||||
type=str, nargs="+", metavar=(''))
|
type=str, nargs="+", metavar=(''))
|
||||||
parser.add_argument("-u", help="install-upgrade packages with new",
|
parser.add_argument("-u", help="upgrade binary packages",
|
||||||
type=str, nargs="+", metavar=(''))
|
type=str, nargs="+", metavar=(''))
|
||||||
parser.add_argument("-o", help="reinstall the same packages",
|
parser.add_argument("-o", help="reinstall binary packages",
|
||||||
type=str, nargs="+", metavar=(''))
|
type=str, nargs="+", metavar=(''))
|
||||||
parser.add_argument("-r", help="remove packages",
|
parser.add_argument("-r", help="remove packages",
|
||||||
type=str, nargs="+", metavar=(''))
|
type=str, nargs="+", metavar=(''))
|
||||||
|
@ -95,13 +104,45 @@ def main():
|
||||||
if args.c[1] == "upgrade":
|
if args.c[1] == "upgrade":
|
||||||
patches()
|
patches()
|
||||||
else:
|
else:
|
||||||
print ("\nError: invalid option choose { upgrade }\n")
|
choices = ['upgrade']
|
||||||
|
ext_err_args()
|
||||||
|
err1_args(''.join(args.c), choices)
|
||||||
else:
|
else:
|
||||||
print ("\nError: invalid option choose { sbo, slack }\n")
|
choices = ['sbo', 'slack']
|
||||||
|
ext_err_args()
|
||||||
|
err1_args(''.join(args.c[0]), choices)
|
||||||
|
elif len(args.c) < 2:
|
||||||
|
if "sbo" in args.c or "slack" in args.c:
|
||||||
|
ext_err_args()
|
||||||
|
err2_args()
|
||||||
|
else:
|
||||||
|
choices = ['sbo', 'slack']
|
||||||
|
ext_err_args()
|
||||||
|
err1_args(''.join(args.c), choices)
|
||||||
else:
|
else:
|
||||||
err_args(bol='\n', eol='\n')
|
ext_err_args()
|
||||||
|
err2_args()
|
||||||
if args.s:
|
if args.s:
|
||||||
sbo_build(args.s)
|
if len(args.s) == 2:
|
||||||
|
if "sbo" in args.s:
|
||||||
|
sbo_build(''.join(args.s[1]))
|
||||||
|
elif "slack" in args.s:
|
||||||
|
install(''.join(args.s[1]))
|
||||||
|
else:
|
||||||
|
choices = ['sbo', 'slack']
|
||||||
|
ext_err_args()
|
||||||
|
err1_args(''.join(args.s), choices)
|
||||||
|
elif len(args.s) < 2:
|
||||||
|
if "sbo" in args.s or "slack" in args.s:
|
||||||
|
ext_err_args()
|
||||||
|
err2_args()
|
||||||
|
else:
|
||||||
|
choices = ['sbo', 'slack']
|
||||||
|
ext_err_args()
|
||||||
|
err1_args(''.join(args.s), choices)
|
||||||
|
else:
|
||||||
|
ext_err_args()
|
||||||
|
err2_args()
|
||||||
if args.i:
|
if args.i:
|
||||||
pkg_install(args.i)
|
pkg_install(args.i)
|
||||||
if args.u:
|
if args.u:
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
from colors import colors
|
from colors import colors
|
||||||
|
from __metadata__ import __all__
|
||||||
|
|
||||||
def pkg_not_found(bol, pkg, message, eol):
|
def pkg_not_found(bol, pkg, message, eol):
|
||||||
'''
|
'''
|
||||||
|
@ -22,11 +23,30 @@ def pkg_installed(pkg):
|
||||||
'''
|
'''
|
||||||
print ("| Package {0} installed".format(pkg))
|
print ("| Package {0} installed".format(pkg))
|
||||||
|
|
||||||
def err_args(bol, eol):
|
def ext_err_args():
|
||||||
|
'''
|
||||||
|
Extended error arguments view
|
||||||
|
'''
|
||||||
|
print ("usage: {0} [-h] [-v] [-a script [source ...]]".format(__all__))
|
||||||
|
print (" [-l all, sbo, slack, noarch, other [all, sbo, slack, \
|
||||||
|
noarch, other ...]]")
|
||||||
|
print (" [-c sbo, slack [sbo, slack ...]] [-t] [-n]")
|
||||||
|
print (" [-s sbo, slack [sbo, slack ...]] [-i [...]] [-u [...]]")
|
||||||
|
print (" [-o [...]] [-r [...]] [-f [...]] [-d [...]]")
|
||||||
|
|
||||||
|
def err1_args(invalid, choices):
|
||||||
'''
|
'''
|
||||||
Print error message arguments
|
Print error message arguments
|
||||||
'''
|
'''
|
||||||
print ("{0}Error: must enter at least two arguments{1}".format(bol, eol))
|
print ("{0}: error: invalid choice: '{1}' choose from {2}".format(
|
||||||
|
__all__, invalid, choices))
|
||||||
|
|
||||||
|
def err2_args():
|
||||||
|
'''
|
||||||
|
Print error message arguments
|
||||||
|
'''
|
||||||
|
print ("{0}: error: must enter at least two arguments".format(
|
||||||
|
__all__))
|
||||||
|
|
||||||
def s_user(user):
|
def s_user(user):
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -6,7 +6,7 @@ import shutil
|
||||||
import tarfile
|
import tarfile
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
from slpkg.messages import pkg_not_found
|
from messages import pkg_not_found
|
||||||
|
|
||||||
def build_extra_pkg(script, source, extra):
|
def build_extra_pkg(script, source, extra):
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -5,9 +5,10 @@ import os
|
||||||
import sys
|
import sys
|
||||||
import getpass
|
import getpass
|
||||||
import subprocess
|
import subprocess
|
||||||
from slpkg.colors import colors
|
from colors import colors
|
||||||
from slpkg.__metadata__ import pkg_path, uname, arch, sp
|
from __metadata__ import pkg_path, uname, arch, sp
|
||||||
from slpkg.messages import pkg_not_found, s_user, template
|
from messages import pkg_not_found, s_user, template
|
||||||
|
|
||||||
from find import find_package
|
from find import find_package
|
||||||
|
|
||||||
def pkg_install(binary):
|
def pkg_install(binary):
|
||||||
|
@ -115,6 +116,7 @@ def pkg_find(binary):
|
||||||
'''
|
'''
|
||||||
Find installed Slackware packages
|
Find installed Slackware packages
|
||||||
'''
|
'''
|
||||||
|
print # new line at start
|
||||||
for pkg in range(len(binary)):
|
for pkg in range(len(binary)):
|
||||||
if find_package(binary[pkg] + sp, pkg_path) == []:
|
if find_package(binary[pkg] + sp, pkg_path) == []:
|
||||||
message = "Can't find"
|
message = "Can't find"
|
||||||
|
@ -124,8 +126,9 @@ def pkg_find(binary):
|
||||||
bol, eol = "\n", "\n"
|
bol, eol = "\n", "\n"
|
||||||
pkg_not_found(bol, binary[pkg], message, eol)
|
pkg_not_found(bol, binary[pkg], message, eol)
|
||||||
else:
|
else:
|
||||||
print (colors.GREEN + "[ installed ] - " + colors.ENDC + "\n ".join(
|
print (colors.GREEN + "[ installed ] - " + colors.ENDC + "\n ".join(
|
||||||
find_package(binary[pkg] + sp, pkg_path)))
|
find_package(binary[pkg] + sp, pkg_path)))
|
||||||
|
print # new line at end
|
||||||
|
|
||||||
def pkg_display(binary):
|
def pkg_display(binary):
|
||||||
'''
|
'''
|
||||||
|
@ -147,13 +150,48 @@ def pkg_list(binary):
|
||||||
'''
|
'''
|
||||||
List with the installed packages
|
List with the installed packages
|
||||||
'''
|
'''
|
||||||
|
print # new line at start
|
||||||
|
index, stop = 0, 50
|
||||||
if "all" in binary:
|
if "all" in binary:
|
||||||
print
|
for pkg in os.listdir(pkg_path):
|
||||||
os.chdir(pkg_path)
|
index += 1
|
||||||
os.system("ls * | more")
|
print ("[{0}{1}{2}] {3}".format(colors.WHEAT, index, colors.ENDC, pkg))
|
||||||
print
|
if index == stop:
|
||||||
|
key = raw_input('\nPress [ Enter ] >> Next page ')
|
||||||
|
stop += 50
|
||||||
if "sbo" in binary:
|
if "sbo" in binary:
|
||||||
print
|
for pkg in os.listdir(pkg_path):
|
||||||
os.chdir(pkg_path)
|
if 'SBo' in pkg:
|
||||||
os.system("ls * | grep 'SBo' | more")
|
index += 1
|
||||||
print
|
print ("[{0}{1}{2}] {3}".format(colors.WHEAT, index, colors.ENDC, pkg))
|
||||||
|
if index == stop:
|
||||||
|
key = raw_input('\nPress [ Enter ] >> Next page ')
|
||||||
|
stop += 50
|
||||||
|
if "slack" in binary:
|
||||||
|
for pkg in os.listdir(pkg_path):
|
||||||
|
if 'slack' in pkg:
|
||||||
|
index += 1
|
||||||
|
print ("[{0}{1}{2}] {3}".format(colors.WHEAT, index, colors.ENDC, pkg))
|
||||||
|
if index == stop:
|
||||||
|
key = raw_input('\nPress [ Enter ] >> Next page ')
|
||||||
|
stop += 50
|
||||||
|
if "noarch" in binary:
|
||||||
|
for pkg in os.listdir(pkg_path):
|
||||||
|
if 'noarch' in pkg:
|
||||||
|
index += 1
|
||||||
|
print ("[{0}{1}{2}] {3}".format(colors.WHEAT, index, colors.ENDC, pkg))
|
||||||
|
if index == stop:
|
||||||
|
key = raw_input('\nPress [ Enter ] >> Next page ')
|
||||||
|
stop += 50
|
||||||
|
if "other" in binary:
|
||||||
|
for pkg in os.listdir(pkg_path):
|
||||||
|
if 'SBo' in pkg or 'slack' in pkg or 'noarch' in pkg:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
index += 1
|
||||||
|
print ("[{0}{1}{2}] {3}".format(colors.WHEAT, index, colors.ENDC, pkg))
|
||||||
|
if index == stop:
|
||||||
|
key = raw_input('\nPress [ Enter ] >> Next page ')
|
||||||
|
stop += 50
|
||||||
|
print # new line at end
|
||||||
|
|
||||||
|
|
|
@ -3,14 +3,16 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import getpass
|
import getpass
|
||||||
from slpkg.pkg.build import *
|
from pkg.build import *
|
||||||
from slpkg.pkg.find import find_package
|
from pkg.find import find_package
|
||||||
from slpkg.pkg.manager import pkg_upgrade
|
from pkg.manager import pkg_upgrade
|
||||||
from slpkg.colors import colors
|
|
||||||
from slpkg.functions import get_file
|
from colors import colors
|
||||||
from slpkg.messages import pkg_not_found, s_user, template
|
from functions import get_file
|
||||||
from slpkg.__metadata__ import tmp, pkg_path, uname, arch, sp
|
from messages import pkg_not_found, s_user, template
|
||||||
from slpkg.__metadata__ import sbo_arch, sbo_tag, sbo_filetype
|
from __metadata__ import tmp, pkg_path, uname, arch, sp
|
||||||
|
from __metadata__ import sbo_arch, sbo_tag, sbo_filetype
|
||||||
|
|
||||||
from search import sbo_search_pkg
|
from search import sbo_search_pkg
|
||||||
from download import sbo_slackbuild_dwn
|
from download import sbo_slackbuild_dwn
|
||||||
from greps import sbo_source_dwn, sbo_extra_dwn, sbo_version_pkg
|
from greps import sbo_source_dwn, sbo_extra_dwn, sbo_version_pkg
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from slpkg.colors import colors
|
from colors import colors
|
||||||
from slpkg.messages import pkg_not_found, template
|
from messages import pkg_not_found, template
|
||||||
|
|
||||||
from greps import *
|
from greps import *
|
||||||
from search import sbo_search_pkg
|
from search import sbo_search_pkg
|
||||||
from download import sbo_slackbuild_dwn
|
from download import sbo_slackbuild_dwn
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from slpkg.url_read import url_read
|
from url_read import url_read
|
||||||
from slpkg.__metadata__ import uname, arch
|
from __metadata__ import uname, arch
|
||||||
|
|
||||||
def sbo_source_dwn(sbo_url, name):
|
def sbo_source_dwn(sbo_url, name):
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import getpass
|
import getpass
|
||||||
from slpkg.messages import s_user
|
from messages import s_user
|
||||||
from slpkg.url_read import url_read
|
from url_read import url_read
|
||||||
|
|
||||||
# create tmp directory if not exist
|
# create tmp directory if not exist
|
||||||
os.system("mkdir -p /tmp/slpkg/readme/")
|
os.system("mkdir -p /tmp/slpkg/readme/")
|
||||||
|
|
|
@ -3,10 +3,11 @@
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
from slpkg.colors import colors
|
from colors import colors
|
||||||
from slpkg.url_read import url_read
|
from url_read import url_read
|
||||||
from slpkg.functions import get_file
|
from functions import get_file
|
||||||
from slpkg.slack.slack_version import slack_ver
|
|
||||||
|
from slack.slack_version import slack_ver
|
||||||
|
|
||||||
def sbo_search_pkg(name):
|
def sbo_search_pkg(name):
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -4,14 +4,15 @@
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import getpass
|
import getpass
|
||||||
from slpkg.colors import colors
|
from colors import colors
|
||||||
from slpkg.functions import get_file
|
from functions import get_file
|
||||||
from slpkg.__metadata__ import tmp, pkg_path, sp
|
from __metadata__ import tmp, pkg_path, sp
|
||||||
from slpkg.__metadata__ import sbo_arch, sbo_tag, sbo_filetype
|
from __metadata__ import sbo_arch, sbo_tag, sbo_filetype
|
||||||
from slpkg.messages import s_user, pkg_found, pkg_installed, template
|
from messages import s_user, pkg_found, pkg_installed, template
|
||||||
from slpkg.pkg.build import *
|
|
||||||
from slpkg.pkg.find import find_package
|
from pkg.build import *
|
||||||
from slpkg.pkg.manager import pkg_upgrade
|
from pkg.find import find_package
|
||||||
|
from pkg.manager import pkg_upgrade
|
||||||
|
|
||||||
from dependency import sbo_dependencies_links_pkg
|
from dependency import sbo_dependencies_links_pkg
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from slpkg.colors import colors
|
from colors import colors
|
||||||
from slpkg.functions import get_file
|
from functions import get_file
|
||||||
from slpkg.__metadata__ import tmp, pkg_path, slpkg_path, sp
|
from __metadata__ import tmp, pkg_path, slpkg_path, sp
|
||||||
from slpkg.__metadata__ import sbo_arch, sbo_tag, sbo_filetype
|
from __metadata__ import sbo_arch, sbo_tag, sbo_filetype
|
||||||
from slpkg.messages import s_user, pkg_not_found, pkg_found, view_sbo, template
|
from messages import s_user, pkg_not_found, pkg_found, view_sbo, template
|
||||||
from slpkg.pkg.build import *
|
|
||||||
from slpkg.pkg.find import find_package
|
from pkg.build import *
|
||||||
from slpkg.pkg.manager import pkg_upgrade
|
from pkg.find import find_package
|
||||||
|
from pkg.manager import pkg_upgrade
|
||||||
|
|
||||||
from read import *
|
from read import *
|
||||||
from greps import *
|
from greps import *
|
||||||
from search import sbo_search_pkg
|
from search import sbo_search_pkg
|
||||||
|
@ -30,7 +32,9 @@ def sbo_network(name):
|
||||||
sbo_version = sbo_version_pkg(sbo_url, name)
|
sbo_version = sbo_version_pkg(sbo_url, name)
|
||||||
source_dwn = sbo_source_dwn(sbo_url, name)
|
source_dwn = sbo_source_dwn(sbo_url, name)
|
||||||
extra_dwn = " ".join(sbo_extra_dwn(sbo_url, name))
|
extra_dwn = " ".join(sbo_extra_dwn(sbo_url, name))
|
||||||
view_sbo(name, sbo_url, sbo_dwn, source_dwn, extra_dwn, sbo_req)
|
view_sbo(name, sbo_url, get_file(sbo_dwn, '/'), get_file(source_dwn, '/'),
|
||||||
|
', '.join([get_file(extra_dwn, '/') for extra_dwn in extra_dwn.split()]),
|
||||||
|
sbo_req)
|
||||||
while True:
|
while True:
|
||||||
read = raw_input("_ ")
|
read = raw_input("_ ")
|
||||||
if read == "D" or read == "d":
|
if read == "D" or read == "d":
|
||||||
|
|
70
slpkg/slack/install.py
Executable file
70
slpkg/slack/install.py
Executable file
|
@ -0,0 +1,70 @@
|
||||||
|
#!/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import os
|
||||||
|
from colors import colors
|
||||||
|
from url_read import url_read
|
||||||
|
from messages import pkg_not_found
|
||||||
|
from __metadata__ import slpkg_path, pkg_path
|
||||||
|
|
||||||
|
from pkg.find import find_package
|
||||||
|
from pkg.manager import pkg_upgrade
|
||||||
|
|
||||||
|
from mirrors import mirrors
|
||||||
|
|
||||||
|
def install(slack_pkg):
|
||||||
|
'''
|
||||||
|
Install packages from official Slackware distribution
|
||||||
|
'''
|
||||||
|
dwn_list, dwn_packages = [], []
|
||||||
|
install_all, package_name, package_location = [], [], []
|
||||||
|
os.system("mkdir -p {0}{1}".format(slpkg_path, 'packages/'))
|
||||||
|
PACKAGE_TXT = url_read(mirrors(name='PACKAGES.TXT', location=''))
|
||||||
|
for line in PACKAGE_TXT.splitlines():
|
||||||
|
if line.startswith('PACKAGE NAME'):
|
||||||
|
package_name.append(line.replace('PACKAGE NAME: ', ''))
|
||||||
|
if line.startswith('PACKAGE LOCATION'):
|
||||||
|
package_location.append(line.replace('PACKAGE LOCATION: ./', ''))
|
||||||
|
for loc, name in zip(package_location, package_name):
|
||||||
|
dwn_list.append('{0}{1}/{2}'.format(mirrors('',''), loc, name))
|
||||||
|
print ("\nPackages with name matching [ {0}{1}{2} ]\n".format(
|
||||||
|
colors.CYAN, slack_pkg, colors.ENDC))
|
||||||
|
for pkg in package_name:
|
||||||
|
if slack_pkg in pkg:
|
||||||
|
if pkg.endswith('.txz'):
|
||||||
|
print ("{0}[ install ] --> {1}{2}".format(
|
||||||
|
colors.GREEN, colors.ENDC, pkg.replace('.txz', '')))
|
||||||
|
install_all.append(pkg)
|
||||||
|
elif pkg.endswith('.tgz'):
|
||||||
|
print ("{0}[ install ] --> {1}{2}".format(
|
||||||
|
colors.GREEN, colors.ENDC, pkg.replace('.tgz', '')))
|
||||||
|
install_all.append(pkg)
|
||||||
|
if install_all == []:
|
||||||
|
bol, eol = '', '\n'
|
||||||
|
message = "No matching"
|
||||||
|
pkg_not_found(bol, slack_pkg, message, eol)
|
||||||
|
else:
|
||||||
|
print
|
||||||
|
read = raw_input("Would you like to install [Y/y] ")
|
||||||
|
if read == "Y" or read == "y":
|
||||||
|
for install in install_all:
|
||||||
|
for dwn in dwn_list:
|
||||||
|
if install in dwn:
|
||||||
|
os.system("wget -N --directory-prefix={0}{1} {2}".format(
|
||||||
|
slpkg_path, 'packages/', dwn))
|
||||||
|
for install in install_all:
|
||||||
|
print ("{0}[ installing ] --> {1}{2}".format(
|
||||||
|
colors.GREEN, colors.ENDC, install))
|
||||||
|
pkg_upgrade((slpkg_path + 'packages/' + install).split())
|
||||||
|
read = raw_input("Remove the packages downloaded ? [Y/y] ")
|
||||||
|
if read == "Y" or read == "y":
|
||||||
|
for remove in install_all:
|
||||||
|
os.remove("{0}{1}{2}".format(slpkg_path, 'packages/', remove))
|
||||||
|
if os.listdir(slpkg_path + 'packages/') == []:
|
||||||
|
print ("Packages removed")
|
||||||
|
else:
|
||||||
|
print ("\nThere are packages in directory {0}{1}\n".format(
|
||||||
|
slpkg_path, 'packages/'))
|
||||||
|
else:
|
||||||
|
print ("\nThere are packages in directory {0}{1}\n".format(
|
||||||
|
slpkg_path, 'packages/'))
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from slpkg.__metadata__ import arch
|
from __metadata__ import arch
|
||||||
from slack_version import slack_ver
|
from slack_version import slack_ver
|
||||||
|
|
||||||
def mirrors(name, location):
|
def mirrors(name, location):
|
||||||
|
|
|
@ -2,11 +2,13 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from slpkg.colors import colors
|
from colors import colors
|
||||||
from slpkg.url_read import url_read
|
from url_read import url_read
|
||||||
from slpkg.__metadata__ import pkg_path, slpkg_path
|
from __metadata__ import pkg_path, slpkg_path
|
||||||
from slpkg.pkg.find import find_package
|
|
||||||
from slpkg.pkg.manager import pkg_upgrade
|
from pkg.find import find_package
|
||||||
|
from pkg.manager import pkg_upgrade
|
||||||
|
|
||||||
from mirrors import mirrors
|
from mirrors import mirrors
|
||||||
|
|
||||||
def patches():
|
def patches():
|
||||||
|
@ -31,7 +33,8 @@ def patches():
|
||||||
if upgrade_all != []:
|
if upgrade_all != []:
|
||||||
print ("\nThese packages need upgrading:\n")
|
print ("\nThese packages need upgrading:\n")
|
||||||
for upgrade in upgrade_all:
|
for upgrade in upgrade_all:
|
||||||
print ("{0}[ upgrade ] --> {1}{2}".format(colors.GREEN, colors.ENDC, upgrade))
|
print ("{0}[ upgrade ] --> {1}{2}".format(
|
||||||
|
colors.GREEN, colors.ENDC, upgrade))
|
||||||
for dwn in dwn_list:
|
for dwn in dwn_list:
|
||||||
if upgrade in dwn:
|
if upgrade in dwn:
|
||||||
dwn_patches.append(dwn)
|
dwn_patches.append(dwn)
|
||||||
|
@ -41,17 +44,20 @@ def patches():
|
||||||
os.system("wget -N --directory-prefix={0}{1} {2}".format(
|
os.system("wget -N --directory-prefix={0}{1} {2}".format(
|
||||||
slpkg_path, 'patches/', dwn))
|
slpkg_path, 'patches/', dwn))
|
||||||
for pkg in upgrade_all:
|
for pkg in upgrade_all:
|
||||||
print ("{0}[ upgrading ] --> {1}{2}".format(colors.GREEN, colors.ENDC, pkg))
|
print ("{0}[ upgrading ] --> {1}{2}".format(
|
||||||
|
colors.GREEN, colors.ENDC, pkg))
|
||||||
pkg_upgrade((slpkg_path + 'patches/' + pkg).split())
|
pkg_upgrade((slpkg_path + 'patches/' + pkg).split())
|
||||||
read = raw_input("Delete downloaded packages ? [Y/y] ")
|
read = raw_input("Remove the packages downloaded ? [Y/y] ")
|
||||||
if read == "Y" or read == "y":
|
if read == "Y" or read == "y":
|
||||||
for pkg in upgrade_all:
|
for pkg in upgrade_all:
|
||||||
os.remove("{0}{1}{2}".format(slpkg_path, 'patches/', pkg))
|
os.remove("{0}{1}{2}".format(slpkg_path, 'patches/', pkg))
|
||||||
if os.listdir(slpkg_path + 'patches/') == []:
|
if os.listdir(slpkg_path + 'patches/') == []:
|
||||||
print ("Done")
|
print ("Packages removed")
|
||||||
else:
|
else:
|
||||||
print ("\nThe packages were kept in {0}{1}\n".format(slpkg_path, 'patches/'))
|
print ("\nThere are packages in direcrory {0}{1}\n".format(
|
||||||
|
slpkg_path, 'patches/'))
|
||||||
else:
|
else:
|
||||||
print ("\nThe packages were kept in {0}{1}\n".format(slpkg_path, 'patches/'))
|
print ("\nThere are packages in directory {0}{1}\n".format(
|
||||||
|
slpkg_path, 'patches/'))
|
||||||
else:
|
else:
|
||||||
print ("\nYour system is up to date\n")
|
print ("\nYour system is up to date\n")
|
||||||
|
|
Loading…
Add table
Reference in a new issue