diff --git a/iocage.8 b/iocage.8 index 4e79799f..440573d6 100644 --- a/iocage.8 +++ b/iocage.8 @@ -1,4 +1,4 @@ -.Dd September 12, 2020 +.Dd February 25, 2021 .Dt IOCAGE 8 .Os .Sh NAME @@ -212,6 +212,9 @@ .\" == UPDATE == .Nm .Cm update +.Op Fl s | -server +.Op Fl NV | -noverify +.Op Fl V | -verify .Ar UUID | NAME .\" == UPGRADE == .Nm @@ -1018,6 +1021,16 @@ Runs .Cm freebsd-update to update the specified jail to the latest patch level. .Pp +Options: +.Bl -tag -width "[-s | --server TEXT]" +.It Op Fl NV | -noverify +Disable verifying the SSL cert for HTTP fetching. +.It Op Fl s | -server Ar TEXT +Define the server from which to fetch the RELEASE. +.It Op Fl V | -verify +Enable verifying the SSL cert for HTTP fetching. +.El +.Pp Example: .Pp .Dl # iocage update examplejail1 diff --git a/iocage_cli/update.py b/iocage_cli/update.py index 6f8093df..5ff89f8a 100644 --- a/iocage_cli/update.py +++ b/iocage_cli/update.py @@ -38,8 +38,16 @@ help='Decide whether or not to update the pkg repositories and ' 'all installed packages in jail( this has no effect for plugins ).' ) +@click.option( + "--server", "-s", default="download.freebsd.org", + help="Server to fetch from." +) +@click.option( + "--verify/--noverify", "-V/-NV", default=True, + help="Enable or disable verifying SSL cert for HTTP fetching." +) @click.argument('jail', required=True) -def cli(jail, pkgs): +def cli(jail, **kwargs): """Update the supplied jail to the latest patchset""" skip_jails = bool(jail != 'ALL') - ioc.IOCage(jail=jail, skip_jails=skip_jails).update(pkgs=pkgs) + ioc.IOCage(jail=jail, skip_jails=skip_jails).update(**kwargs) diff --git a/iocage_lib/iocage.py b/iocage_lib/iocage.py index 6e1fef84..e1a60a11 100644 --- a/iocage_lib/iocage.py +++ b/iocage_lib/iocage.py @@ -1891,7 +1891,7 @@ def update_all(self, pkgs=False): self.jail = jail self.update(pkgs) - def update(self, pkgs=False): + def update(self, pkgs=False, server=None, verify=True): """Updates a jail to the latest patchset.""" if self._all: self.update_all(pkgs) @@ -2014,6 +2014,8 @@ def update(self, pkgs=False): try: ioc_fetch.IOCFetch( release, + server, + verify=verify, callback=self.callback ).fetch_update(*params) finally: