Page MenuHomeFreeBSD

freebsd-update: Print download progress in more terse way.
Needs ReviewPublic

Authored by otis on Apr 22 2023, 5:33 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 8, 9:40 AM
Unknown Object (File)
Dec 23 2023, 12:33 AM
Unknown Object (File)
Dec 11 2023, 1:22 AM
Unknown Object (File)
Nov 12 2023, 1:25 PM
Unknown Object (File)
Nov 10 2023, 1:31 PM
Unknown Object (File)
Nov 8 2023, 1:28 PM
Unknown Object (File)
Oct 9 2023, 2:23 PM
Unknown Object (File)
Oct 9 2023, 2:23 PM
Subscribers

Details

Reviewers
cperciva
emaste
Summary

Previously, freebsd-update printed a dot for every 2 files downloaded
and a number for every 10 files.

Change this to print M/N (M from N).

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 53655
Build 50546: arc lint + arc unit

Event Timeline

otis requested review of this revision.Apr 22 2023, 5:33 PM

Spotted something unrelated to his patch, just wanted to mention it.

usr.sbin/freebsd-update/freebsd-update.sh
1448–1449

Totally unrelated to his change, but: wc(1) takes a file as an argument, so it could just be

wc -l patchlist ...
1988–1989

Same as above, something for a separate patch.

usr.sbin/freebsd-update/freebsd-update.sh
1448–1449

Different output:

$ wc -l < /COPYRIGHT 
     125
$ wc -l /COPYRIGHT 
     125 /COPYRIGHT
usr.sbin/freebsd-update/freebsd-update.sh
1448–1449

Oh, you're right. Subtle, but important difference. Sorry for the noise.

Output isn't quite right

Fetching files from 13.2-RELEASE for merging... done.
Preparing to download files... done.
Fetching 10732 patches... done./10732
Applying patches... done.
Fetching 1320 files... done.1320
Extracting patches and verifying checksums... done.
Attempting to automatically merge changes in files... done.

Print final message properly.

otis marked 4 inline comments as done.Sep 20 2023, 4:26 PM

It seems we have quite a delay after "Preparing to download files..." (independent of this change, I believe), but the "Fetching..." output looks good

Fetching metadata signature for 14.0-BETA2 from update2.freebsd.org... done.
Fetching metadata index... done.
Fetching 1 metadata patches... done.
Applying metadata patches... done.
Fetching 1 metadata files... done.
Inspecting system... done.
Fetching files from 13.2-RELEASE for merging... done.
Preparing to download files... 
load: 1.05  cmd: sha256 7348 [runnable] 0.00r 0.00u 0.00s 0% 2204k
mi_switch+0xc2 intr_event_handle+0x167 intr_execute_handlers+0x4b Xapic_isr1+0xdc 
load: 1.09  cmd: gzip 92095 [runnable] 0.00r 0.00u 0.00s 10% 3344k
mi_switch+0xc2 intr_event_handle+0x167 intr_execute_handlers+0x4b Xapic_isr1+0xdc vm_fault+0x92b vm_fault_trap+0x6d trap_pfault+0x1f3 trap+0x440 calltrap+0x8 
done.
Fetching 10732 patches... 310/10732

It seems we have quite a delay after "Preparing to download files..." (independent of this change, I believe), but the "Fetching..." output looks good

Fetching metadata signature for 14.0-BETA2 from update2.freebsd.org... done.
Fetching metadata index... done.
Fetching 1 metadata patches... done.
Applying metadata patches... done.
Fetching 1 metadata files... done.
Inspecting system... done.
Fetching files from 13.2-RELEASE for merging... done.
Preparing to download files... 
load: 1.05  cmd: sha256 7348 [runnable] 0.00r 0.00u 0.00s 0% 2204k
mi_switch+0xc2 intr_event_handle+0x167 intr_execute_handlers+0x4b Xapic_isr1+0xdc 
load: 1.09  cmd: gzip 92095 [runnable] 0.00r 0.00u 0.00s 10% 3344k
mi_switch+0xc2 intr_event_handle+0x167 intr_execute_handlers+0x4b Xapic_isr1+0xdc vm_fault+0x92b vm_fault_trap+0x6d trap_pfault+0x1f3 trap+0x440 calltrap+0x8 
done.
Fetching 10732 patches... 310/10732

I've just used unmodified freebsd-update to upgrade from 13.2-RELEASE-p1 to 13.2-RELEASE-p3 and there was a quite significant delay between Preparing to download files... and corresponding done.