Commit graph

637 commits

Author SHA1 Message Date
Michael Gehring
401c216e6a uutils: fix hashmap lifetime 2014-07-01 17:04:39 +02:00
Heather
2245339c01 Merge pull request #330 from ebfe/fix-build-master
uutils: work around rustc strangeness
2014-07-01 14:23:47 +04:00
Heather
417f554ff6 Merge pull request #329 from Arcterus/multicall-install
Allow installation of the multicall binary
2014-07-01 14:19:40 +04:00
Michael Gehring
cd6f617bfc uutils: work around rustc strangeness 2014-07-01 11:20:14 +02:00
Arcterus
47896a6a69 Allow installation of the multicall binary 2014-07-01 01:07:16 -07:00
Oly Mi
995d290847 Merge pull request #328 from Arcterus/uutils-autogen
uutils: auto-generate programs to be built
2014-07-01 08:09:21 +04:00
Arcterus
5abb69df0d uutils: auto-generate programs to be built 2014-06-30 20:45:51 -07:00
Oly Mi
774695d697 Merge pull request #326 from Arcterus/id-fix
General fixes
2014-07-01 06:58:18 +04:00
Arcterus
fe1d30a904 Merge pull request #327 from akiradeveloper/feature/fix-typo-tail-readme
tail: fix readme typo
2014-06-30 19:52:42 -07:00
Akira Hayakawa
785d1512ab tail: fix readme typo
Signed-off-by: Akira Hayakawa <ruby.wktk@gmail.com>
2014-07-01 11:26:18 +09:00
Arcterus
141e858407 Modify Makefile to build correctly when using BUILD 2014-06-30 17:41:15 -07:00
Arcterus
ab08e623ef id: fix build 2014-06-30 17:28:02 -07:00
Arcterus
cfb65d3f09 Merge pull request #322 from ebfe/fix-build-master
Remove use of raw bare pointers (*T -> *const T)
2014-06-30 17:23:09 -07:00
Michael Gehring
22743f04ae Remove use of raw bare pointers (*T -> *const T) 2014-07-01 02:17:35 +02:00
Arcterus
e5066d1978 Merge pull request #325 from kwantam/master
fmt: update use of *T to *const T
2014-06-30 16:30:19 -07:00
kwantam
c60c274b7c fmt: update use of *T to *const T 2014-06-30 19:27:54 -04:00
Arcterus
082ddefbda Merge pull request #323 from ebfe/seq
seq: fix build
2014-06-30 16:27:44 -07:00
Arcterus
760be3f9e1 Merge pull request #318 from kwantam/master
fmt: Knuth-Plass implementation; common: add unicode char_width function
2014-06-30 16:11:04 -07:00
kwantam
8be67f7d4d fmt Knuth-Plass implementation; unicode char_width
fmt:
- Implemented Knuth-Plass optimal linebreaking strategy.
- Added commandline switch -q for "quick" (greedy) split
  mode that does not use Knuth-Plass.
- Right now, Knuth-Plass runs about half as fast. It also
  uses more memory.
- Updated fmt to use char_width (see below) instead of
  assuming each character width is 1.
- Use i64 for demerits instead of int in K-P, since int is
  pointer sized and will only be 32 bits on some
  architectures.
- incremented version number
- Incorporated improvements suggested by huonw and Arcterus.
  - K-P uses indices of linebreaks vector instead of raw
    pointers. This gets rid of a lot of allocation of boxes
    and improves safety to boot.
- Added a support module for computing displayed widths of unicode
  strings based on Markus Kuhn's free implementation at
    http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c
- This is in `charwidth.rs`, but this is a temporary measure
  until the Char trait implements .width(). I am submitting
  a PR for this soon, and the code in charwidth() is what's
  generated libcore.

closes #223
2014-06-30 19:09:22 -04:00
Michael Gehring
d88f7a0dc5 seq: fix build 2014-06-30 13:26:30 +02:00
Oly Mi
8a7f96c605 Merge pull request #321 from ebfe/fix-build-master
Update rust-crypto
2014-06-30 15:06:14 +04:00
Michael Gehring
cf7da259ee Update rust-crypto 2014-06-30 12:51:30 +02:00
Arcterus
48727e4ee8 Merge pull request #319 from torkve/master
realpath and relpath implementation
2014-06-29 13:03:52 -07:00
Vsevolod Velichko
c6f75a1419 relpath implementation 2014-06-29 23:59:25 +04:00
Vsevolod Velichko
c7e93c009e realpath implementation 2014-06-29 23:57:54 +04:00
Oly Mi
b8e200489e Merge pull request #320 from Arcterus/nohup-fix
Couple of minor fixes
2014-06-29 06:49:59 +04:00
Arcterus
643d9f0f32 Remove a couple of warnings 2014-06-28 16:57:19 -07:00
Arcterus
ae4ad2bb04 Remove useless main functions and fix nohup on Macs 2014-06-28 16:45:10 -07:00
Arcterus
8fd455f8e5 Merge pull request #234 from polyphemus/cut
Implement cut - implement #165
2014-06-27 09:30:53 -07:00
polyphemus
a470c330e6 Add cut to Cargo.toml, remove cut from To Do list 2014-06-27 17:39:59 +02:00
polyphemus
798af52077 Implement fields cutting
Adds an implementation for cut_fields() and creates a separate funtion
for the --output-delimiter, for performance reasons.

This implementation relies on ::read_until() to find the newline for us
but read_until() allocates a vector every time to return it's result.
This is not ideal and should be improved upon by passing a buffer to
read().

This follows/implements the POSIX specification and all the GNU
conventions. It is a drop-in replacement for GNU cut.

One improvement to GNU is that the --delimter option takes a character
as UTF8 as apposed to single byte only for GNU.

Performance is about two times slower than that of GNU cut.

Remove ranges' sentinel value, All cut functions iterate over the ranges
and therefore it only adds an extra iteration instead of improving
performance.
2014-06-27 17:39:49 +02:00
polyphemus
0e46d453b7 Rewrite cut_characters
This follows the cut_bytes() approach of letting read_line() create a
buffer and find the newline. read_line() guarantees our buffer is a
string of utf8 characters.

When writing out the bytes segment we need to make sure we are cutting
on utf8 boundaries, there for we must iterate over the buffer
from read_line(). This implementation is(/should be) efficient as it
only iterates once over the buffer.

The previous performance was about 4x as slow as cut_bytes() and now it
is about 2x as slow as cut_bytes().
2014-06-27 17:39:49 +02:00
polyphemus
b1c2d7ac7c Rewrite cut_bytes()
Do no longer iterate over each byte and instead rely on the Buffer trait
to find the newline for us. Iterate over the ranges to specify slices of
the line which need to be printed out.

This rewrite gives a signifcant performance increase:
Old:    1.32s
mahkoh: 0.90s
New:    0.20s
GNU:    0.15s
2014-06-27 17:39:49 +02:00
polyphemus
8b1ff08bd5 Add cut_characters implementation, based on cut_bytes
This implementation uses rust's concept of characters and fails if the
input isn't valid utf-8. GNU cut implements '--characters' as an alias
for '--bytes' and thus has different semantics, for this option, from
this implemtation.
2014-06-27 17:39:49 +02:00
polyphemus
2ab586459b Add initial cut support, only bytes cutting 2014-06-27 17:39:41 +02:00
Arcterus
a5187bed7c Merge pull request #317 from redcape/fix-mem-and-text-mode
Use Less Memory and Fix Text Mode on Windows/UNIX
2014-06-26 21:55:07 -07:00
Gil Cottle
9944bdedd4 Use Less Memory and Fix Text Mode on Windows/UNIX
The following are changes to fix #303:
  1. hashsum pulls 512KB chunks of the file into memory. This ends up taking 1MB with
     a secondary buffer allocated for windows. hashsum is now able to hash files larger
     than the computer's available memory.
  2. Text no longer transforms to UTF-8. This allows hashing to work on binary files
     without specifying text mode. On Windows, it converts a Windows newline '\r\n' to
     the standard newline '\n'.
  3. Set default modes: Windows uses binary by default, all other systems use text.

Gil Cottle <gcottle@redtown.org>
2014-06-27 00:45:48 -04:00
Arcterus
cbc21642ab Merge pull request #309 from ebfe/build
make: always build multicall binary
2014-06-26 18:40:33 -07:00
Michael Gehring
30bba07f9c always build multicall binary
squashed:
	a2c6b27 - build: automatically generate main() files
	c942f0f - remove MULTICALL=1 build from travis
	cb7b35b - make: remove unnecessary shell command
	69bbb31 - update README
	03a3168 - all: move main() into separate file that links against util crate
	8276384 - make: always build multicall binary
	aa4edeb - make: avoid 'rustc --crate-file-name'
2014-06-26 10:26:16 +02:00
Arcterus
8568d41a09 Merge pull request #304 from torkve/master
nohup implementation
2014-06-25 23:46:30 -07:00
Vsevolod Velichko
3d75a9ba9d Added nohup to cargo 2014-06-26 10:41:32 +04:00
Vsevolod Velichko
ff44e28a4d README: added notice about uutils to contributions guide 2014-06-26 10:41:32 +04:00
Vsevolod Velichko
0063bb2a8c Added nohup to uutils 2014-06-26 10:41:32 +04:00
Vsevolod Velichko
3da3d7333c nohup removed from README 2014-06-26 10:41:32 +04:00
Vsevolod Velichko
9fb33699b1 nohup implementation 2014-06-26 10:41:32 +04:00
Arcterus
aba12a39f0 Merge pull request #313 from Heather/master
move sync to PROGS
2014-06-25 23:18:08 -07:00
Heather
4aa009995b move sync to PROGS 2014-06-26 10:05:31 +04:00
Oly Mi
4ebe8e0da7 Merge pull request #285 from xanderfomin/sync
sync for Windows implementation
2014-06-26 09:56:03 +04:00
Oly Mi
308a764677 Merge pull request #312 from redcape/update-rust-crypto
use latest rust-crypto for new rust master
2014-06-26 09:50:21 +04:00
Gil Cottle
26f45fb1e6 use latest rust-crypto for new rust master 2014-06-26 01:22:39 -04:00