View | Details | Raw Unified | Return to bug 51865
Collapse All | Expand All

(-)a/base/univention-updater/debian/changelog (+6 lines)
 Lines 1-3    Link Here 
1
univention-updater (14.0.2-17) unstable; urgency=medium
2
3
  * test upgrade
4
5
 -- Jürn Brodersen <brodersen@univention.de>  Wed, 19 Aug 2020 14:19:18 +0200
6
1
univention-updater (14.0.2-16) unstable; urgency=medium
7
univention-updater (14.0.2-16) unstable; urgency=medium
2
8
3
  * Bug #46465: call postup.sh after setting version/version
9
  * Bug #46465: call postup.sh after setting version/version
(-)a/base/univention-updater/modules/univention/updater/tools.py (-6 / +42 lines)
 Lines 71-76   import tempfile Link Here 
71
import shutil
71
import shutil
72
import logging
72
import logging
73
import atexit
73
import atexit
74
import json
74
try:
75
try:
75
    from typing import Any, AnyStr, Dict, Generator, Iterable, Iterator, List, Optional, Sequence, Set, Tuple, Type, Union  # noqa F401
76
    from typing import Any, AnyStr, Dict, Generator, Iterable, Iterator, List, Optional, Sequence, Set, Tuple, Type, Union  # noqa F401
76
except ImportError:
77
except ImportError:
 Lines 295-300   class UCSRepoPool(_UCSRepo): Link Here 
295
        return "clean %s%s" % (server, super(UCSRepoPool, self)._format(fmt))
296
        return "clean %s%s" % (server, super(UCSRepoPool, self)._format(fmt))
296
297
297
298
299
class UCSRepoPoolUCS500(_UCSRepo):
300
    """
301
    Minimal ucs500 repo implementation for get_sh_files.
302
    """
303
304
    def __init__(self, **kw):
305
        # type: (**Any) -> None
306
        kw.setdefault('version', UCS_Version.FORMAT)
307
        kw.setdefault('patch', UCS_Version.FULLFORMAT)
308
        super(UCSRepoPoolUCS500, self).__init__(**kw)
309
310
    def path(self, filename):
311
        return "dists/ucs500/" + filename
312
313
298
class UCSRepoPoolNoArch(_UCSRepo):
314
class UCSRepoPoolNoArch(_UCSRepo):
299
    """
315
    """
300
    Flat Debian APT repository without explicit architecture subdirectory.
316
    Flat Debian APT repository without explicit architecture subdirectory.
 Lines 956-966   class UniventionUpdater(object): Link Here 
956
            if major < 99:
972
            if major < 99:
957
                yield {'major': major + 1, 'minor': 0, 'patchlevel': 0}
973
                yield {'major': major + 1, 'minor': 0, 'patchlevel': 0}
958
974
975
        def is_ucs500_released():
976
            # type: () -> bool
977
            _code, _size, releases = self.server.access(None, 'releases.json', get=True)
978
            try:
979
                majors = json.loads(releases)['releases']
980
                minors = [r for r in majors if r['major'] == 5][0]['minors']
981
                patchlevels = [r for r in minors if r['minor'] == 0][0]['patchlevels']
982
                if [r for r in patchlevels if r['patchlevel'] == 0]:
983
                    return True
984
            except (ValueError, KeyError) as exc:
985
                ud.debug(ud.NETWORK, ud.ALL, "releases.json malformed: %s" % exc)
986
            return False
987
959
        for ver in versions(version.major, version.minor, version.patchlevel):
988
        for ver in versions(version.major, version.minor, version.patchlevel):
960
            repo = UCSRepoPool(prefix=self.server, part='maintained', **ver)
989
            repo = UCSRepoPool(prefix=self.server, part='maintained', **ver)
961
            self.log.info('Checking for version %s', repo)
990
            self.log.info('Checking for version %s', repo)
962
            try:
991
            try:
963
                assert self.server.access(repo)
992
                if ver['major'] > 4 and version.major == 4:
993
                    if not is_ucs500_released():
994
                        return None
995
                else:
996
                    assert self.server.access(repo)
964
                self.log.info('Found version %s', repo.path())
997
                self.log.info('Found version %s', repo.path())
965
                failed = set()
998
                failed = set()
966
                for component in components:
999
                for component in components:
 Lines 1050-1059   class UniventionUpdater(object): Link Here 
1050
        mmp_version = UCS_Version(version)
1083
        mmp_version = UCS_Version(version)
1051
        current_components = self.get_current_components()
1084
        current_components = self.get_current_components()
1052
1085
1053
        result = [
1086
        if mmp_version.major > 4 and mmp_version.minor == 0 and mmp_version.patchlevel == 0:
1054
            ver.deb(server)
1087
            result = ['deb {server} ucs500 main'.format(server=self.server)]
1055
            for server, ver in self._iterate_version_repositories(mmp_version, mmp_version, self.parts, self.architectures)
1088
        else:
1056
        ]
1089
            result = [
1090
                ver.deb(server)
1091
                for server, ver in self._iterate_version_repositories(mmp_version, mmp_version, self.parts, self.architectures)
1092
            ]
1057
        for component in components:
1093
        for component in components:
1058
            repos = []  # type: List[str]
1094
            repos = []  # type: List[str]
1059
            try:
1095
            try:
 Lines 1901-1907   class UniventionUpdater(object): Link Here 
1901
                os.chmod(name, 0o744)
1937
                os.chmod(name, 0o744)
1902
                if size == len(script):
1938
                if size == len(script):
1903
                    ud.debug(ud.NETWORK, ud.INFO, "%s saved to %s" % (uri, name))
1939
                    ud.debug(ud.NETWORK, ud.INFO, "%s saved to %s" % (uri, name))
1904
                    if struct.part.endswith('/component'):
1940
                    if hasattr(struct, 'part') and struct.part.endswith('/component'):
1905
                        comp[phase].append((name, str(struct.patch)))
1941
                        comp[phase].append((name, str(struct.patch)))
1906
                    else:
1942
                    else:
1907
                        main[phase].append((name, str(struct.patch)))
1943
                        main[phase].append((name, str(struct.patch)))
(-)a/base/univention-updater/python/univention-updater (-4 / +5 lines)
 Lines 73-79   from univention.admindiary.events import UPDATE_STARTED, UPDATE_FINISHED_SUCCESS Link Here 
73
73
74
from univention.updater.errors import PreconditionError, ConfigurationError, RequiredComponentError, VerificationError, DownloadError
74
from univention.updater.errors import PreconditionError, ConfigurationError, RequiredComponentError, VerificationError, DownloadError
75
from univention.updater.ucs_version import UCS_Version
75
from univention.updater.ucs_version import UCS_Version
76
from univention.updater.tools import UniventionUpdater, LocalUpdater
76
from univention.updater.tools import UniventionUpdater, LocalUpdater, UCSRepoPoolUCS500
77
from univention.updater.locking import UpdaterLock
77
from univention.updater.locking import UpdaterLock
78
from univention.updater.commands import cmd_update, cmd_dist_upgrade
78
from univention.updater.commands import cmd_update, cmd_dist_upgrade
79
79
 Lines 538-545   def main(): Link Here 
538
    add_temporary_sources_list(updater.release_update_temporary_sources_list(nextversion))
538
    add_temporary_sources_list(updater.release_update_temporary_sources_list(nextversion))
539
    try:
539
    try:
540
        phase = 'preup'
540
        phase = 'preup'
541
541
        if new_version.major > 4 and new_version.minor == 0 and new_version.patchlevel == 0:
542
        rel = updater._iterate_version_repositories(new_version, new_version, ('maintained',), [])
542
            rel = [(updater.server, UCSRepoPoolUCS500(major=new_version.major, minor=new_version.minor, patchlevel=new_version.patchlevel))]
543
        else:
544
            rel = updater._iterate_version_repositories(new_version, new_version, ('maintained',), [])
543
545
544
        components = updater.get_components()
546
        components = updater.get_components()
545
        # components = filter(lambda c: 'current' in ucr.get('repository/online/component/%s/version' % c, '').split(','), components)
547
        # components = filter(lambda c: 'current' in ucr.get('repository/online/component/%s/version' % c, '').split(','), components)
546
- 

Return to bug 51865