Commit Graph

297 Commits

Author SHA1 Message Date
andvar 5fb5f516a8 fix various typos in comments and log messages. 2022-05-29 10:47:39 +00:00
lukem 3a170d5028 postinstall(8); add -?. expand operation usage 2022-01-08 23:57:32 +00:00
lukem 09a44b8875 postinstall: improve -s usage
Reword -s SRC_ARG to be a bit clearer as to the variations, and sync
more with postinstall(8).
2022-01-08 23:30:41 +00:00
lukem 41e938b0ec postinstall: tweak -a and -m usage 2022-01-08 23:07:17 +00:00
lukem f08fadb8b9 postinstall: add -? to usage 2022-01-08 23:04:11 +00:00
lukem 41d92dcdfa postinstall: add -?. improve option errors
Support -? to show help.
Implemented using getopts "leading colon optstring" feature.
Improve error messages for unknown options and missing arguments.
2022-01-08 06:58:40 +00:00
lukem ae7cd0c965 postinstall: usage improvements
Show options alphabetically.
Use UPPER_CASE instead of lowercase as the convention for argument names.
Provide per-OPERATION argument usage.
Implement options alphabetically.
2022-01-08 06:57:34 +00:00
lukem bbb43df076 postinstall: improve validation and help
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.
2022-01-08 06:56:43 +00:00
lukem b318894e7e postinstall: style tweaks
Fix ... in comments and internal errors.
Sort variables declared at top of main(), for easier review.
2022-01-08 06:55:13 +00:00
lukem f4a06ed268 postinstall: help to stdout. usage tweaks
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 ...
2022-01-08 06:53:58 +00:00
lukem e2ecc8d595 postinstall: fix x11 migration of /usr/X11R6/lib/X11
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.
2022-01-07 01:03:02 +00:00
andvar b53fb80371 s/accidentaly/accidentally/ 2021-08-21 10:06:33 +00:00
andvar 16e91b5f21 s/helt/held+s/eroneously/erroneously/+s/splitted/split/+s/recommented/recommended/ 2021-08-21 09:59:45 +00:00
mlelstv 37d7696158 Don't overwrite changed autofs config files. 2021-06-07 05:29:22 +00:00
lukem 5eb596e7f8 postinstall: re-align list output 2021-04-25 06:21:37 +00:00
lukem 31d619c58b postinstall: sort the items. keep obsolete* last
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_*().
2021-04-25 01:44:55 +00:00
lukem 792fdb70f9 postinstall: comment and usage style
Use NOTE: for comments to be aware of.
Remove double space before "fix|check" in some items.
2021-04-25 01:15:39 +00:00
lukem e314ca6bb1 postinstall: ensure SRC_DIR and DEST_DIR are quoted 2021-04-25 00:36:47 +00:00
lukem 797de592da postinstall: use correct DEST_DIR in obsolete_stand 2021-04-25 00:29:52 +00:00
christos 566d2c2d32 missing quote 2020-08-28 15:26:23 +00:00
christos 608106539e Restrict npf.conf fixes to "blacklistd" -> "blocklistd" 2020-08-28 15:25:16 +00:00
simonb 3616bcfaa5 Sort missing IDs (users and groups) by the numeric ID. 2020-07-07 12:01:21 +00:00
riastradh 65367154cd Nix trailing whitespace. 2020-06-29 23:04:56 +00:00
rin d1e359b744 Fix do_blocklist:
- Respect destination directory specified by -d option.
- Accept check and fix options. For the former, do not modify anything as
  users normally expect.
2020-06-22 06:55:41 +00:00
riastradh dd58a4a54e Nix trailing whitespace. 2020-06-20 18:30:53 +00:00
christos e9d9ed6853 handle /etc/blacklistd.conf 2020-06-15 21:56:49 +00:00
christos 8751c455bb correct blocklist script
- removal of rc file is handled by obsolete
- use grep to find if we need more changes
- fix rc population
2020-06-15 21:51:13 +00:00
christos 8f201cf281 fix reversed mv, pointed out by wiz@ 2020-06-15 14:32:07 +00:00
christos 5b4fdaddb2 deal with blacklist -> blocklist 2020-06-15 14:25:40 +00:00
roy caa3531473 Ensure the dhcpcd log socket is removed. 2020-06-03 11:47:46 +00:00
roy 2fc8fc72fa postinstall: Move files out of dhcpcd chroot 2020-05-31 13:45:47 +00:00
christos ce6ae1732f Add a function to remove the debug bits of the stand files. 2020-05-15 16:33:38 +00:00
roy 3d41695df4 postinstall: ensure contents_owner fix fails on find errors
The issue is that find won't pass anything to xargs and that returns 0.
So replace the usage of xargs with -exec.
2020-04-19 22:10:24 +00:00
roy f1ba7e789f Fix dhcpcd $DEST_DIR support 2020-04-09 15:24:31 +00:00
roy 2fc87b1b6a postinstall: fix contents_owner to return an error on error
find returning nothing via stdout but does return an error is an error.
Fixes the case where dhcpcd chroot db directory isn't owned by _dhcpcd.
2020-04-06 13:10:48 +00:00
roy 134f8ca66a postinstall: add checks for _dhcpcd to do_uid and do_gid
Thanks to jmcneill@
2020-04-02 13:44:46 +00:00
roy 22fcb0ce30 postinstall: move dhcpcd files to the chroot 2020-04-02 13:04:09 +00:00
nakayama eb7c30f064 Fix the fixup script to follow the URL change in /etc/motd (http->https).
PR install/54990, pullup-9
2020-02-25 10:27:01 +00:00
christos 05e238b7cc change the autofs file to be user writable. 2020-01-30 13:54:05 +00:00
christos a0ffe25b1f populate autofs files 2020-01-30 01:39:40 +00:00
tsutsui cbcfce8df3 Make sure rc, rc.subr, and rc.shutdown are properly updated.
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.
2019-12-29 22:19:13 +00:00
christos 007f692c78 PR/54730: Izumi Tsutsui: obsolete etc files are not being cleaned up on
an upgrade build.
2019-12-22 18:41:36 +00:00
christos cbb438eec0 PR/54730: Izumi Tsutsui: Use /var/db/obsolete/<set> to remove obsolete rc.d
files when not in $SOURCEMODE.
2019-12-04 04:45:42 +00:00
christos cfe16cc4b6 remove debugging. 2019-11-12 23:54:34 +00:00
prlw1 5ab431ac15 Add nvmm group. 2019-10-30 20:24:44 +00:00
nakayama 09498a8d06 Add ${DEST_DIR} prefix to check target directory not host directory. 2019-09-24 13:27:39 +00:00
uwe faa52db526 exclude_libs - redirect ls 2> /dev/null so that the user is not
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.
2019-09-12 21:56:55 +00:00
christos 9b7442143c exclude shared libraries that are currently in use from removal. 2019-06-15 13:07:09 +00:00
christos ba1e8750c8 cleanup obsolete file selection from sets and refactor font synchronization.
The font config files are not in sets, so they are still hard-coded.
2019-06-14 14:39:49 +00:00
christos 33abb5d1ba select the powerd scripts from the sets 2019-06-14 14:17:45 +00:00