updated for version 1.9.1

This commit is contained in:
Dimitris Zlatanidis 2014-09-25 07:19:42 +03:00
parent 2215495a12
commit bc88ff4dbe
16 changed files with 45 additions and 48 deletions

View file

@ -1,3 +1,9 @@
Version 1.9.1
25-09-2014
[Updated] - Bugfix v1.9.0 no update slackbuilds packages
- Fix arch in sbo upgrade
Version 1.9.0 Version 1.9.0
24-09-2014 24-09-2014

View file

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

View file

@ -7,9 +7,9 @@
Latest Release: Latest Release:
- Version: 1.9.0 - Version: 1.9.1
- `Package <https://sourceforge.net/projects/slpkg/files/slpkg/binary/>`_ - `Package <https://sourceforge.net/projects/slpkg/files/slpkg/binary/>`_
- `Source <https://github.com/dslackw/slpkg/archive/v1.9.0.tar.gz>`_ - `Source <https://github.com/dslackw/slpkg/archive/v1.9.1.tar.gz>`_
- `CHANGELOG <https://github.com/dslackw/slpkg/blob/master/CHANGELOG>`_ - `CHANGELOG <https://github.com/dslackw/slpkg/blob/master/CHANGELOG>`_
.. image:: https://raw.githubusercontent.com/dslackw/images/master/slpkg/logo.png .. image:: https://raw.githubusercontent.com/dslackw/images/master/slpkg/logo.png
@ -98,8 +98,8 @@ Untar the archive and run install.sh script:
.. code-block:: bash .. code-block:: bash
$ tar xvf slpkg-1.9.0.tar.gz $ tar xvf slpkg-1.9.1.tar.gz
$ cd slpkg-1.9.0 $ cd slpkg-1.9.1
$ ./install.sh $ ./install.sh
Using `pip <https://pip.pypa.io/en/latest/>`_ : Using `pip <https://pip.pypa.io/en/latest/>`_ :

View file

@ -21,7 +21,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=slpkg PRGNAM=slpkg
VERSION=${VERSION:-1.9.0} VERSION=${VERSION:-1.9.1}
TAG=${TAG:-_dsw} TAG=${TAG:-_dsw}
cd .. cd ..

View file

@ -23,7 +23,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=slpkg PRGNAM=slpkg
VERSION=${VERSION:-1.9.0} VERSION=${VERSION:-1.9.1}
BUILD=${BUILD:-1} BUILD=${BUILD:-1}
TAG=${TAG:-_dsw} TAG=${TAG:-_dsw}

View file

@ -1,7 +1,7 @@
PRGNAM="slpkg" PRGNAM="slpkg"
VERSION="1.9.0" VERSION="1.9.1"
HOMEPAGE="https://github.com/dslackw/slpkg" HOMEPAGE="https://github.com/dslackw/slpkg"
DOWNLOAD="https://github.com/dslackw/slpkg/archive/v1.9.0.tar.gz" DOWNLOAD="https://github.com/dslackw/slpkg/archive/v1.9.1.tar.gz"
MD5SUM="" MD5SUM=""
DOWNLOAD_x86_64="" DOWNLOAD_x86_64=""
MD5SUM_x86_64="" MD5SUM_x86_64=""

View file

@ -26,7 +26,7 @@ import subprocess
__all__ = "slpkg" __all__ = "slpkg"
__author__ = "dslackw" __author__ = "dslackw"
__version_info__ = (1, 9, 0) __version_info__ = (1, 9, 1)
__version__ = "{0}.{1}.{2}".format(*__version_info__) __version__ = "{0}.{1}.{2}".format(*__version_info__)
__license__ = "GNU General Public License v3 (GPLv3)" __license__ = "GNU General Public License v3 (GPLv3)"
__email__ = "d.zlatanidis@gmail.com" __email__ = "d.zlatanidis@gmail.com"

View file

@ -56,7 +56,6 @@ import argparse
from colors import colors from colors import colors
from __metadata__ import path from __metadata__ import path
from functions import get_file
from version import prog_version from version import prog_version
from messages import (ext_err_args, s_user, from messages import (ext_err_args, s_user,
err1_args, err2_args) err1_args, err2_args)
@ -79,9 +78,9 @@ def main():
action="store_true") action="store_true")
parser.add_argument("-a", help="auto build packages", parser.add_argument("-a", help="auto build packages",
type=str, nargs="+", metavar=("script", "sources")) type=str, nargs="+", metavar=("script", "sources"))
parser.add_argument("-l", help="list of installed packages", parser.add_argument("-l", help="list of installed packages",
choices="all sbo slack noarch".split(), choices="all sbo slack noarch".split(),
metavar=("all, sbo, slack, noarch")) metavar=("all, sbo, slack, noarch"))
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", "<upgrade>")) type=str, nargs="+", metavar=("sbo, slack", "<upgrade>"))
parser.add_argument("-s", help="download, build & install packages", parser.add_argument("-s", help="download, build & install packages",

View file

@ -30,7 +30,6 @@ from slpkg.pkg.build import build_package
from slpkg.pkg.manager import pkg_upgrade from slpkg.pkg.manager import pkg_upgrade
from slpkg.colors import colors from slpkg.colors import colors
from slpkg.functions import get_file
from slpkg.messages import template, build_FAILED from slpkg.messages import template, build_FAILED
from slpkg.__metadata__ import tmp, pkg_path, build_path, sp from slpkg.__metadata__ import tmp, pkg_path, build_path, sp
@ -54,12 +53,7 @@ def sbo_check():
colors.GREY, colors.ENDC)) colors.GREY, colors.ENDC))
sys.stdout.flush() sys.stdout.flush()
initialization() initialization()
arches = [ arches = ["-x86_64-", "-i486-", "-arm-", "-noarch-"]
"-x86_64-",
"-i486-",
"-arm-",
"-noarch-"
]
index, toolbar_width = int(), 3 index, toolbar_width = int(), 3
dependencies, dependencies_list, \ dependencies, dependencies_list, \
requires, upgrade, installed, sbo_list, \ requires, upgrade, installed, sbo_list, \
@ -80,8 +74,10 @@ def sbo_check():
arch = _arch[1:-1] arch = _arch[1:-1]
else: else:
arch = os.uname()[4] arch = os.uname()[4]
if arch.startswith("i") and arch.endswith("86"):
arch = "i486"
package = pkg[:-(len(arch) + len("_SBo") + 3)] package = pkg[:-(len(arch) + len("_SBo") + 3)]
pkg_version = get_file(package, "-")[1:] pkg_version = package.split("-")[-1]
name = package[:-(len(pkg_version) + 1)] name = package[:-(len(pkg_version) + 1)]
if sbo_search_pkg(name): if sbo_search_pkg(name):
# search packages if exists in the repository # search packages if exists in the repository
@ -127,6 +123,9 @@ def sbo_check():
prgnam = ("{0}-{1}".format(pkg, ver)) prgnam = ("{0}-{1}".format(pkg, ver))
pkg_version = ver # if package not installed pkg_version = ver # if package not installed
# take version from repository # take version from repository
arch = os.uname()[4]
if arch.startswith("i") and arch.endswith("86"):
arch = "i486"
if find_package(prgnam, pkg_path) == []: if find_package(prgnam, pkg_path) == []:
for sbo in os.listdir(pkg_path): for sbo in os.listdir(pkg_path):
if sbo.startswith(pkg + sp) and sbo.endswith("_SBo"): if sbo.startswith(pkg + sp) and sbo.endswith("_SBo"):
@ -134,12 +133,10 @@ def sbo_check():
# if yes grab package name, # if yes grab package name,
# version and arch # version and arch
for _arch in arches: for _arch in arches:
if _arch in pkg: if _arch in sbo:
arch = _arch[1:-1] arch = _arch[1:-1]
else:
arch = os.uname()[4]
name = sbo[:-(len(arch) + len("_SBo") + 3)] name = sbo[:-(len(arch) + len("_SBo") + 3)]
pkg_version = get_file(name, "-")[1:] pkg_version = name.split("-")[-1]
upgrade.append(pkg) upgrade.append(pkg)
pkg_for_upg.append("{0}-{1}".format(pkg, pkg_version)) pkg_for_upg.append("{0}-{1}".format(pkg, pkg_version))
upg_ver.append(ver) upg_ver.append(ver)
@ -183,13 +180,13 @@ def sbo_check():
sbo_url = sbo_search_pkg(name) sbo_url = sbo_search_pkg(name)
sbo_dwn = sbo_slackbuild_dwn(sbo_url) sbo_dwn = sbo_slackbuild_dwn(sbo_url)
src_dwn = sbo_source_dwn(name).split() src_dwn = sbo_source_dwn(name).split()
script = get_file(sbo_dwn, "/") script = sbo_dwn.split("/")[-1] # keep file from script link
print("\n{0}Start -->{1} {2}\n".format(GREEN, ENDC, name)) print("\n{0}Start -->{1} {2}\n".format(GREEN, ENDC, name))
subprocess.call("wget -N {0}".format(sbo_dwn), shell=True) subprocess.call("wget -N {0}".format(sbo_dwn), shell=True)
sources = [] sources = []
for src in src_dwn: for src in src_dwn:
subprocess.call("wget -N {0}".format(src), shell=True) subprocess.call("wget -N {0}".format(src), shell=True)
sources.append(get_file(src, "/")) sources.append(src.split("/")[-1]) # keep file from source link
build_package(script, sources, build_path) build_package(script, sources, build_path)
# Searches the package name and version in /tmp to install. # Searches the package name and version in /tmp to install.
# If find two or more packages e.g. to build tag # If find two or more packages e.g. to build tag

View file

@ -25,6 +25,7 @@ import os
from slpkg.url_read import url_read from slpkg.url_read import url_read
from slpkg.__metadata__ import arch, lib_path from slpkg.__metadata__ import arch, lib_path
from search import sbo_search_pkg from search import sbo_search_pkg
def sbo_source_dwn(name): def sbo_source_dwn(name):

View file

@ -25,7 +25,6 @@ import os
import re import re
import sys import sys
from slpkg.functions import get_file
from slpkg.__metadata__ import lib_path from slpkg.__metadata__ import lib_path
from slpkg.slack.slack_version import slack_ver from slpkg.slack.slack_version import slack_ver
@ -39,7 +38,7 @@ def sbo_search_pkg(name):
with open(lib_path + "sbo_repo/SLACKBUILDS.TXT", "r") as SLACKBUILDS_TXT: with open(lib_path + "sbo_repo/SLACKBUILDS.TXT", "r") as SLACKBUILDS_TXT:
for line in SLACKBUILDS_TXT: for line in SLACKBUILDS_TXT:
if line.startswith("SLACKBUILD LOCATION"): if line.startswith("SLACKBUILD LOCATION"):
if name == get_file(line[23:].strip(), "/").replace("\n", ""): if name == (line[23:].split("/")[-1].replace("\n", "")).strip():
SLACKBUILDS_TXT.close() SLACKBUILDS_TXT.close()
return (sbo_url + line[23:].strip() + "/") return (sbo_url + line[23:].strip() + "/")
except KeyboardInterrupt: except KeyboardInterrupt:

View file

@ -26,9 +26,8 @@ import sys
import subprocess import subprocess
from slpkg.colors import colors from slpkg.colors import colors
from slpkg.functions import get_file
from slpkg.__metadata__ import (tmp, pkg_path, build_path, from slpkg.__metadata__ import (tmp, pkg_path, build_path,
log_path, lib_path, sp) log_path, lib_path, sp)
from slpkg.messages import (pkg_not_found, pkg_found, template, from slpkg.messages import (pkg_not_found, pkg_found, template,
build_FAILED, sbo_packages_view) build_FAILED, sbo_packages_view)
@ -165,13 +164,13 @@ def sbo_build(name):
sbo_url = sbo_search_pkg(pkg) sbo_url = sbo_search_pkg(pkg)
sbo_link = sbo_slackbuild_dwn(sbo_url) sbo_link = sbo_slackbuild_dwn(sbo_url)
src_link = sbo_source_dwn(pkg).split() src_link = sbo_source_dwn(pkg).split()
script = get_file(sbo_link, "/") script = sbo_link.split("/")[-1] # get file from script
print("\n{0}Start -->{1} {2}\n".format(colors.GREEN, ENDC, pkg)) print("\n{0}Start -->{1} {2}\n".format(colors.GREEN, ENDC, pkg))
subprocess.call("wget -N {0}".format(sbo_link), shell=True) subprocess.call("wget -N {0}".format(sbo_link), shell=True)
sources = [] sources = []
for src in src_link: for src in src_link:
subprocess.call("wget -N {0}".format(src), shell=True) subprocess.call("wget -N {0}".format(src), shell=True)
sources.append(get_file(src, "/")) sources.append(src.split("/")[-1]) # get file from source
build_package(script, sources, build_path) build_package(script, sources, build_path)
# Searches the package name and version in /tmp to install. # Searches the package name and version in /tmp to install.
# If find two or more packages e.g. to build tag # If find two or more packages e.g. to build tag

View file

@ -27,10 +27,9 @@ import pydoc
import subprocess import subprocess
from slpkg.colors import colors from slpkg.colors import colors
from slpkg.functions import get_file
from slpkg.__metadata__ import tmp, build_path, pkg_path, sp from slpkg.__metadata__ import tmp, build_path, pkg_path, sp
from slpkg.messages import (pkg_not_found, pkg_found, view_sbo, from slpkg.messages import (pkg_not_found, pkg_found, view_sbo,
template, build_FAILED) template, build_FAILED)
from slpkg.pkg.build import build_package from slpkg.pkg.build import build_package
from slpkg.pkg.find import find_package from slpkg.pkg.find import find_package
@ -58,8 +57,8 @@ def sbo_network(name):
sbo_dwn = sbo_slackbuild_dwn(sbo_url) sbo_dwn = sbo_slackbuild_dwn(sbo_url)
source_dwn = sbo_source_dwn(name).split() source_dwn = sbo_source_dwn(name).split()
sys.stdout.write("{0}Done{1}\n".format(colors.GREY, colors.ENDC)) sys.stdout.write("{0}Done{1}\n".format(colors.GREY, colors.ENDC))
view_sbo(name, sbo_url, sbo_desc, get_file(sbo_dwn, "/"), \ view_sbo(name, sbo_url, sbo_desc, sbo_dwn.split("/")[-1], \
", ".join([get_file(src, "/") for src in source_dwn]), \ ", ".join([src.split("/")[-1] for src in source_dwn]), \
sbo_req) sbo_req)
# Check if package supported by arch # Check if package supported by arch
# before proceed to install # before proceed to install
@ -97,12 +96,12 @@ def sbo_network(name):
os.mkdir(build_path) os.mkdir(build_path)
sources = [] sources = []
os.chdir(build_path) os.chdir(build_path)
script = get_file(sbo_dwn, "/") script = sbo_dwn.split("/")[-1] # get file from script link
print("\n{0}Start -->{0} {1}\n".format(colors.GREEN, colors.ENDC, name)) print("\n{0}Start -->{0} {1}\n".format(colors.GREEN, colors.ENDC, name))
subprocess.call("wget -N {0}".format(sbo_dwn), shell=True) subprocess.call("wget -N {0}".format(sbo_dwn), shell=True)
for src in source_dwn: for src in source_dwn:
subprocess.call("wget -N {0}".format(src), shell=True) subprocess.call("wget -N {0}".format(src), shell=True)
sources.append(get_file(src, "/")) sources.append(src.split("/")[-1]) # get file from source link
build_package(script, sources, build_path) build_package(script, sources, build_path)
print("Complete!\n") print("Complete!\n")
break break
@ -119,10 +118,10 @@ def sbo_network(name):
os.chdir(build_path) os.chdir(build_path)
print("\n{0}Start -->{0} {1}\n".format(colors.GREEN, colors.ENDC, name)) print("\n{0}Start -->{0} {1}\n".format(colors.GREEN, colors.ENDC, name))
subprocess.call("wget -N {0}".format(sbo_dwn), shell=True) subprocess.call("wget -N {0}".format(sbo_dwn), shell=True)
script = get_file(sbo_dwn, "/") script = sbo_dwn.split("/")[-1] # get file from script link
for src in source_dwn: for src in source_dwn:
subprocess.call("wget -N {0}".format(src), shell=True) subprocess.call("wget -N {0}".format(src), shell=True)
sources.append(get_file(src, "/")) sources.append(src.split("/")[-1]) # get file from source link
build_package(script, sources, build_path) build_package(script, sources, build_path)
# Searches the package name and version in /tmp to install. # Searches the package name and version in /tmp to install.
# If find two or more packages e.g. to build tag # If find two or more packages e.g. to build tag

View file

@ -27,7 +27,6 @@ import time
import subprocess import subprocess
from slpkg.colors import colors from slpkg.colors import colors
from slpkg.functions import get_file
from slpkg.url_read import url_read from slpkg.url_read import url_read
from slpkg.messages import pkg_not_found, template from slpkg.messages import pkg_not_found, template
from slpkg.__metadata__ import slpkg_tmp, pkg_path, slack_archs from slpkg.__metadata__ import slpkg_tmp, pkg_path, slack_archs
@ -97,9 +96,9 @@ def install(slack_pkg):
for archs in slack_archs: for archs in slack_archs:
if archs in pkg: if archs in pkg:
pkgs = pkg[:-4] pkgs = pkg[:-4]
build = get_file(pkgs, "-").replace("-", "") build = pkgs.split("-")[-1]
name_ver = pkgs[:-(len(archs) + len(build))] name_ver = pkgs[:-(len(archs) + len(build))]
ver = get_file(name_ver, "-").replace("-", "") ver = name_ver.split("-")[-1]
name = name_ver[:-(len(ver) + 1)] name = name_ver[:-(len(ver) + 1)]
arch = archs[1:-1] arch = archs[1:-1]
names.append(name) names.append(name)

View file

@ -22,7 +22,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from slpkg.__metadata__ import arch from slpkg.__metadata__ import arch
from slack_version import slack_ver from slack_version import slack_ver
def mirrors(name, location): def mirrors(name, location):

View file

@ -29,7 +29,6 @@ import subprocess
from slpkg.colors import colors from slpkg.colors import colors
from slpkg.url_read import url_read from slpkg.url_read import url_read
from slpkg.messages import template from slpkg.messages import template
from slpkg.functions import get_file
from slpkg.__metadata__ import pkg_path, slpkg_tmp, slack_archs from slpkg.__metadata__ import pkg_path, slpkg_tmp, slack_archs
from slpkg.pkg.manager import pkg_upgrade from slpkg.pkg.manager import pkg_upgrade
@ -94,9 +93,9 @@ def patches():
else: else:
slack = str() slack = str()
upg = upgrade[:-(len(slack) + 4)] upg = upgrade[:-(len(slack) + 4)]
build = get_file(upg, "-").replace("-", "") build = upg.split("-")[-1]
upg_ver = upg[:-(len(arch) + len(build))] upg_ver = upg[:-(len(arch) + len(build))]
ver = get_file(upg_ver, "-").replace("-", "") ver = upg_ver.split("-")[-1]
name = upg_ver[:-(len(ver) + 1)] name = upg_ver[:-(len(ver) + 1)]
arch = arch[1:-1] arch = arch[1:-1]
print(" {0}{1}{2}{3}{4}{5}{6}{7}{8}{9}{10}{11:>12}{12}".format( print(" {0}{1}{2}{3}{4}{5}{6}{7}{8}{9}{10}{11:>12}{12}".format(