Support -? to show help.
Implemented using getopts "leading colon optstring" feature.
Improve error messages for unknown options and missing arguments.
Show options alphabetically.
Use UPPER_CASE instead of lowercase as the convention for argument names.
Provide per-OPERATION argument usage.
Implement options alphabetically.
Validate the operation and items before extracting any etc.tgz,
so that help or errors are displayed quicker, for a better user
experience.
Style:
- Rename todo to ITEMS.
- Order processing of list after check.
- Ensure DIFF_OPT is initialised, for consistency.
When invoked as "help" or "usage", send the usage to stdout
instead of stderr, so that it's easier to pipe to a pager.
Explicitly warn that the operation is missing.
Tweak the usage; "operation" instead of "op", no need for [] around ...
Fix the x11 check if /usr/X11R6/lib/X11/* needs to migrate to /etc/X11/*
by ensuring that the former actually is detected.
Avoids false migration errors for paths such as /fs if /usr/X11R6
doesn't exist, such as:
x11 check:
Migrate /fs to /etc/X11/fs
The original implemention handled this correctly, but the bug
crept in postinstall 1.110 on 2010/11/21.
Consistency and quality of life improvements to postinstall:
Order all of the items (including disabled) alphabetically.
Consistent comment style before each item block.
Move other functions used by do_*() before rather than after do_*().
- Respect destination directory specified by -d option.
- Accept check and fix options. For the former, do not modify anything as
users normally expect.
Currently there is no info which rc* files should be updated
or not on upgrade (at least rc.conf and rc.local shouldn't),
so put back an explicit list in the postinstall script.
"Go for it" by christos@ in PR/54741.
Should be pulled up to netbsd-9.
spammed with errors for directories without any libraries; the most
common case in the wild would be empty /usr/libdata/debug. Add -d to
ls for good measure while here.