mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-18 10:26:29 +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 url_read import URL
|
||||
from __metadata__ import lib_path
|
||||
from __metadata__ import (
|
||||
lib_path,
|
||||
slack_rel
|
||||
)
|
||||
|
||||
|
||||
def pkg_checksum(binary, repo):
|
||||
|
@ -32,8 +35,10 @@ def pkg_checksum(binary, repo):
|
|||
Return checksum from CHECKSUMS.md5 file by repository
|
||||
'''
|
||||
md5 = "None"
|
||||
if repo == "slack_patches":
|
||||
if repo == "slack_patches" and slack_rel == "stable":
|
||||
CHECKSUMS_md5 = URL(mirrors("CHECKSUMS.md5", "patches/")).reading()
|
||||
elif repo == "slack_patches" and slack_rel == "current":
|
||||
CHECKSUMS_md5 = URL(mirrors("CHECKSUMS.md5", "")).reading()
|
||||
else:
|
||||
repos = {
|
||||
'slack': 'slack_repo/CHECKSUMS.md5',
|
||||
|
|
|
@ -374,6 +374,21 @@ class Initialization(object):
|
|||
f.write(line + "\n")
|
||||
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):
|
||||
|
||||
|
|
|
@ -24,8 +24,6 @@
|
|||
import sys
|
||||
import getpass
|
||||
|
||||
from slpkg_update import it_self_update
|
||||
|
||||
from desc import PkgDesc
|
||||
from config import Config
|
||||
from queue import QueuePkgs
|
||||
|
@ -34,7 +32,9 @@ from tracking import track_dep
|
|||
from blacklist import BlackList
|
||||
from version import prog_version
|
||||
from arguments import options, usage
|
||||
from slpkg_update import it_self_update
|
||||
from init import (
|
||||
Initialization,
|
||||
Update,
|
||||
check_exists_repositories
|
||||
)
|
||||
|
@ -112,7 +112,6 @@ class Case(object):
|
|||
OthersUpgrade("slonly", self.release).start()
|
||||
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
s_user(getpass.getuser())
|
||||
|
@ -130,6 +129,9 @@ def main():
|
|||
# checking if repositories exists
|
||||
check_exists_repositories()
|
||||
|
||||
if len(args) == 1 and args[0] == "re-create":
|
||||
Initialization().re_create()
|
||||
|
||||
if len(args) == 0:
|
||||
usage()
|
||||
elif (len(args) == 1 and args[0] == "-h" or
|
||||
|
|
|
@ -176,6 +176,16 @@ def kernel(upgrade_all):
|
|||
'''
|
||||
for core in upgrade_all:
|
||||
if "kernel" in core:
|
||||
print("The kernel has been upgraded, reinstall `lilo` ...")
|
||||
subprocess.call("lilo", shell=True)
|
||||
break
|
||||
if default_answer == "y":
|
||||
answer = default_answer
|
||||
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…
Reference in a new issue