Page MenuHomeFreeBSD

freebsd-update: open $PAGER only if necessary
ClosedPublic

Authored by aryeeteygerald_rogers.com on Jan 21 2019, 5:55 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jul 4, 11:36 PM
Unknown Object (File)
Fri, Jul 3, 5:25 AM
Unknown Object (File)
Thu, Jul 2, 2:39 PM
Unknown Object (File)
Tue, Jun 30, 6:02 PM
Unknown Object (File)
Tue, Jun 30, 5:35 PM
Unknown Object (File)
Jun 15 2026, 12:44 AM
Unknown Object (File)
Jun 4 2026, 5:50 AM
Unknown Object (File)
May 26 2026, 8:19 AM

Details

Reviewers
emaste
delphij
Summary

Previously, the $PAGER was opened even with no contents.
Applies patch to no longer do this.

PR: 194547,208497

Test Plan

Verified expected behaviour in interactive sh shell

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 22067
Build 21295: arc lint + arc unit

Event Timeline

delphij requested changes to this revision.Jan 22 2019, 5:26 AM

I like this change in principle, but I think you could simplify the code a little bit (see my comments in line).

usr.sbin/freebsd-update/freebsd-update.sh
1953

Could you please refactor this to something like:

cat - modifiedfiles <<- EOF | ${PAGER}

The following files are affected by updates,
but no changes have
...
EOF

instead?

This revision now requires changes to proceed.Jan 22 2019, 5:26 AM
  • Use HEREDOC/cat instead of multiple echos

This is indeed much nicer.

One last change request -- could you please use ${PAGER} instead of $PAGER while there? The change looks otherwise fine to me.

This revision is now accepted and ready to land.Jan 24 2019, 5:51 AM

Forgot the review link; committed in rS343407