It's been explained a few times that being up-to-date is not an error.
It's a good thing, and no action is neccessary when up-to-date.

Any non-zero value indicates an error, that would include 2.  You are
marking this as an error, when it isn't.

You think this will help your scripting.  Do you not realize the proposed
changes will break someone else's scripting?

Mikolaj Kucharski <miko...@kucharski.name> wrote:

> On Fri, Oct 07, 2022 at 02:39:01PM -0400, Josh Grosse wrote:
> > For ease of running sysupgrade from within a script.
> > 
> 
> > diff --git a/usr.sbin/sysupgrade/sysupgrade.sh 
> > b/usr.sbin/sysupgrade/sysupgrade.sh
> > index d80ff127ffa..ce5800093c9 100644
> > --- a/usr.sbin/sysupgrade/sysupgrade.sh
> > +++ b/usr.sbin/sysupgrade/sysupgrade.sh
> > @@ -153,7 +153,7 @@ rm SHA256.sig
> >  
> >  if cmp -s /var/db/installed.SHA256 SHA256 && ! $FORCE; then
> >     echo "Already on latest snapshot."
> > -   exit 0
> > +   exit 1
> >  fi
> >  
> >  # INSTALL.*, bsd*, *.tgz
> 
> Maybe something like this?
> 
> 
> Index: sysupgrade.8
> ===================================================================
> RCS file: /cvs/src/usr.sbin/sysupgrade/sysupgrade.8,v
> retrieving revision 1.13
> diff -u -p -u -r1.13 sysupgrade.8
> --- sysupgrade.8      8 Jun 2022 09:03:11 -0000       1.13
> +++ sysupgrade.8      10 Oct 2022 06:59:49 -0000
> @@ -89,6 +89,10 @@ mirror top-level URL for fetching an upg
>  .It Pa /home/_sysupgrade
>  Directory the upgrade is downloaded to.
>  .El
> +.Sh EXIT STATUS
> +.Ex -std sysupgrade
> +In particular, 2 indicates upgraded was requested but
> +system is already on the latest snapshot.
>  .Sh SEE ALSO
>  .Xr signify 1 ,
>  .Xr installurl 5 ,
> Index: sysupgrade.sh
> ===================================================================
> RCS file: /cvs/src/usr.sbin/sysupgrade/sysupgrade.sh,v
> retrieving revision 1.48
> diff -u -p -u -r1.48 sysupgrade.sh
> --- sysupgrade.sh     8 Jun 2022 09:03:11 -0000       1.48
> +++ sysupgrade.sh     10 Oct 2022 06:59:49 -0000
> @@ -153,7 +153,7 @@ rm SHA256.sig
>  
>  if cmp -s /var/db/installed.SHA256 SHA256 && ! $FORCE; then
>       echo "Already on latest snapshot."
> -     exit 0
> +     exit 2
>  fi
>  
>  # INSTALL.*, bsd*, *.tgz
> 
> 
> -- 
> Regards,
>  Mikolaj
> 

Reply via email to