summaryrefslogtreecommitdiffstats
path: root/usr.bin
Commit message (Collapse)AuthorAgeFilesLines
* Fix the code to conform to the "or more" part of the following POSIXdds2008-11-111-1/+1
| | | | | | | | | | specification and regression test regress:25. "A function can be preceded by one or more '!' characters, in which case the function shall be applied if the addresses do not select the pattern space." MFC after: 2 weeks
* Include more detailed explanation of this case, since it's prettykientzle2008-11-101-5/+34
| | | | | | | | | | | | | | | subtle why it comes out the way it does. Once you realize that it depends on the archiving order, it's also important to realize that filesystem differences aren't going to break this case. (Some of the other tests have had to be extensively rewritten to make them independent of the order in which a particular filesystem returns file entries.) (This commit also serves to note the PR number that I accidentally omitted from the previous commit.) PR: bin/128562 MFC after: 30 days
* Test --strip-components and fix it to actually work. Jaakko did akientzle2008-11-103-16/+116
| | | | | | | | | | | | | | | good job writing this test; it exercises a lot of subtle cases. The trickiest one is that a hardlink to something that didn't get extracted should not itself be extracted. In some sense, this is not the desired behavior (we'd rather restore the file), but it's the best you can do in a single-pass restore of a tar archive. The test here should be extended to exercise cpio and newc formats as well, since their hardlink models are different, which will lead to different handling of some of these edge cases. Submitted by: Jaakko Heinonen MFC after: 30 days
* Add workaround for a back reference when no correspondinghrs2008-11-091-0/+8
| | | | | | | | | | | parenthesized subexpression is defined. For example, the following command line caused unexpected behavior like segmentation fault: % echo test | sed -e 's/test/\1/' PR: bin/126682 MFC after: 1 week
* New command-line parser for bsdtar.kientzle2008-11-086-356/+455
| | | | | | | | | | This replaces the getopt()/getopt_long() wrapper, the old-style argument rewriter and the associated configuration glue with a more straightforward custom command parser. In particular, this ensures that bsdtar will have consistent option parsing on every platform, regardless of whether the platform supports getopt_long(). MFC after: 30 days
* Restore (intmax_t) casts I lost during the last change & unbreak the build.mlaier2008-11-061-4/+6
|
* Add two new options to du(1):mlaier2008-11-062-35/+85
| | | | | | | | | | | | | | | | | | | | | | -A Display the apparent size instead of the disk usage. This can be helpful when operating on compressed volumes or sparse files. -B blocksize Calculate block counts in blocksize byte blocks. This is differ- ent from the -k, -m options or setting BLOCKSIZE and gives an estimate of how much space the examined file hierachy would require on a filesystem with the given blocksize. Unless in -A mode, blocksize is rounded up to the next multiple of 512. The former is similar to GNU's du(1) --apparent-size. The latter is different from what GNU's du(1) -B does, which is equivalent to setting BLOCKSIZE in our implementation and is rather pointless as it doesn't add any real value (i.e. you can achieve the same with a simple awk-script). No change in the normal output or processing. Reviewed by: keramida@, Peter French Otherwise silience from: freebsd-hackers@
* Merge latest DTrace changes from Perforce.rodrigc2008-11-051-0/+1
| | | | Approved by: jb
* When comparing, cast to the larger size, off_t in this case.kientzle2008-11-051-1/+1
| | | | | | | Once we know which one is smaller, then we cast to the smaller size. Thanks to Xin Li (delphij@) Pointy hat: /me
* Fix compile warnings building on amd64. This is modified slightlykientzle2008-11-051-4/+5
| | | | | | | | | | from Jaakko's original patch: I have misgivings about the portability of the 'z' printf modifier so opted to cast the arguments to (int) instead. PR: bin/128561 Submitted by: Jaakko Heinonen MFC after: 30 days
* Declare functions and variables static and save a few byte. This is amlaier2008-11-041-9/+9
| | | | style(9)-change, too. Separate commit as it changes the object.
* style(9): mostly avoiding line wrap by not indenting cases. No obj change.mlaier2008-11-041-114/+121
|
* Fix comment typo that managed to sneak in when I copy pasted somekeramida2008-11-041-1/+1
| | | | comments & code from iostat.
* Repeat vmstat header after window.rows instead of a hardcoded 20.keramida2008-11-041-9/+69
| | | | | | | | | | | | Use ioctl() to get the window size in vmstat(8), and force a new header to be prepended to the output every time the current window size changes. Change the number of lines before each header to the current lines of the terminal when the terminal is resized, so that the full terminal length can be used for output lines. Inspired by: svn change 175562 (same feature for iostat) Reviewed by: ru (who fixed some of my bugs too) MFC after: 1 week
* Use strlcpy() when we mean it.delphij2008-10-172-6/+3
|
* Free old arrays if we increase them.phk2008-10-161-0/+1
| | | | Pointed out by: mlaier
* Make ministat(1) vastly faster on huge datasets.phk2008-10-162-51/+36
|
* ANSIfy, plus constify interfaces where possible.delphij2008-10-134-115/+50
|
* Use strlcpy() instead of strncpy() when we want the string to bedelphij2008-10-131-3/+2
| | | | NUL-terminated.
* Make the CPU column in top always be 2 characters and print in decimaljhb2008-10-011-3/+3
| | | | | | rather than hex. Requested by: rwatson
* Since in some cases (when found obsolete) 'make' can be builded earlierache2008-09-291-1/+6
| | | | | at 'upgrade_checks' target, put arc4random_uniform() into __FreeBSD_version ifdef.
* Support for CPU sets is going to appear in 7.1 before 8.0.jhb2008-09-291-1/+1
| | | | MFC after: 3 days
* Add back ar(1) which was accidentally decoupled in r183242.marius2008-09-241-0/+1
| | | | Approved by: sam
* add new build knobs and jigger some existing controls to improvesam2008-09-214-32/+95
| | | | | | | | control over the result of buildworld and installworld; this especially helps packaging systems such as nanobsd Reviewed by: various (posted to arch) MFC after: 1 month
* Fix build.kaiw2008-09-211-0/+2
|
* Add support for option "-M", which is used to operate ar(1) in akaiw2008-09-206-47/+864
| | | | | | | | | | | | | | | script mode like the MRI(Microtec Research Inc.) "librarian" program. Originally this option is provided by Binutils ar(1) to ease the transition for developers who are used to writing "librarian" scripts. We added this option to BSD ar(1) because: 1. Further improve the compatibility with Binutils ar(1). 2. There are still a few software using this -M option. (at least one in our ports collection) Suggested by: rink & erwin
* Clean up flags support just a tad: FreeBSD support depends onkientzle2008-09-142-28/+30
| | | | | | | HAVE_STRUCT_STAT_ST_FLAGS, Linux support depends on the existence of the appropriate ioctl() options. In particular, this should fix some nagging compile errors on Linux platforms that don't have e2fsprogs-devel installed.
* Test handling of restores relative to symlinks.kientzle2008-09-142-0/+173
| | | | | | | In particular: * tar -x -P follows symlinks to existing dirs, but not without -P * symlinks to files are always replaced * broken symlinks are always replaced
* Display the sum of the runtime of all the threads in a process when it'ssepotvin2008-09-121-0/+1
| | | | | | | | multithreaded instead of picking the time of the first thread found. Reviewed by: jhb Approved by: kan (mentor) MFC after: 1 month
* Don't destroy the archive until after you finish pulling usefulkientzle2008-09-041-1/+1
| | | | information out of it. As reported by Giorgos Keramidas.
* Add support for RLIMIT_NPTS to limits(1).ed2008-09-022-54/+68
| | | | | | | | | | | | | After the MPSAFE TTY import we support an additional rlimit, called RLIMIT_NPTS. This limit allows you to cap the amount of pseudo-terminals allocated by one user. We forgot to add support for this limit to limits(1), which means it crashed. Add the proper bits to make it work like it should. Unfortunately not all shells actually implement the RLIMIT, so unfortunately I suspect it to be broken with certain shells. Submitted by: Yuriy Tsibizov <yuriy tsibizov gfk ru>
* Add gprof MIPS MD header and enable building gprof.obrien2008-09-022-2/+46
| | | | Obtained from: Juniper Networks
* Use RUSAGE_SELF for the current process instead of hardcoded valuekevlo2008-09-021-1/+1
|
* Truss and gprof doesn't build for MIPS.obrien2008-09-011-1/+3
|
* Correct a silly typo I introduced: withing -> within.yar2008-09-011-1/+1
| | | | Noticed by: das
* Minimize changes CURRENT<->releng7.obrien2008-09-014-9/+8
|
* pkill(1) first appeared in /usr/bin, but later it was moved to /binyar2008-08-314-1064/+0
| | | | | | | for the convenience of rc.d. Now it has happily lived there for quite a while. So move the pkill(1) source files from usr.bin to bin, too. Approved by: gad
* Add ECN stats.rpaulo2008-08-261-0/+5
|
* MfP4: Verify correct interaction with umask: Add anotherkientzle2008-08-251-6/+27
| | | | | | | file with different permissions and set a non-zero umask during the actual copy tests. The extra entry increases the size of the test archives of course, so adjust the expected sizes.
* Explicitly tell that one needs to start a context address with ayar2008-08-241-4/+11
| | | | | | | | | | | | | backslash if he/she wants to use a non-traditional delimiter, i.e., anything other than a slash. That is, /abc/ works as is, but xabcx needs to be spelled as \xabcx. Add appropriate markup. Bump Dd. Checked with: IEEE Std 1003.1, 2004 Edition MFC after: 3 days
* Update the total archive byte counters when writing entries to disk usingkientzle2008-08-247-13/+19
| | | | | | archive_write_disk. Update cpio to use this to emit block counts in -p mode. Update cpio tests to verify these block counts.
* straighten out the "clean" targetkientzle2008-08-241-6/+2
|
* cpio -v emits a line for every item copied.kientzle2008-08-241-1/+1
|
* Update the passthrough_dotdot test to reproduce akientzle2008-08-241-0/+2
| | | | | | problem reported by Kris Kennaway. PR: bin/124924
* Test for proper handling of "cpio -p .."kientzle2008-08-242-0/+88
| | | | PR: bin/124924
* Test for a bug reported by Bernd Walter: In passthrough mode,kientzle2008-08-243-3/+107
| | | | | | | | | | copying "dir/file" and then copying "dir" results in "File on disk is not older; skipping" for the "dir" because it was implicitly created by "dir/file." Among other sins, this means that "dir" ends up with the wrong permissions and ownership. This is actually a libarchive bug; fix is forthcoming.
* Comment a couple of places where bsdcpio and gcpio 2.9 disagree.kientzle2008-08-223-2/+10
| | | | | | The number of blocks read from ustar archives is just an implementation difference. The failure of bsdcpio to emit a block count to stderr in -p mode is a real bug in bsdcpio.
* The newc-format verification is now a little smarter aboutkientzle2008-08-221-9/+24
| | | | | | following the archive structure. In particular, it no longer crashes if you run it against GNU cpio 2.9 (although it does still complain a lot more than it should).
* Minor cleanup of the -q test: Assert that stdout/stderr are empty for eachkientzle2008-08-221-3/+9
| | | | extraction.
* Don't clean before running tests.kientzle2008-08-221-1/+1
|
OpenPOWER on IntegriCloud