Commit graph

116 commits

Author SHA1 Message Date
Elyes Haouas c384235c16 mergemaster: Fix typo
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/882
2024-04-11 11:40:47 -06:00
Warner Losh d0b2dbfa0e Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-08-16 11:55:03 -06:00
Marius Strobl 9ec7a595ed mergemaster(8): Remove support for sparc64 2023-08-06 22:28:46 +02:00
Gordon Bergling 575c1773bf mergemaster(8): Fix a typo in an error message
- s/differnt/different/

MFC after:	3 days
2022-01-26 17:59:49 +01:00
Ceri Davies 64e6e1e463 secure/caroot, certctl: Rename secure/caroot/blacklisted
Old certctl commands still work for compatability, but are deprecated.

Approved by:	secteam (gordon)
Differential Revision: https://reviews.freebsd.org/D30807
2021-06-18 13:38:07 +01:00
Warner Losh 30a56f9ef7 mergemaster: handle symbolic links during update.
/etc/os-release is now a symbolic link to a generated file. Make
mergemaster cope with symbolic links generically. I'm no longer
a big mergemaster user, so this has only been lightly tested
by me, though Kimura-san has ran it through its paces.

Submitted by: Yasushiro KIMURA-san
PR: 242212
MFC After: 2 weeks
2020-11-18 19:22:24 +00:00
Ed Maste f98cf03166 mergemaster: Clarify installed and updated versions
Describe "diff installed new" as "Displaying differences between
installed and new."  Previously mergemaster described them in the
opposite order.

PR:		249214
Reported by:	Yuri Victorovich
MFC after:	2 weeks
2020-10-25 18:06:45 +00:00
Bryan Drewery efdd39d20d Use full path to sysctl(8) since /sbin is not in PATH.
X-MFC-With:	r355379
MFC after:	2 weeks
2019-12-04 04:01:53 +00:00
Bryan Drewery 3701dbc859 Run make in parallel.
This is mostly targetting the 'installconfig' phase of 'distribution'
which does a full tree walk.

MFC after:	 2 weeks
2019-12-04 03:44:50 +00:00
Kyle Evans 0da4b4089c Unbreak etcupdate(8) and mergemaster(8) after r352950
r352950 introduced improper case fall-through for shell scripts. Fix it with
a pipe.

Reported by:	lwhsu, David Wolfskill
2019-10-02 12:46:28 +00:00
Kyle Evans bbb8014f09 [3/3] etcupdate and mergemaster support for certctl
This commit add support for certctl in mergemaster and etcupdate. Both will
either rehash or prompt for rehash as new certificates are
trusted/blacklisted.

This work was done primarily by allanjude@, with minor contributions by
myself.

No objection from:	secteam
Differential Revision:	https://reviews.freebsd.org/D17389
2019-10-02 01:06:37 +00:00
Baptiste Daroussin 45a13fd899 Move back group, master.passwd and shells to etc directory
Use the .PATH mechanism instead so keep installing them from lib/libc/gen

While here revert 347961 and 347893 which are no longer needed

Discussed with:	manu
Tested by:	manu
ok manu@
2019-05-23 18:37:05 +00:00
Brad Davis 11f8f36fb9 Fix mergemaster after r347638 and the master.passwd / group move.
Check the legacy directory and use it instead if present.

Install these first if using beinstall.

UPDATING entry to follow.

Approved by:	allanjude (mentor, in person)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D20279
2019-05-16 21:50:12 +00:00
Warner Losh 9b78aedb69 mergemaster: better defaults for SOURCEDIR
If we can't find a Makefile.inc1 in the specified / default SOURCEDIR, and
there's a Makefile.inc1 in the current directory, offer the user the choice
of using . for SOURCEDIR.

Differential Revsion: https://reviews.freebsd.org/D16709
2018-08-20 19:39:49 +00:00
Alan Somers 47cc9ee1b1 Switch the default pager for most commands to less
Finally, a pager for the nineties.

MFC after:	Never
Relnotes:	Yes
Differential Revision:	https://reviews.freebsd.org/D13465
Poll:		https://reviews.freebsd.org/V7
2018-08-08 19:24:20 +00:00
Bryan Drewery ffe0dde6c6 META_MODE: Don't require filemon(4) for mergemaster(8)/etcupdate(8)
New .meta files will be created without filemon data, but any future build
that wants filemon data will force a rebuild due to the missing data
due to use of bmake's .MAKE.MODE=missing-filemon=yes feature.

Reported by:	np
Sponsored by:	EMC / Isilon Storage Division
MFC after:	3 days
2016-07-12 19:47:01 +00:00
Marcel Moolenaar e7d939bda2 Remove ia64.
This includes:
o   All directories named *ia64*
o   All files named *ia64*
o   All ia64-specific code guarded by __ia64__
o   All ia64-specific makefile logic
o   Mention of ia64 in comments and documentation

This excludes:
o   Everything under contrib/
o   Everything under crypto/
o   sys/xen/interface
o   sys/sys/elf_common.h

Discussed at: BSDcan
2014-07-07 00:27:09 +00:00
Jilles Tjoelker 819b4fd06a mergemaster: Avoid "/var/tmp/temproot disappeared" if there is nothing to
compare.

Because of the change to find in SVN r253886, the entire temproot would be
deleted if it became empty, leading to a confusing message "*** FATAL ERROR:
The temproot directory ${TEMPROOT} has disappeared!"

Note that mergemaster does not do anything useful in this situation anyway
(e.g. put IGNORE_FILES="/etc/group /etc/master.passwd" in
/etc/mergemaster.rc and run mergemaster -p).

As noted in that commit, add -mindepth 1.

PR:		bin/188485
Submitted by:	David Boyd
MFC after:	1 week
2014-04-14 22:01:49 +00:00
John Baldwin 385d6d4738 Generate /var/db/services.db during 'make distribution' so that it is
present during new installs.  Update etcupdate and mergemaster to
ignore the generated file.

Tested by:	gjb (release build)
MFC after:	1 month
2014-01-22 16:59:53 +00:00
Brooks Davis baf4f1f082 Fix mergemaster -U by forcing FreeBSD 9 compatiblity in mtree when mtree is
nmtree.

The mtree output used by mergemaster in this case was clearly not meant for
computer consumption and an approach based on -f <file1> -f <file2> would
probalby be a better idea, but this is a minimal change.

MFC after:	3 days
X-MFC-with:	r258437
2013-11-22 00:06:11 +00:00
Xin LI b10eed4081 Pass -n (do not emit comments) when saving mtree information for future
mergemaster(8) runs.

MFC after:	3 days
Approved by:	re (kib)
2013-09-09 20:36:28 +00:00
Peter Wemm 41b886b61c Don't mess with /etc/localtime if it is a symlink. 2013-05-22 19:00:05 +00:00
Eitan Adler 1bfbcedae9 Permit relative paths with mergemaster -m
Reviewed by:	dim, brooks
MFC after:	3 days
2013-05-10 17:42:13 +00:00
Brooks Davis 20e0cc0abb Use the system MAKEOBJDIRPREFIX when running make targets in
mergemaster.  This allows bootstrap verions of tools to be used.

Add a note to UPDATING about this change.

Discussed with:	jhb
Sponsored by:	DARPA, AFRL
MFC after:	5 days
2013-04-25 21:19:50 +00:00
Eitan Adler a927ac5de0 Remove pointless check for the existence of /usr/bin/less which exists
in all configurations.

Reviewed by:	mjg
Approved by:	cperciva
MFC after:	2 weeks
2012-12-05 13:56:36 +00:00
Eitan Adler c7b686bbb7 Add ability to mergemaster to permit the user to type
the absolute path to PAGER if mergemaster can not find
the one already set.

Reviewed by:	mjg
Approved by:	cperciva
MFC after:	2 weeks
2012-12-05 13:56:32 +00:00
Doug Barton 3aec794146 Remove references to CVS so that people will stop bringing it up
For -p:
	The localtime update should have been excluded in the first place

	The make.conf comparison has been OBE for some time now, and there
	is no src.conf equivalent to share/examples/make.conf, so remove
	the whole thing.

Update copyright
2012-10-05 05:01:42 +00:00
Doug Barton 878c6432be If using DISTDIR we need to be sure to create a ${DESTDIR}/var/db/zoneinfo
PR:		bin/162891
Submitted by:	Helge Oldach <src-mergemaster-nov11@oldach.net>
2011-11-29 08:22:12 +00:00
Doug Barton b90270a146 1. Add a new option, --run-updates, to always or never run the newalises,
pwd_mkdb, etc. updates at the end of the comparison.

2. Add an update to the end to handle /etc/localtime, if it exists.
   If /var/db/zoneinfo exists, automatically update /etc/localtime,
   which should (hopefully) be safe to do. If not, prompt the user
   to run tzsetup.

3. Update run_it_now(), the function that handles input for the updates,
   to make sure that we got a valid answer, and to handle the --run-updates
   option if supplied.
2011-11-02 07:40:23 +00:00
Doug Barton a2ca3bc171 Make clear that the -U option can be dangerous. [1]
In -p mode install the group file with the same permissions as normally
done in etc/Makefile.

Update the copyright.

Requested by:	peter [1]

Approved by:	re (kib)
2011-08-09 07:42:19 +00:00
Doug Barton de2bfae478 Hide the creation and population of the temproot 2010-05-14 19:12:06 +00:00
Norikatsu Shigemura 2db9a1171c Add support run services_mkdb(8).
Approved by:	dougb, imp (mentor)
Reviewed by:	ume
MFC after:	2 weeks
2010-05-04 11:25:04 +00:00
Doug Barton c9bb666937 Make it more clear in the docs that -a is not compatible with -iFU,
and enforce this in the code. Apparently a lot of users mistakenly
combine -a with these flags and are then mystified that no changes
were made.

While I'm here, fix a trailing space in mergemaster.8
2010-03-14 05:22:46 +00:00
Doug Barton a68c7fa928 Make -U once again honor -D after my change to consolidate setting
of MTREEDB with DESTDIR.

PR:		bin/143089
Submitted by:	Anton Yuzhaninov <citrin@citrin.ru>
2010-01-22 17:17:47 +00:00
Doug Barton bc1b4f78f9 Oops, deleted one line too many. Add back the null case for IGNORE_MOTD 2010-01-15 04:09:22 +00:00
Doug Barton 705b2d5389 Now that we've officially arrived at FreeBSD 9, remove the IGNORE_MOTD
compat shim as advertised. This change should not be MFC'ed.
2010-01-15 03:56:48 +00:00
Doug Barton f94a6780d9 Update copyright date
Update delete_temproot() to include the error message if it fails,
and clean up the places where it's called.

If there are no files left in temproot when the comparison is done
delete it without prompting. This should make "automated" runs of
mergemaster without -a a little easier.

Document the new behavior in the man page.
2010-01-08 00:05:10 +00:00
Doug Barton 15768c780a If we are using -p it does not make any sense to even create the
MTREENEW file since it will never be used.
2009-12-31 04:07:13 +00:00
Doug Barton 8d54ee3c0b Add some patches contributed by jhb:
1. Don't prompt the user for "-U but no db" error if we're using -a
2. Add an option to delete stale rc.d files automatically if the user
has DELETE_STALE_RC_FILES in their rc file. Lack of command line option
for this is not an oversight.
3. Add []'s around the terminal $ for the $FreeBSD$ test for -F

For one bug raised by jhb I did a more thorough solution:
There were a lot of things that "snuck in" between the end of the test
for -r and the start of the comparison. One of them is the creation of
the mtree db, as pointed out by jhb. Fix this problem more thoroughly
by moving the end of the test down to where it should/used to be, right
before the comparison. As a result, indent the interloping code to match.
2009-12-30 23:14:03 +00:00
Doug Barton d90331f910 Fix a problem with how mergemaster handles the hard links for /.cshrc
and /.profile. The problem is that install(1) will unlink the old file
before it installs the new one, which means that in the best case we
have to compare the changes for the old file twice.

So, change the logic to first test to see if the link exists, then
install the file. Then if the link was there and we're using -i, just
create the link in /root and be done with it. Otherwise display the
message to the user and give them the option.

Because we are now sorting things before doing the comparison we can
know conclusively that the files in / should be the sources, and the
files in /root will be the targets, so adjust the paths accordingly.

While I'm here, split a too-long error message into two lines and
just return at the end of handling these files instead of setting
the variable that says "do nothing" and then returning at the end
of the function anyway.
2009-12-19 05:20:26 +00:00
Doug Barton 98e47f9dfe Fix an indentation issue, no functional changes 2009-12-19 01:32:34 +00:00
Doug Barton bdeda2817b In the places where find is used that the user may see the results,
first pipe it to sort so that order of processing will be deterministic
and like things will be grouped together.
2009-12-19 01:30:45 +00:00
Doug Barton 1b2aeedc64 Over time things that used to be files/directories/links can change
to something else. So add code to detect when things don't match and
give the user choices about how to fix it.

If we're using -P and something in the above check needs to be moved
we need to have the directory there for it, so create it at the
beginning and delete empty versions of it at the end.

The case where something used to be a file or link and now is supposed
to be a directory (e.g., /etc/security) is especially dangerous, so
make failure to install a necessary directory in $DESTDIR a fatal error.
2009-12-12 02:19:41 +00:00
Doug Barton 044823bee6 Simplify handling of MTREEFILE relative to DESTDIR
Make the message about a missing MTREEFILE combined with -U
more informative
2009-12-11 23:03:35 +00:00
Doug Barton 119d24adab 1. Update the message that prints out for -U when the mtree database does
not exist to let the user know that it will be created for the next run.

2. Delete more stuff we're not going to use from the temproot prior to
creating the mtree database to dramatically reduce its size (162K -> 37K).

3. We've been deleting the zero-size files from temproot for a long time
now, so remove the spurious "-size +0" from the find command in the
comparison loop, and remove what is now a really stale comment.
2009-06-09 20:20:08 +00:00
Doug Barton 1b855ebe6c Enhance the safety of the -U option:
1. In several places make sure that the mtree database is not empty using
the -s argument to test instead of -f. (I thought I'd already changed this,
but obviously not.)
2. When deriving the list of changed files use a colon-delimited list.
3. If the list of changed files is empty, unset the variable, and test
for a non-empty CHANGED in diff_loop() before entering that routine.

Enhance the speed of the -U option by using an internal case statement
instead of echoing the variable to an external grep for every file.

Fix indentation on one line.
2009-05-16 22:22:31 +00:00
Doug Barton 7d7a10d261 Add -L to the mtree invocation to chase symbolic links that are present
in "Service jails."

Submitted by:	Jeremie Le Hen <jeremie@le-hen.org>
2009-05-16 21:32:09 +00:00
Doug Barton 86780e2538 Don't tempt svn to expand the example $FreeBSD strings 2009-03-23 14:42:41 +00:00
Doug Barton eeba625052 Add a new -F option to automatically install files that differ
only by version control Id strings
2009-03-18 21:51:11 +00:00
Doug Barton e81879a123 1. Clean up usage() output a bit by grouping options that take an argument
2. Fix a comment to refer to the right loop
2009-03-13 08:48:33 +00:00