summaryrefslogtreecommitdiffstats
path: root/bin/mv
Commit message (Collapse)AuthorAgeFilesLines
* MFC r284916: mv: Improve message when moving two or more files tojilles2015-08-221-1/+1
| | | | | | | | | | | non-directory. The message text is from cp, which has had a nicer message for this since 2007 (PR bin/50656). As with cp, the exit status changes from 64 to 1. PR: 201083
* MFC refactoring of the *.test.mk files.jmmv2014-04-141-1/+1
| | | | | | | | | - r263161 Make bsd.test.mk the only public mk fragment for the building of tests. - r263172 Move FreeBSD Test Suite-specific code to a suite.test.mk file. - r263204 Add some documentation for bsd.test.mk. - r263217 Document support for TAP-compliant Perl test programs. This is "make tinderbox" clean.
* Sync sh(1) in stable/10 to head.jmmv2014-03-093-0/+311
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a MFC of all the commits listed below. My original goal of this change was to only merge the move of the tests from tools/regression/bin/ into the new layout (which include tests for sh(1) and other tools as well). However, doing so is tricky due to the ongoing work in sh(1) and, especially, the many changes to its tests since stable/10 was first branched. Merging everything is the simplest way to achieve this goal and, as a bonus point, we get various fixes and miscellaneous improvements into the branch. Per jilles' suggestion, I'm avoiding the merge of a couple of changes (r256850 and r257506) that required depending kernel changes. I'm also avoiding very recent changes that have not had a long enough time to be validated in current. This is "make tinderbox" clean. r256735 sh: Remove one syscall when waiting for a foreground job. r257399 sh: Allow trapping SIGINT/SIGQUIT after ignore because of '&'. r257504 sh: Reorder union node to reduce its size on 64-bit platforms. r257920 sh: Add a test case for would-be assignments that are not due to quoting. r257929 sh: Properly quote alias output from command -v. r258489 sh: Add tests for the </dev/null implicit in a background command. r258533 sh: Add more tests for the </dev/null implicit in a background command. r258535 sh: Make <&0 disable the </dev/null implicit in a background command. r258776 sh: Prefer memcpy() to strcpy() in most cases. Remove the scopy macro. r259047 sh: Split set -x output into a separate function. r259210 Migrate tools/regression/bin/ tests to the new layout. r259844 sh: Remove an unused variable. r259846 sh: Initialize OPTIND=1 even if it came from the environment. r259874 sh: Simplify code related to PPID variable. r259946 sh: Don't check input for non-whitespace if history is disabled. r260246 sh(1): Discourage use of -e. r260506 Run the sh(1) and test(1) tests as unprivileged. r260586 Mark the bin/pax tests as requiring perl. r260634 Use TAP_TESTS_PERL to register the legacy_test in bin/pax. r260635 Replace hand-crafted Kyuafiles with automatic generation. r260654 sh: Remove SIGWINCH handler and just check for resize before every read. r261121 sh: Add test for nested alias. r261125 sh: Solve the alias recursion problem in a less hackish way. r261141 sh: Do not depend on parse/execute split in new alias test. r261160 sh: Add tests for alias names after another alias. r261192 sh: Allow aliases to force alias substitution on the following word. r262533 sh: Make expari() static. r262565 sh: Do not corrupt internal representation if LINENO inner expansion fails. r262697 sh: Simplify expari(). Reviewed by: jilles
* - Make 'flags' argument to chflags(2), fchflags(2) and lchflags(2) of typepjd2013-03-211-1/+1
| | | | | | | | | | | u_long. Before this change it was of type int for syscalls, but prototypes in sys/stat.h and documentation for chflags(2) and fchflags(2) (but not for lchflags(2)) stated that it was u_long. Now some related functions use u_long type for flags (strtofflags(3), fflagstostr(3)). - Make path argument of type 'const char *' for consistency. Discussed on: arch Sponsored by: The FreeBSD Foundation
* Add a few examples.joel2013-03-151-1/+11
| | | | Obtained from: OpenBSD
* Follow the behavior as specified in POSIX:eadler2012-11-151-1/+1
| | | | | | | | | | | | | if (exists AND (NOT f_option) AND ((not_writable AND input_is_terminal) OR i_option)) prompt in particular, add the test for input_is_terminal PR: bin/173039 Submitted by: Mark Johnston <markjdb@gmail.com> Approved by: cperciva MFC after: 3 days
* Add a -h flag similar to the -h flag for ln to force mv(1) to treat ajhb2012-08-312-6/+36
| | | | | | | | | symbolic link to a directory for the target as a symbolic link instead of a directory. This makes it possible to atomically update a symbolic link using rename(). Reviewed by: gj MFC after: 2 weeks
* Put some static keywords in the source code.ed2011-10-311-1/+1
| | | | | | For these simple utilities, it doesn't harm to make all global variables static. In fact, this allows the compiler to perform better forms of optimisation and analysis.
* Don't chop IO into small pieces, follow cp(1) and just use MAXPHYS.ivoras2011-10-031-15/+9
|
* Add NFSv4 ACL support to mv(1).trasz2009-09-041-12/+58
| | | | Reviewed by: rwatson
* Staticify symbols that will not be used in otherdelphij2008-07-191-11/+11
| | | | places.
* - Roll-back attempts to mimic rename(2) atomicity introduced in 1.47,dds2007-12-271-95/+69
| | | | | | | | | | | | | | and follow the letter of the POSIX specification. - Moving a directory to an existing non-empty directory will now fail, as required. - Improve consistency and remove some style bugs of earlier versions. This version passes all tests of tools/regression/bin/mv/regress.sh 1.6 Reviewed by: bde MFC after: 1 month
* Calling any function from vfork other than exec* and _exit yieldsdds2007-12-171-3/+9
| | | | | | undefined behavior. Noted by: alfred
* Eliminate gcc "variable clobbered" warnings by declaring the variablesdds2007-12-161-1/+2
| | | | | | living across the vfork as volatile. Noted by: kan
* When moving a directory across devices to a place where a directorydds2007-12-161-22/+82
| | | | | | | | | | | | | | | | | with the same name exists, delete that directory first, before performing the copy. This ensures that mv(1) across devices follows the semantics of rename(2), as required by POSIX. This change could introduce the potential of data loss, even if the copy fails, violating the atomicity properties of rename(2). This is (mostly) mitigated by first renaming the destination and obliterating it only after a succesfull copy. The above logic also led to the introduction of code that will cleanup the results of a partial copy, if a cross-device copy fails. PR: bin/118367 MFC after: 1 month
* Bump document date on behalf of previous revision.ru2007-11-011-1/+1
|
* Replace a fairly opaque sentence with a much clearer wording from NetBSD.pav2007-05-121-2/+2
| | | | | | PR: docs/101330 (inspired by) Submitted by: Peter Gildea <peter@gildea.com> Obtained from: NetBSD
* Attempt to complete the userspace integration of POSIX.1e extended ACLs.csjp2005-09-051-1/+18
| | | | | | | | | | | | | | This includes adding support for ACLs into cp(1) and mv(1) userspace utilities. For mv(1), if _PC_ACL_EXTENDED is in effect for the source AND destination operands, the destination file's ACLs shall reflect the source. For cp(1), if _PC_ACL_EXTENDED is in effect for both source and destination operands, and -p has been specified, the ACLs from the source shall be preserved on the destination. MFC after: 1 month
* Correct a few places where we called warn() when warnx() should havemux2005-05-191-4/+4
| | | | | | | been used. Submitted by: "Liam J. Foy" <liamfoy@sepulcrum.org> Obtained from: DragonFlyBSD
* Add the new standard EXIT STATUS section where appropriate.ru2005-01-161-5/+5
| | | | Sort standard sections in the (documented) preferred order.
* /*- or .\"- or #- to begin license clauses.imp2005-01-102-1/+2
|
* Remove clause 3 from the UCB licenses.markm2004-04-062-8/+0
| | | | OK'ed by: imp, core
* When symbolic link is pointed onto a mount point, it can't be movedpjd2004-03-211-6/+17
| | | | | | | | | to a different file system. Patch in PR was incorrect. PR: bin/64430 Submitted by: Samuel Tardieu MFC after: 3 days
* Centralize _PATH_* definitions.obrien2003-05-052-39/+0
| | | | Submitted by: Tim Kientzle <kientzle@acm.org> (embellished by me)
* Quiet warnings about copyright[].obrien2003-05-011-2/+2
|
* Grammar fix.keramida2002-08-261-1/+1
| | | | | | PR: docs/42021 Submitted by: Jeff Ito <jeffi@rcn.com> MFC after: 3 days
* s/filesystem/file system/ as discussed on -developerstrhodes2002-08-211-1/+1
|
* mdoc(7) police: tidy up, bump document date on behalf of the -n option.ru2002-08-091-9/+9
|
* Update usage for the addition of -n in rev 1.35 of mv.c.johan2002-07-092-3/+3
| | | | Approved by: obrien, sheldonh (mentor).
* When trying to emulate a cross-device move operation with cp and rm, addtjr2002-06-161-2/+2
| | | | | | | | | a "--" argument after the options so filenames with leading dashes are handled correctly. PR: 39318 Submitted by: Serge van den Boom <svdb@stack.nl> MFC after: 1 week
* Remove local definition of _PATH_CP, and use <paths.h>, _PATH_CP is in thejmallett2002-05-172-1/+1
| | | | CURRENT <paths.h>.
* Consistancy check s/file system/filesystem/trhodes2002-05-161-1/+1
| | | | Reviewed by: brian
* Update SCM ID.obrien2002-03-221-2/+2
|
* Note that -n is non-standard.obrien2002-03-221-1/+3
|
* Add the -n option, which automatically answers "no" to the overwrite question.obrien2002-03-222-6/+27
|
* Warnings fixes.markm2002-02-221-1/+2
|
* Move user_from_uid to pwd.himp2002-02-141-0/+2
| | | | | | | | | | | | | Move group_from_gid to grp.h Remove from stdlib.h Make the prototypes match the code Fix rm and mv to include new files. NetBSD has these defined in those files, and others too that I've not done. Approved by: terminal room kabal Reviewed by: jhb, phk
* missed a few registersimp2002-02-021-3/+3
|
* o __P has been reovedimp2002-02-021-16/+9
| | | | | | | | | o Old-style K&R declarations have been converted to new C89 style o register has been removed o prototype for main() has been removed (gcc3 makes it an error) o int main(int argc, char *argv[]) is the preferred main definition. o Attempt to not break style(9) conformance for declarations more than they already are.
* Default to WARNS=2. Binary builds that cannot handle this must explicitlyobrien2001-12-041-1/+0
| | | | | | set WARNS=0. Reviewed by: mike
* mdoc(7) police: utilize the new .Ex macro.ru2001-08-151-3/+1
|
* Set WARNS=2 on programs which compile cleanly.dd2001-07-151-0/+1
| | | | Submitted by: Mike Barcroft <mike@q9media.com>
* Remove whitespace at EOL.dd2001-07-151-1/+1
|
* Fix the type of the NULL arg to execl()brian2001-07-091-2/+3
| | | | Idea from: Theo de Raadt <deraadt@openbsd.org>
* Use PATH_MAX in preference to MAXPATHLEN.imp2001-05-291-3/+4
|
* Silence WARNS=2 and BDECFLAGS on alpha and i386, except for mode_tkris2001-05-201-7/+8
| | | | | | warnings. MFC after: 1 week
* mdoc(7) police: use the new features of the Nm macro.ru2000-11-201-2/+2
|
* Don't emit a warning message if fchflags() returns EOPNOTSUPPsada2000-07-201-1/+10
| | | | | Requested by: FUJISHIMA Satsuki <k5@cheerful.com> Obtained from: OpenBSD
* To make inherit file flags when mv(1) moves file between directoriessada2000-07-151-0/+2
| | | | | | | | | on different file systems. PR: bin/12375 Submitted by: Takashi SHIRAI <shirai@nintendo.co.jp> No response by: steve No problem with: building 5-current world
* Use lstat(2) instead of stat(2) when deciding if we should fastcopydwmalone2000-07-111-1/+1
| | | | | | | a file. This fixes moving symlinks across partitions. PR: 17847 Reviewed by: bde
OpenPOWER on IntegriCloud