mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-18 10:26:29 +01:00
updated for version 1.4.1
This commit is contained in:
parent
dc4fa1446a
commit
519756c8f4
4 changed files with 15 additions and 36 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
31-05-2014
|
||||||
|
Version 1.4.1
|
||||||
|
|
||||||
|
[Updated] - Fix to avoid download package if already installed
|
||||||
|
|
||||||
30-05-2014
|
30-05-2014
|
||||||
Version 1.4.0
|
Version 1.4.0
|
||||||
|
|
||||||
|
|
2
PKG-INFO
2
PKG-INFO
|
@ -1,6 +1,6 @@
|
||||||
Metadata-Version: 1.1
|
Metadata-Version: 1.1
|
||||||
Name: slpkg
|
Name: slpkg
|
||||||
Version: 1.4.0
|
Version: 1.4.1
|
||||||
Author: dslackw
|
Author: dslackw
|
||||||
Author-email: d zlatanidis at gmail com
|
Author-email: d zlatanidis at gmail com
|
||||||
Maintainer: dslackw
|
Maintainer: dslackw
|
||||||
|
|
42
bin/slpkg
42
bin/slpkg
|
@ -51,7 +51,7 @@ import subprocess
|
||||||
|
|
||||||
|
|
||||||
__author__ = "dslackw"
|
__author__ = "dslackw"
|
||||||
__version__ = "1.4.0"
|
__version__ = "1.4.1"
|
||||||
__license__ = "GNU General Public License v3 (GPLv3)"
|
__license__ = "GNU General Public License v3 (GPLv3)"
|
||||||
__email__ = "d.zlatanidis@gmail.com"
|
__email__ = "d.zlatanidis@gmail.com"
|
||||||
|
|
||||||
|
@ -144,26 +144,6 @@ def get_file(link, char):
|
||||||
return file
|
return file
|
||||||
|
|
||||||
|
|
||||||
# get version from files
|
|
||||||
def get_version(name):
|
|
||||||
char = "-"
|
|
||||||
|
|
||||||
j = 0
|
|
||||||
results = []
|
|
||||||
for i in name:
|
|
||||||
j += 1
|
|
||||||
results.append(name[-j:])
|
|
||||||
|
|
||||||
for file in results:
|
|
||||||
if file.startswith(char):
|
|
||||||
file = file
|
|
||||||
break
|
|
||||||
|
|
||||||
file = file.strip(" ") # remove spaces from string
|
|
||||||
|
|
||||||
return file
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# this fuction return if the package exist
|
# this fuction return if the package exist
|
||||||
def find_package(find_pkg, directory):
|
def find_package(find_pkg, directory):
|
||||||
|
@ -243,7 +223,6 @@ def SBo_search_pkg(name):
|
||||||
|
|
||||||
# find slackbuild download
|
# find slackbuild download
|
||||||
def SBo_slackbuild_dwn(SBo_url, name):
|
def SBo_slackbuild_dwn(SBo_url, name):
|
||||||
|
|
||||||
SBo_url = SBo_url.replace(name + "/", name + ".tar.gz")
|
SBo_url = SBo_url.replace(name + "/", name + ".tar.gz")
|
||||||
SBo_url = SBo_url.replace("repository", "slackbuilds")
|
SBo_url = SBo_url.replace("repository", "slackbuilds")
|
||||||
|
|
||||||
|
@ -288,7 +267,6 @@ def SBo_extra_dwn(SBo_url, name):
|
||||||
read_info = url_read(SBo_url)
|
read_info = url_read(SBo_url)
|
||||||
results = []
|
results = []
|
||||||
|
|
||||||
|
|
||||||
for line in read_info.splitlines():
|
for line in read_info.splitlines():
|
||||||
if line.startswith(' '):
|
if line.startswith(' '):
|
||||||
line = line[10:-1]
|
line = line[10:-1]
|
||||||
|
@ -789,16 +767,17 @@ def SBo_build(name):
|
||||||
for i in range(len(filename)):
|
for i in range(len(filename)):
|
||||||
filename_version.append(filename[i] + "-" + version[i])
|
filename_version.append(filename[i] + "-" + version[i])
|
||||||
|
|
||||||
|
|
||||||
print
|
|
||||||
print ("{}Start --> \n{}".format(colors.GREEN, colors.ENDC))
|
|
||||||
wget_links = set(dwn_link) # remove duplicate links
|
wget_links = set(dwn_link) # remove duplicate links
|
||||||
|
|
||||||
|
|
||||||
# dwonload links
|
# dwonload links
|
||||||
for link in wget_links:
|
for link in wget_links:
|
||||||
os.system("wget {}".format(link))
|
if find_package(filename_version[i], packages) == []:
|
||||||
|
os.system("wget {}".format(link))
|
||||||
|
print
|
||||||
|
print ("{}Start --> \n{}".format(colors.GREEN, colors.ENDC))
|
||||||
|
else:
|
||||||
|
print
|
||||||
|
pass
|
||||||
|
|
||||||
# build packages and store slackware files in /tmp directory
|
# build packages and store slackware files in /tmp directory
|
||||||
if results[0] == "extra1": # check how many extra sources
|
if results[0] == "extra1": # check how many extra sources
|
||||||
|
@ -817,7 +796,6 @@ def SBo_build(name):
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
||||||
print
|
|
||||||
print ("{}The package {}`{}`{} is already installed{}".format(colors.GREEN,
|
print ("{}The package {}`{}`{} is already installed{}".format(colors.GREEN,
|
||||||
colors.CYAN, filename_version[i], colors.GREEN, colors.ENDC))
|
colors.CYAN, filename_version[i], colors.GREEN, colors.ENDC))
|
||||||
print
|
print
|
||||||
|
@ -834,7 +812,6 @@ def SBo_build(name):
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
||||||
print
|
|
||||||
print ("{}The package {}`{}`{} is already installed{}".format(colors.GREEN,
|
print ("{}The package {}`{}`{} is already installed{}".format(colors.GREEN,
|
||||||
colors.CYAN, filename_version[i], colors.GREEN, colors.ENDC))
|
colors.CYAN, filename_version[i], colors.GREEN, colors.ENDC))
|
||||||
print
|
print
|
||||||
|
@ -859,7 +836,6 @@ def SBo_build(name):
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
|
|
||||||
print
|
|
||||||
print ("{}The package {}`{}`{} is already installed{}".format(colors.GREEN,
|
print ("{}The package {}`{}`{} is already installed{}".format(colors.GREEN,
|
||||||
colors.CYAN, filename_version[i], colors.GREEN, colors.ENDC))
|
colors.CYAN, filename_version[i], colors.GREEN, colors.ENDC))
|
||||||
print
|
print
|
||||||
|
@ -875,7 +851,6 @@ def SBo_build(name):
|
||||||
os.system("upgradepkg --install-new {}".format(install_pkg))
|
os.system("upgradepkg --install-new {}".format(install_pkg))
|
||||||
else:
|
else:
|
||||||
|
|
||||||
print
|
|
||||||
print ("{}The package {}`{}`{} is already installed{}".format(colors.GREEN,
|
print ("{}The package {}`{}`{} is already installed{}".format(colors.GREEN,
|
||||||
colors.CYAN, filename_version[i], colors.GREEN, colors.ENDC))
|
colors.CYAN, filename_version[i], colors.GREEN, colors.ENDC))
|
||||||
print
|
print
|
||||||
|
@ -895,7 +870,6 @@ def SBo_build(name):
|
||||||
os.system("upgradepkg --install-new {}".format(install_pkg))
|
os.system("upgradepkg --install-new {}".format(install_pkg))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print
|
|
||||||
print ("{}The package {}`{}`{} is already installed{}".format(colors.GREEN,
|
print ("{}The package {}`{}`{} is already installed{}".format(colors.GREEN,
|
||||||
colors.CYAN, filename_version[i], colors.GREEN, colors.ENDC))
|
colors.CYAN, filename_version[i], colors.GREEN, colors.ENDC))
|
||||||
print
|
print
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -7,7 +7,7 @@ from distutils.core import setup
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name = 'slpkg',
|
name = 'slpkg',
|
||||||
version = "1.4.0",
|
version = "1.4.1",
|
||||||
description = "Python tool to manage Slackware packages",
|
description = "Python tool to manage Slackware packages",
|
||||||
keywords = ["slackware", "slpkg", "upgrade", "install", "remove",
|
keywords = ["slackware", "slpkg", "upgrade", "install", "remove",
|
||||||
"view", "slackpkg", "tool"],
|
"view", "slackpkg", "tool"],
|
||||||
|
|
Loading…
Reference in a new issue