summaryrefslogtreecommitdiffstats
path: root/usr.sbin/mergemaster
Commit message (Collapse)AuthorAgeFilesLines
* MFC r264480: mergemaster: Avoid "/var/tmp/temproot disappeared" if there isjilles2014-06-011-1/+1
| | | | | | | | | | | | | | | | | 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: r258456brooks2013-11-261-1/+7
| | | | | | | | | | | 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 probably be a better idea, but this is a minimal change. Approved by: re (glebius)
* Pass -n (do not emit comments) when saving mtree information for futuredelphij2013-09-091-1/+1
| | | | | | | mergemaster(8) runs. MFC after: 3 days Approved by: re (kib)
* Remove request to email suggestions and fixes to the author.eadler2013-06-241-8/+0
| | | | | | | | He is no longer involved with the FreeBSD project. While here: remove "no known bugs" and related. This isn't present in other manual pages. PR: docs/179914
* Don't mess with /etc/localtime if it is a symlink.peter2013-05-221-1/+1
|
* Permit relative paths with mergemaster -meadler2013-05-101-0/+1
| | | | | Reviewed by: dim, brooks MFC after: 3 days
* Use the system MAKEOBJDIRPREFIX when running make targets inbrooks2013-04-251-4/+3
| | | | | | | | | | 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
* Remove pointless check for the existence of /usr/bin/less which existseadler2012-12-051-13/+1
| | | | | | | | in all configurations. Reviewed by: mjg Approved by: cperciva MFC after: 2 weeks
* Add ability to mergemaster to permit the user to typeeadler2012-12-051-0/+5
| | | | | | | | | the absolute path to PAGER if mergemaster can not find the one already set. Reviewed by: mjg Approved by: cperciva MFC after: 2 weeks
* Remove references to CVS so that people will stop bringing it updougb2012-10-051-31/+37
| | | | | | | | | | | 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
* If using DISTDIR we need to be sure to create a ${DESTDIR}/var/db/zoneinfodougb2011-11-291-2/+2
| | | | | PR: bin/162891 Submitted by: Helge Oldach <src-mergemaster-nov11@oldach.net>
* 1. Add a new option, --run-updates, to always or never run the newalises,dougb2011-11-022-17/+63
| | | | | | | | | | | | | 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.
* Make clear that the -U option can be dangerous. [1]dougb2011-08-092-6/+10
| | | | | | | | | | | 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)
* mdoc: drop redundant .Pp and .LP callsuqs2010-10-081-1/+0
| | | | They have no effect when coming in pairs, or before .Bl/.Bd
* Hide the creation and population of the temprootdougb2010-05-141-5/+5
|
* Add support run services_mkdb(8).nork2010-05-041-0/+14
| | | | | | Approved by: dougb, imp (mentor) Reviewed by: ume MFC after: 2 weeks
* Make it more clear in the docs that -a is not compatible with -iFU,dougb2010-03-142-7/+22
| | | | | | | | 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
* Make -U once again honor -D after my change to consolidate settingdougb2010-01-221-5/+5
| | | | | | | of MTREEDB with DESTDIR. PR: bin/143089 Submitted by: Anton Yuzhaninov <citrin@citrin.ru>
* Use the newly brought %U macro.ru2010-01-151-1/+1
|
* Oops, deleted one line too many. Add back the null case for IGNORE_MOTDdougb2010-01-151-0/+1
|
* Now that we've officially arrived at FreeBSD 9, remove the IGNORE_MOTDdougb2010-01-151-5/+2
| | | | compat shim as advertised. This change should not be MFC'ed.
* Update copyright datedougb2010-01-082-24/+30
| | | | | | | | | | | 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.
* If we are using -p it does not make any sense to even create thedougb2009-12-311-2/+2
| | | | MTREENEW file since it will never be used.
* It's not necessary to include both Op and Fl for command line optionsdougb2009-12-301-9/+11
| | | | | | included in the text, so use only the latter. Clarify that using -U doesn't make sense in combination with -a
* Document the DELETE_STALE_RC_FILES option introduced in r201291. This isdougb2009-12-301-16/+19
| | | | | | | | an "rc file only" option by design. While I'm here, update the comments in the example rc file to indicate which command line options they relate to, and correct the defaults for a couple of options.
* Add some patches contributed by jhb:dougb2009-12-301-23/+34
| | | | | | | | | | | | | | | 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.
* Fix a problem with how mergemaster handles the hard links for /.cshrcdougb2009-12-191-13/+20
| | | | | | | | | | | | | | | | | | | | 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.
* Fix an indentation issue, no functional changesdougb2009-12-191-22/+22
|
* In the places where find is used that the user may see the results,dougb2009-12-191-3/+3
| | | | | first pipe it to sort so that order of processing will be deterministic and like things will be grouped together.
* Over time things that used to be files/directories/links can changedougb2009-12-121-2/+59
| | | | | | | | | | | | | 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.
* Simplify handling of MTREEFILE relative to DESTDIRdougb2009-12-111-7/+8
| | | | | Make the message about a missing MTREEFILE combined with -U more informative
* 1. Update the message that prints out for -U when the mtree database doesdougb2009-06-091-7/+7
| | | | | | | | | | | 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.
* Enhance the safety of the -U option:dougb2009-05-161-9/+13
| | | | | | | | | | | | | | 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.
* Add -L to the mtree invocation to chase symbolic links that are presentdougb2009-05-161-1/+1
| | | | | | in "Service jails." Submitted by: Jeremie Le Hen <jeremie@le-hen.org>
* Don't tempt svn to expand the example $FreeBSD stringsdougb2009-03-232-4/+4
|
* 1. Update for new -F option from r189992.dougb2009-03-181-22/+42
| | | | | | | | | | | 2. Sort the command line options to match how they are displayed in usage() 3. Change references to cvs to the more generic "version control system" and remove the .Xr for cvs 4. Consistently use ".Op Fl" to refer to command line options in the text. 5. Only use the apostrophe to indicate possession. 6. Add FREEBSD_ID (-F) to the list of variables in the example rc, and change the DIFF_OPTIONS example to -Bb since -F now covers it.
* Add a new -F option to automatically install files that differdougb2009-03-181-2/+19
| | | | only by version control Id strings
* 1. Clean up usage() output a bit by grouping options that take an argumentdougb2009-03-131-4/+5
| | | | 2. Fix a comment to refer to the right loop
* When using the -D option:dougb2009-03-131-4/+4
| | | | | | | 1. The new mtree file should be created in the "host" system /tmp 2. The existing mtree file in the "host" system should not be deleted Submitted by: scf
* Instead of using obj and all targets which are not cross-build aware,dougb2009-01-041-3/+4
| | | | | | use _obj and everything which are. Submitted by: ru
* Add a note to the -m option indicating that you should now specify src/dougb2009-01-021-1/+9
| | | | instead of src/etc.
* Simplify the code a little by moving the working part ofdougb2009-01-021-8/+12
| | | | | | | | | ARCHSTRING into the new MM_MAKE variable. We only need to check for the presence of the target of $PAGER if that variable is actually set. [1] Pointed out by: Steve Kargl <sgk@troutmask.apl.washington.edu> [1]
* Only check for 'nodev' in fstab if that file existsdougb2009-01-021-8/+10
| | | | Submitted by: sam
* For IGNORE_FILES delete the version in the TEMPROOT, not the base.dougb2009-01-021-1/+1
| | | | Submitted by: clemens fischer <ino-news@spotteswoode.dnsalias.org>
* General Improvementsdougb2009-01-011-19/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | ==================== 1. List the command line options in a more standard way 2. Improve the explanations of some of the arguments (-A, -D) 3. Add ARCHSTRING and MTREEDB to the example rc file 4. Re-sort some of the examples according to the existing distinction of "has a command line version" vs. "does not have a command line version" Document changes for r186678 =========================== 1. /usr/src/etc -> /usr/src where needed [1] 2. Add IGNORE_FILES to the example rc [2] (and remove IGNORE_MOTD) 3. Update the EXIT STATUS section for [3] and [4] Update Copyright and .Dd accordingly PR: bin/96528 [1] Submitted by: ru [1] PR: bin/106642 [2] Submitted by: Henrik Brix Andersen <henrik@brixandersen.dk> PR: bin/122282 [3] Submitted by: Eygene Ryabinkin <rea-fbsd@codelabs.ru> [3] PR: bin/108183 [4] Submitted by: Riccardo Torrini <riccardo@torrini.org> [4]
* Maintenance and updatesdougb2009-01-011-50/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ======================= 1. Various improvements to the mtree (-U) feature: a. Seperate the notion of directory and file (user can override db path) b. Only check for the existence of the mtree file if -U is set c. Use mktemp to create the new version of the file d. More safely install the new file e. Standardize error messages a bit 2. Remove the last of the MAKEDEV stuff (RIP) New Features ============ 1. Switch to using the top level (e.g., /usr/src) Makefile, and specify that we should use the *.mk files from the source directory instead of the installed versions. [1][2] This allows easier cross builds and simplifies (or in some cases permits) upgrading. 2. Check for the deprecated 'nodev' option in /etc/fstab [3] 3. Add support for the IGNORE_FILES variable [4] and deprecate IGNORE_MOTD accordingly. 4. Before installing a file check to make sure that the target does not already exist as a directory [5] 5. Check to be sure that the file installed and error out if not PR: bin/96528 [1] Submitted by: ru [1] PR: bin/129639 [2] Submitted by: sam [2] PR: bin/122282 [3] Submitted by: Eygene Ryabinkin <rea-fbsd@codelabs.ru> [3] PR: bin/106642 [4] Submitted by: Henrik Brix Andersen <henrik@brixandersen.dk> [4] PR: bin/108183 [5] Submitted by: Riccardo Torrini <riccardo@torrini.org> [5]
* Revert 184781, 184804, and 184832 (automatic installation of filesdougb2009-01-011-19/+0
| | | | | | | | | | | | | | | that differ only by VCS Id) for the following reasons: 1. It was added without my consent, review, or even a heads up 2. It is something that I've repeatedly said I do not want, and certainly do not want as the default 3. It is poorly implemented (much too complex, produces false positives e.g., /etc/mail/helpfile) Given that this is a situation that comes up very infrequently (usually only for a major version upgrade) and can usually be handled simply enough on a one-off basis, I will once again point out that I think this is a Bad Idea. I would be willing to consider a better implementation as an option that is off by default.
* No need to run rm ${COMPFILE} after mm_install() - mm_install()sobomax2008-11-111-1/+0
| | | | does it for us.
* Improve on 184781 - instead of ignoring the file when the only differencesobomax2008-11-091-2/+8
| | | | | is CVS Id, replace the old one with the new one automatically. While I don't see much difference, some people think it's somehow better that way.
* Ignore files that only differ in CVS Id tag.sobomax2008-11-091-0/+14
| | | | MFC after: 2 weeks
OpenPOWER on IntegriCloud