FreeBSD Bugzilla – Attachment 206984 Details for
Bug 240177
sysutils/iocage: Fix `iocage upgrade` (to 11.3-RELEASE and future 12.x releases)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix iocage upgrade - patch
patch-iocage-upgrade.txt (text/plain), 5.52 KB, created by
Michael Gmelin
on 2019-08-28 17:42:51 UTC
(
hide
)
Description:
Fix iocage upgrade - patch
Filename:
MIME Type:
Creator:
Michael Gmelin
Created:
2019-08-28 17:42:51 UTC
Size:
5.52 KB
patch
obsolete
>Index: sysutils/iocage/Makefile >=================================================================== >--- sysutils/iocage/Makefile (revision 509999) >+++ sysutils/iocage/Makefile (working copy) >@@ -2,6 +2,7 @@ > > PORTNAME= iocage > PORTVERSION= 1.1 >+PORTREVISION= 1 > CATEGORIES= sysutils python > PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} > >@@ -22,13 +23,15 @@ > ${PYTHON_PKGNAMEPREFIX}requests>=2.11.1:www/py-requests@${PY_FLAVOR} \ > ${PYTHON_PKGNAMEPREFIX}libzfs>=1.0.2:devel/py-libzfs@${PY_FLAVOR} \ > ${PYTHON_PKGNAMEPREFIX}dulwich>0:devel/dulwich@${PY_FLAVOR} \ >- ${PYTHON_PKGNAMEPREFIX}dnspython>0:dns/py-dnspython@${PY_FLAVOR} >+ ${PYTHON_PKGNAMEPREFIX}dnspython>0:dns/py-dnspython@${PY_FLAVOR} \ >+ merge:devel/rcs57 > >-NO_ARCH= yes > USES= python:3.6+ > USE_GITHUB= yes > USE_PYTHON= autoplist distutils > >+NO_ARCH= yes >+ > CONFLICTS= py27-iocage-[0-9]* > > .include <bsd.port.mk> >Index: sysutils/iocage/files/patch-iocage_lib-ioc_upgrade.py >=================================================================== >--- sysutils/iocage/files/patch-iocage_lib-ioc_upgrade.py (nonexistent) >+++ sysutils/iocage/files/patch-iocage_lib-ioc_upgrade.py (working copy) >@@ -0,0 +1,100 @@ >+--- iocage_lib/ioc_upgrade.py.orig 2019-01-25 21:32:55 UTC >++++ iocage_lib/ioc_upgrade.py >+@@ -24,6 +24,7 @@ >+ """iocage upgrade module""" >+ import datetime >+ import fileinput >++import hashlib >+ import os >+ import pathlib >+ import subprocess as su >+@@ -80,8 +81,11 @@ class IOCUpgrade(iocage_lib.ioc_json.IOC >+ } >+ >+ self.callback = callback >+- # Work around for https://github.com/freebsd/freebsd/commit/bffa924f >+- os.environ['UNAME_r'] = self.jail_release >++ >++ # symbolic link created on fetch by freebsd-update >++ bd_hash = hashlib.sha256((self.path + '\n').encode('utf-8')).hexdigest() >++ self.freebsd_install_link = os.path.join(self.path, >++ 'var/db/freebsd-update', bd_hash + '-install') >+ >+ def upgrade_jail(self): >+ tmp_dataset = self.zfs_get_dataset_name('/tmp') >+@@ -142,44 +146,26 @@ class IOCUpgrade(iocage_lib.ioc_json.IOC >+ callback=self.callback >+ ) >+ else: >+- try: >+- iocage_lib.ioc_exec.InteractiveExec( >+- fetch_cmd, >+- self.path.replace('/root', ''), >+- uuid=self.uuid, >+- unjailed=True >+- ) >+- except iocage_lib.ioc_exceptions.CommandFailed: >+- self.__rollback_jail__() >+- msg = f'Upgrade failed! Rolling back jail' >++ iocage_lib.ioc_exec.InteractiveExec( >++ fetch_cmd, >++ self.path.replace('/root', ''), >++ uuid=self.uuid, >++ unjailed=True >++ ) >++ >++ if not os.path.islink(self.freebsd_install_link): >++ msg = f'Upgrade failed, nothing to install after fetch!' >+ iocage_lib.ioc_common.logit( >+ { >+- "level": "EXCEPTION", >+- "message": msg >++ 'level': 'EXCEPTION', >++ 'message': msg >+ }, >+ _callback=self.callback, >+ silent=self.silent >+ ) >+ >+- if not self.interactive: >+- while not self.__upgrade_install__(tmp.name): >+- pass >+- else: >+- # FreeBSD update loops 3 times >+- for _ in range(3): >+- try: >+- self.__upgrade_install__(tmp.name) >+- except iocage_lib.ioc_exceptions.CommandFailed: >+- self.__rollback_jail__() >+- msg = f'Upgrade failed! Rolling back jail' >+- iocage_lib.ioc_common.logit( >+- { >+- 'level': 'EXCEPTION', >+- 'message': msg >+- }, >+- _callback=self.callback, >+- silent=self.silent >+- ) >++ while os.path.islink(self.freebsd_install_link): >++ self.__upgrade_install__(tmp.name) >+ >+ new_release = iocage_lib.ioc_common.get_jail_freebsd_version( >+ self.path, >+@@ -353,16 +339,10 @@ class IOCUpgrade(iocage_lib.ioc_json.IOC >+ unjailed=True, >+ callback=self.callback, >+ ) as _exec: >+- update_output = iocage_lib.ioc_common.consume_and_log( >++ iocage_lib.ioc_common.consume_and_log( >+ _exec, >+ callback=self.callback >+ ) >+- >+- for i in update_output: >+- if i == 'No updates are available to install.': >+- return True >+- >+- return False >+ else: >+ iocage_lib.ioc_exec.InteractiveExec( >+ install_cmd, > >Property changes on: sysutils/iocage/files/patch-iocage_lib-ioc_upgrade.py >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:keywords >## -0,0 +1 ## >+FreeBSD=%H >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property
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 240177
:
206984
|
207014