mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-30 20:34:38 +01:00
fix checksums after upgrade slack
This commit is contained in:
parent
5b146de25e
commit
dfeded98c6
4 changed files with 40 additions and 8 deletions
|
@ -24,7 +24,10 @@
|
||||||
from slack.mirrors import mirrors
|
from slack.mirrors import mirrors
|
||||||
|
|
||||||
from url_read import URL
|
from url_read import URL
|
||||||
from __metadata__ import lib_path
|
from __metadata__ import (
|
||||||
|
lib_path,
|
||||||
|
slack_rel
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def pkg_checksum(binary, repo):
|
def pkg_checksum(binary, repo):
|
||||||
|
@ -32,8 +35,10 @@ def pkg_checksum(binary, repo):
|
||||||
Return checksum from CHECKSUMS.md5 file by repository
|
Return checksum from CHECKSUMS.md5 file by repository
|
||||||
'''
|
'''
|
||||||
md5 = "None"
|
md5 = "None"
|
||||||
if repo == "slack_patches":
|
if repo == "slack_patches" and slack_rel == "stable":
|
||||||
CHECKSUMS_md5 = URL(mirrors("CHECKSUMS.md5", "patches/")).reading()
|
CHECKSUMS_md5 = URL(mirrors("CHECKSUMS.md5", "patches/")).reading()
|
||||||
|
elif repo == "slack_patches" and slack_rel == "current":
|
||||||
|
CHECKSUMS_md5 = URL(mirrors("CHECKSUMS.md5", "")).reading()
|
||||||
else:
|
else:
|
||||||
repos = {
|
repos = {
|
||||||
'slack': 'slack_repo/CHECKSUMS.md5',
|
'slack': 'slack_repo/CHECKSUMS.md5',
|
||||||
|
|
|
@ -374,6 +374,21 @@ class Initialization(object):
|
||||||
f.write(line + "\n")
|
f.write(line + "\n")
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
|
def re_create(self):
|
||||||
|
'''
|
||||||
|
Remove all package lists with changelog and checksums files
|
||||||
|
and create lists again
|
||||||
|
'''
|
||||||
|
for repo in repositories:
|
||||||
|
changelogs = '{0}{1}{2}'.format(log_path, repo, '/ChangeLog.txt')
|
||||||
|
if os.path.isfile(changelogs):
|
||||||
|
os.remove(changelogs)
|
||||||
|
for f in os.listdir(lib_path + '{0}_repo/'.format(repo)):
|
||||||
|
packages = '{0}{1}_repo/{2}'.format(lib_path, repo, f)
|
||||||
|
if os.path.isfile(packages):
|
||||||
|
os.remove(packages)
|
||||||
|
Update().repository()
|
||||||
|
|
||||||
|
|
||||||
class Update(object):
|
class Update(object):
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,6 @@
|
||||||
import sys
|
import sys
|
||||||
import getpass
|
import getpass
|
||||||
|
|
||||||
from slpkg_update import it_self_update
|
|
||||||
|
|
||||||
from desc import PkgDesc
|
from desc import PkgDesc
|
||||||
from config import Config
|
from config import Config
|
||||||
from queue import QueuePkgs
|
from queue import QueuePkgs
|
||||||
|
@ -34,7 +32,9 @@ from tracking import track_dep
|
||||||
from blacklist import BlackList
|
from blacklist import BlackList
|
||||||
from version import prog_version
|
from version import prog_version
|
||||||
from arguments import options, usage
|
from arguments import options, usage
|
||||||
|
from slpkg_update import it_self_update
|
||||||
from init import (
|
from init import (
|
||||||
|
Initialization,
|
||||||
Update,
|
Update,
|
||||||
check_exists_repositories
|
check_exists_repositories
|
||||||
)
|
)
|
||||||
|
@ -112,7 +112,6 @@ class Case(object):
|
||||||
OthersUpgrade("slonly", self.release).start()
|
OthersUpgrade("slonly", self.release).start()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
s_user(getpass.getuser())
|
s_user(getpass.getuser())
|
||||||
|
@ -130,6 +129,9 @@ def main():
|
||||||
# checking if repositories exists
|
# checking if repositories exists
|
||||||
check_exists_repositories()
|
check_exists_repositories()
|
||||||
|
|
||||||
|
if len(args) == 1 and args[0] == "re-create":
|
||||||
|
Initialization().re_create()
|
||||||
|
|
||||||
if len(args) == 0:
|
if len(args) == 0:
|
||||||
usage()
|
usage()
|
||||||
elif (len(args) == 1 and args[0] == "-h" or
|
elif (len(args) == 1 and args[0] == "-h" or
|
||||||
|
|
|
@ -176,6 +176,16 @@ def kernel(upgrade_all):
|
||||||
'''
|
'''
|
||||||
for core in upgrade_all:
|
for core in upgrade_all:
|
||||||
if "kernel" in core:
|
if "kernel" in core:
|
||||||
print("The kernel has been upgraded, reinstall `lilo` ...")
|
if default_answer == "y":
|
||||||
subprocess.call("lilo", shell=True)
|
answer = default_answer
|
||||||
break
|
else:
|
||||||
|
print("")
|
||||||
|
template(78)
|
||||||
|
print("| {0}*** HIGHLY recommended reinstall 'LILO' "
|
||||||
|
"***{1}".format(color['RED'], color['ENDC']))
|
||||||
|
template(78)
|
||||||
|
answer = raw_input("\nThe kernel has been upgraded, "
|
||||||
|
"reinstall `LILO` [Y/n]? ")
|
||||||
|
if answer in ['y', 'Y']:
|
||||||
|
subprocess.call("lilo", shell=True)
|
||||||
|
break
|
||||||
|
|
Loading…
Add table
Reference in a new issue