From owner-svn-src-all@freebsd.org Wed Sep 25 01:23:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0EDE0F77E6; Wed, 25 Sep 2019 01:23:53 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46dL1N3TKyz4Fkx; Wed, 25 Sep 2019 01:23:52 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mail-pl1-x635.google.com with SMTP id y10so1705770plp.2; Tue, 24 Sep 2019 18:23:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:reply-to:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=LhezTJFYNPsCwdZt7JSATbNGtZ4OPo6LPjsbthJGrlw=; b=KBwRgj+0NhXGsJ9xIlg7TZV7Ng/bQCk/4NoTzHXYJ4x2E/jzS0w5/DHqZ22LGFsBNi pSm4sDGGVYHedFXc0IsCZvS9N9iVd1fabOQEwiuNmt2Q1pkvrr/zz/YzjvUHm3zzkVmz fwQh6u4ZQr1zzSpF881OKVB32bd54tArkTvNJKHJleLkAqRYMkWh7TPlhIVb88ik4FtQ ZEhx3E9J/E8G481IbqiVz/lMSDjc/qrPHj6/tBpEpjUoWtuGK+YdpuUAuKoY8wQ1mTZb /SiC7lD7QxEZNCZdVlKHk5CpIv+96BtJeVDKXE2hlTBtKYMj8pDGo6b4SYbcOq9BHksV V3/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:reply-to:subject:to:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=LhezTJFYNPsCwdZt7JSATbNGtZ4OPo6LPjsbthJGrlw=; b=bv9QJ45dd4jyO1E0QXU4Ouufm11IJc1o2qvLqtbIKZ8pbM2gbpQc4LvfPextZtHr3p d8MOd2NM0ooET8wWKCVB2Jvm6/yNekUaWbT2te9N0T3517vVuthojCZ89mPAtH9vwMUY I97Tz4R/AlklYmjZ+f/WGRc7gSjA+PLWOew7OhCAmX7wURz6R2PoMZ3SbQS1PzBx/MTj iEg6TQAyhvJmEPuCVB5rQlrvMk9xSjS/wlL+aEARpTsXCKH1TxDwvc+w2+fShqIgtDH0 NnVsV5FpimfSOmI8XikgANGyuALp8ALGtu0jQIHRaAAeTAfzg48aG6+WD5bPcmUMJtOF iPKg== X-Gm-Message-State: APjAAAVwMIlDTPdGYQXYaKbN+e9a3+Lr5MyOyiagK1pVNwwhIcsEeOid avVzBUyJS9WgsThtC7F29T/Ghl0B X-Google-Smtp-Source: APXvYqx//nzM+JNjYOkXIccnmS8cVUfI89xiw1uLAyD/QuaujHulrTAq/hM/QRotlShGLlRTfu+Rjg== X-Received: by 2002:a17:902:322:: with SMTP id 31mr6433422pld.150.1569374630809; Tue, 24 Sep 2019 18:23:50 -0700 (PDT) Received: from ?IPv6:2403:5800:7100:5d01:8879:6a99:8a32:d59f? (2403-5800-7100-5d01-8879-6a99-8a32-d59f.ip6.aussiebb.net. [2403:5800:7100:5d01:8879:6a99:8a32:d59f]) by smtp.gmail.com with ESMTPSA id u9sm388710pfl.138.2019.09.24.18.23.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 24 Sep 2019 18:23:50 -0700 (PDT) Sender: Kubilay Kocak Reply-To: koobs@FreeBSD.org Subject: Re: svn commit: r352662 - head/usr.sbin/freebsd-update To: Michael Gmelin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201909242049.x8OKnXFJ028009@repo.freebsd.org> From: Kubilay Kocak Message-ID: <794f4e65-80c8-46f7-f172-4b89a68891cd@FreeBSD.org> Date: Wed, 25 Sep 2019 11:23:46 +1000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Thunderbird/70.0 MIME-Version: 1.0 In-Reply-To: <201909242049.x8OKnXFJ028009@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46dL1N3TKyz4Fkx X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=KBwRgj+0; dmarc=none; spf=pass (mx1.freebsd.org: domain of koobsfreebsd@gmail.com designates 2607:f8b0:4864:20::635 as permitted sender) smtp.mailfrom=koobsfreebsd@gmail.com X-Spamd-Result: default: False [-4.87 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[koobs@FreeBSD.org]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; FORGED_SENDER(0.30)[koobs@FreeBSD.org,koobsfreebsd@gmail.com]; IP_SCORE(-2.67)[ip: (-8.50), ipnet: 2607:f8b0::/32(-2.63), asn: 15169(-2.19), country: US(-0.05)]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; FROM_NEQ_ENVFROM(0.00)[koobs@FreeBSD.org,koobsfreebsd@gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; TAGGED_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_IN_DNSWL_NONE(0.00)[5.3.6.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Sep 2019 01:23:53 -0000 On 25/09/2019 6:49 am, Michael Gmelin wrote: > Author: grembo (ports committer) > Date: Tue Sep 24 20:49:33 2019 > New Revision: 352662 > URL: https://svnweb.freebsd.org/changeset/base/352662 > > Log: > freebsd-update: Add `updatesready' and `showconfig' commands > > `freebsd-update updatesready' can be used to check if there are any pending > fetched updates that can be installed. > > `freebsd-update showconfig' writes freebsd-update's configuration to > stdout. > > This also changes the exit code of `freebsd-update install' to 2 in case > there are no updates pending to be installed and there wasn't a fetch phase > in the same invocation. This allows scripts to tell apart these error > conditions without breaking existing jail managers. > > See freebsd-update(8) for details. > > PR: 240757, 240177, 229346 > Reviewed by: manpages (bcr), sectam (emaste), yuripv > Differential Revision: https://reviews.freebsd.org/D21473 Would love to see these MFC'd. Consistency between freebsd-update on all our supported versions for one of our major user features would be awesome. > Modified: > head/usr.sbin/freebsd-update/freebsd-update.8 > head/usr.sbin/freebsd-update/freebsd-update.sh > > Modified: head/usr.sbin/freebsd-update/freebsd-update.8 > ============================================================================== > --- head/usr.sbin/freebsd-update/freebsd-update.8 Tue Sep 24 20:36:43 2019 (r352661) > +++ head/usr.sbin/freebsd-update/freebsd-update.8 Tue Sep 24 20:49:33 2019 (r352662) > @@ -25,7 +25,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd June 14, 2017 > +.Dd September 24, 2019 > .Dt FREEBSD-UPDATE 8 > .Os > .Sh NAME > @@ -155,13 +155,24 @@ Note that this command may require up to 500 MB of spa > depending on which components of the > .Fx > base system are installed. > +.It Cm updatesready > +Check if there are fetched updates ready to install. > +Returns exit code 2 if there are no updates to install. > .It Cm install > Install the most recently fetched updates or upgrade. > +Returns exit code 2 if there are no updates to install > +and the > +.Cm fetch > +command wasn't passed as an earlier argument in the same > +invocation. > .It Cm rollback > Uninstall the most recently installed updates. > .It Cm IDS > Compare the system against a "known good" index of the > installed release. > +.It Cm showconfig > +Show configuration options after parsing conffile and command > +line options. > .El > .Sh TIPS > .Bl -bullet > > Modified: head/usr.sbin/freebsd-update/freebsd-update.sh > ============================================================================== > --- head/usr.sbin/freebsd-update/freebsd-update.sh Tue Sep 24 20:36:43 2019 (r352661) > +++ head/usr.sbin/freebsd-update/freebsd-update.sh Tue Sep 24 20:49:33 2019 (r352662) > @@ -62,9 +62,11 @@ Commands: > cron -- Sleep rand(3600) seconds, fetch updates, and send an > email if updates were found > upgrade -- Fetch upgrades to FreeBSD version specified via -r option > + updatesready -- Check if there are fetched updates ready to install > install -- Install downloaded updates or upgrades > rollback -- Uninstall most recently installed updates > IDS -- Compare the system against an index of "known good" files > + showconfig -- Show configuration > EOF > exit 0 > } > @@ -503,7 +505,8 @@ parse_cmdline () { > ;; > > # Commands > - cron | fetch | upgrade | install | rollback | IDS) > + cron | fetch | upgrade | updatesready | install | rollback |\ > + IDS | showconfig) > COMMANDS="${COMMANDS} $1" > ;; > > @@ -827,7 +830,7 @@ install_check_params () { > echo "No updates are available to install." > if [ $ISFETCHED -eq 0 ]; then > echo "Run '$0 fetch' first." > - exit 1 > + exit 2 > fi > exit 0 > fi > @@ -3333,6 +3336,21 @@ cmd_upgrade () { > upgrade_run || exit 1 > } > > +# Check if there are fetched updates ready to install > +cmd_updatesready () { > + # Construct a unique name from ${BASEDIR} > + BDHASH=`echo ${BASEDIR} | sha256 -q` > + > + # Check that we have updates ready to install > + if ! [ -L ${BDHASH}-install ]; then > + echo "No updates are available to install." > + exit 2 > + fi > + > + echo "There are updates available to install." > + echo "Run '$0 install' to proceed." > +} > + > # Install downloaded updates. > cmd_install () { > install_check_params > @@ -3349,6 +3367,13 @@ cmd_rollback () { > cmd_IDS () { > IDS_check_params > IDS_run || exit 1 > +} > + > +# Output configuration. > +cmd_showconfig () { > + for X in ${CONFIGOPTIONS}; do > + echo $X=$(eval echo \$${X}) > + done > } > > #### Entry point > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" >