Univention Bugzilla – Attachment 7022 Details for
Bug 30417
univention-upgrade should suggest App Center updates
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
univention-upgrade.patch
updater.patch (text/plain), 2.74 KB, created by
Dirk Wiesenthal
on 2015-07-13 19:33:08 CEST
(
hide
)
Description:
univention-upgrade.patch
Filename:
MIME Type:
Creator:
Dirk Wiesenthal
Created:
2015-07-13 19:33:08 CEST
Size:
2.74 KB
patch
obsolete
>--- /usr/sbin/univention-upgrade.bak 2015-07-13 12:31:34.499392000 +0200 >+++ /usr/sbin/univention-upgrade 2015-07-13 13:10:08.779392000 +0200 >@@ -37,6 +37,7 @@ > import optparse > import subprocess > import traceback >+import logging > > import univention.config_registry > >@@ -271,6 +272,68 @@ > else: > dprint(silent, 'none') > >+ ####################################################################### >+ # APP UPDATE >+ ####################################################################### >+ try: >+ from univention.appcenter.actions import get_action >+ import univention.appcenter.log as appcenter_log >+ from argparse import Namespace >+ app_upgrade = get_action('upgrade') >+ if app_upgrade is None: >+ raise ImportError() >+ except ImportError: >+ # the new univention.appcenter package is not installed. nevermind >+ # cannot be a dependency as the app center depends on updater... >+ pass >+ else: >+ # check if component updates are available >+ dprint(silent, 'Checking for app updates: ', newline=False) >+ app_upgrade = app_upgrade() >+ appcenter_log.log_to_logfile() >+ appcenter_log._reverse_umc_module_logger() >+ >+ # own logging >+ handler = logging.FileHandler(LOGFN) >+ appcenter_log.get_base_logger().addHandler(handler) >+ logger = logging.getLogger('univention.appcenter.actions.upgrade.readme') >+ handler = logging.StreamHandler(sys.stdout) >+ handler.setLevel(logging.INFO) >+ logger.addHandler(handler) >+ >+ new_apps = list(app_upgrade.iter_upgradable_apps()) >+ update_available = bool(new_apps) >+ >+ if update_available: >+ # updates available ==> stop here in "check-mode" >+ if checkForUpdates: >+ dprint(silent, 'found') >+ return True >+ >+ dprint(silent, 'found\n') >+ dprint(silent, 'The following apps can be updated:\n') >+ for app in new_apps: >+ dprint(silent, '%(name)s: Version %(old)s can be updated to %(new)s' % {'name': app.name, 'old': app.version, 'new': app.candidate.version}) >+ dprint(silent, 'Starting univention-app update at %s...' % (time.ctime()), debug=True) >+ dprint(silent, '\nStarting app update', newline=False) >+ success = True >+ for app in new_apps: >+ if interactive: >+ run_app = readcontinue('\nDo you want to update %s [Y|n]?' % app.name) >+ if run_app: >+ time.sleep(1) >+ >+ success = app_upgrade.call(app=app, noninteractive=not interactive) and success >+ >+ if not success: >+ dprint(silent, 'ERROR: app upgrade failed. Please check /var/log/univention/updater.log\n') >+ sys.exit(1) >+ dprint(silent, 'univention-app upgrade finished at %s...' % (time.ctime()), debug=True) >+ dprint(silent, 'done') >+ time.sleep(1) >+ else: >+ dprint(silent, 'none') >+ > # updates available ==> stop here in "check-mode" > if checkForUpdates: > return False
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 30417
:
6958
| 7022