fix install noarch SBo pkgs

This commit is contained in:
Dimitris Zlatanidis 2014-08-26 20:11:34 +03:00
parent 4cea213b4c
commit d50bfe66b5
3 changed files with 31 additions and 5 deletions

View file

@ -25,6 +25,7 @@ import os
import sys
import subprocess
from pkg.find import find_package
from pkg.build import build_package
from pkg.manager import pkg_upgrade
@ -100,7 +101,7 @@ def sbo_check():
os.mkdir(build_path)
os.chdir(build_path)
for name, version in zip(pkg_name, sbo_ver):
pkg_for_install = ("{0}-{1}".format(name, version))
prgnam = ("{0}-{1}".format(name, version))
sbo_url = sbo_search_pkg(name)
sbo_dwn = sbo_slackbuild_dwn(sbo_url, name)
src_dwn = sbo_source_dwn(name).split()
@ -112,8 +113,16 @@ def sbo_check():
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 __metadata__ import sbo_arch
binary = ("{0}{1}{2}{3}{4}{5}".format(
tmp, pkg_for_install, sbo_arch, build, sbo_tag, sbo_filetype).split())
tmp, prgnam, sbo_arch, build, sbo_tag, sbo_filetype).split())
print("{0}[ Upgrading ] --> {1}{2}".format(
colors.GREEN, colors.ENDC, name))
pkg_upgrade(binary)

View file

@ -28,7 +28,7 @@ import subprocess
from colors import colors
from functions import get_file
from messages import pkg_not_found, pkg_found, template
from __metadata__ import sbo_arch, build, sbo_tag, sbo_filetype
from __metadata__ import build, sbo_tag, sbo_filetype
from __metadata__ import tmp, pkg_path, build_path, log_path, sp
from pkg.find import find_package
@ -135,6 +135,14 @@ def sbo_build(name):
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 __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(

View file

@ -109,7 +109,7 @@ def sbo_network(name):
if find_package(name + sp, pkg_path) == []:
sources = []
os.chdir(build_path)
pkg_for_install = ("{0}-{1}".format(name, sbo_version))
prgnam = ("{0}-{1}".format(name, sbo_version))
print("\n{0}Start -->{1} {2}\n".format(colors.GREEN, colors.ENDC, name))
subprocess.call("wget -N {0}".format(sbo_dwn), shell=True)
script = get_file(sbo_dwn, "/")
@ -117,8 +117,17 @@ def sbo_network(name):
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 __metadata__ import sbo_arch
binary = ("{0}{1}{2}{3}{4}{5}".format(
tmp, pkg_for_install, sbo_arch, build, sbo_tag, sbo_filetype).split())
tmp, prgnam, sbo_arch, build, sbo_tag, sbo_filetype).split())
print("{0}[ Installing ] --> {1}{2}".format(
colors.GREEN, colors.ENDC, name))
pkg_upgrade(binary)