1
1

308 Коммитов

Автор SHA1 Сообщение Дата
Yorhel
532c32c884 Add space between file size and unit suffix
As per http://dev.yorhel.nl/ncdu/bug/31
2013-07-23 10:38:37 +02:00
Yorhel
0e9e6d511a Add --si flag for base 10 prefixes
This is a slightly modified patch contributed at

  http://dev.yorhel.nl/ncdu/bug/35
2013-07-23 10:33:24 +02:00
Yorhel
30c0b2db00 browser.c: Fix "Toggle dirs before files when sorting" functionality
This has apparently been broken since version 1.7 (v1.6-7-g5db9c2a to be
precise), yet NOBODY TOLD ME!? :-(

The OSS community has left me in despair!
2013-06-05 16:56:46 +02:00
Yorhel
5e5c9925f4 Version bump + Changelog update for 1.10 2013-05-09 16:32:48 +02:00
Yorhel
0a4ad63591 Fix a few compiler warnings
Most of which made sense.
2013-05-09 16:24:15 +02:00
Yorhel
bb1145dced Added statically linked binary generator script 2013-05-09 16:18:44 +02:00
Yorhel
4021821b91 deps: Update khash to latest upstream version 2013-05-09 15:27:40 +02:00
Yorhel
cfd1b1fea2 deps: Update khash and yopt to their latest upstream versions 2013-04-25 08:17:02 +02:00
Yorhel
09c444753a Move khash & yopt to deps/
Both microlibraries come from another source, and are not maintained as
part of ncdu. This separation of src/ and deps/ makes the relation more
clear.
2013-04-25 08:11:39 +02:00
Yorhel
bc8ccc959d dir_scan.c: Reset directory sizes when excluded by a CACHEDIR.TAG
Tiny bug fix: The size of an excluded directory entry itself should not
be counted, either. This is consistent with what you'd expect: A cache
directory with thousands of files can easily take up several megabytes
for the dir entry - but from the perspective of a backup system that
recognizes cache dirs - the dir is empty, and therefore shouldn't take
any extra space at all.
2013-04-12 19:43:29 +02:00
Yorhel
01f36e1beb Use /**/ comments + minor style change 2013-04-12 19:37:40 +02:00
Petr Pudlak
dc316e26f5 has_cachedir_tag: Keep statuc allocated buffer for paths. 2013-04-12 18:16:15 +02:00
Petr Pudlak
4a6efeba3d Document --exclude-caches in ncdu.pod. 2013-04-12 17:21:11 +02:00
Petr Pudlak
1b1982e9af Let has_cachedir_tag use malloc instead of a buffer on the stack. 2013-04-12 16:21:16 +02:00
Petr Pudlak
2784d82a9e CACHEDIR.TAG - improve code style and the name of the parameter.
Use a macro instead of the global constant `cachedir_tag_signature`.
Use `memcmp` instead of `strncmp`.
Add `has_cachedir_tag` to exclude.h.

(See http://dev.yorhel.nl/ncdu/bug/30)
2013-04-12 14:53:33 +02:00
Petr Pudlak
3def47c331 Add CACHEDIR.TAG support.
A new command line parameter allows to filter out directories containing
the proper `CACHEDIR.TAG` file.
See http://www.brynosaurus.com/cachedir/
2013-04-10 16:50:57 +02:00
Yorhel
9b4f2d8601 configure: Use PKG_PROG_PKG_CONFIG + mention pkg-config dep in README 2013-03-09 09:21:13 +01:00
Justin Lecher
1324d45491 Use pkg-config to detect ncurses
Ncurses provides a pkg-config module which could be used here. If not
available we fall back to the old detection heuristic.

Signed-off-by: Justin Lecher <jlec@gentoo.org>
2013-03-07 13:42:51 +01:00
Yorhel
1c8662ea63 ncdu.1: Add new c/C keys 2013-01-18 11:14:01 +01:00
Chris West (Faux)
c4f5f370ac use the locale's thousand seperator, if available 2013-01-13 12:42:28 +00:00
Chris West (Faux)
fdd86924e5 'C' sorts by items 2013-01-13 12:42:28 +00:00
Chris West (Faux)
cfcac262d1 'c' to show child item counts 2013-01-13 12:42:28 +00:00
Chris West (Faux)
a90cf9c7d2 gitignore 2013-01-13 12:42:28 +00:00
Yorhel
28c0b58c2e Clip directory sizes to make sure they are positive
I realized that I used addparentstats() with negative values when
removing stuff, so it had to be done this way (without rewriting
everything). It's a simple solution, anyway.
2012-11-22 13:47:10 +01:00
Yorhel
ad84603bee Clip directory sizes to fit in a signed 64bit integer
This mostly avoids the issue of getting negative sizes. It's still
possible to get a negative size after refresh or deletion, I'll get to
that in a bit.
2012-11-22 13:33:32 +01:00
Yorhel
2bc1b3e479 util.c: Fix possible buffer overflow in fillsize() and formatsize()
They should now be able to cope with file sizes in the full (positive)
range of a signed integer, i.e. 0 bytes to 8 EiB minus one byte. The
size calculation of directories, however, may still overflow and cause
negative integers to be passed around. That should be fixed.
2012-11-22 12:42:57 +01:00
Yorhel
3fd25ffbcb configure.in -> configure.ac
As recent autoconf wants
2012-11-22 12:30:53 +01:00
Yorhel
eba9a7f8ef Version bump + Changelog update for 1.9 2012-09-27 11:45:09 +02:00
Yorhel
5183e7633b Don't make ncdu.1 depend on Makefile
Makefile is generated by configure, and thus guaranteed to be newer than
ncdu.1, causing make to regenerate ncdu.1 regardless of whether pod2man
is installed or not. That kinda defeats the purpose of including ncdu.1
in the distribution.
2012-09-27 11:40:00 +02:00
Yorhel
31491d1e2c Add some examples to the man page 2012-09-08 18:23:39 +02:00
Yorhel
b1059cafc4 Update man page with new options 2012-09-08 17:30:29 +02:00
Yorhel
7feaeb1483 Abstracted option parsing from option handling
This also adds the possibility to combine short options that expect an
argument, e.g. "-xo <file>" or even "-xo<file>".
2012-09-08 14:38:15 +02:00
Yorhel
eeff908b0c dir_export.c: Add timestamp to meta-data 2012-09-07 09:37:20 +02:00
Yorhel
b6e4092ea7 cli: Use -0,-1,-2 instead of "-u n"
I've no idea for what other purpose I'd use numbered options. This is
much shorter, and can easily be combined with other options (e.g. -rx1).
2012-09-06 14:11:44 +02:00
Yorhel
c29f318128 Removed the TODO file
I have a bug tracker for that.
2012-09-06 13:20:52 +02:00
Yorhel
aad479a19a Disallow refresh/delete after import + provide visual feedback
It's kinda annoying how you need to confirm the messages. I'd prefer
having some status bar where messages are automatically removed after a
short timeout or something. But that's more work, and for the few
cases where feedback is necessary this'll work fine, too.
2012-09-06 13:16:54 +02:00
Yorhel
267de619ba dir_import.c: Only call input_handle() once every 32 read items
Some measurements importing a gzip-compressed file (zcat .. | ncdu -f -)
containing a bit under 6 million items and a few choices of how often to
call input_handle():

Called on every item:

  real    0m13.745s
  user    0m12.576s
  sys     0m4.566s

Called on every 8 items:

  real    0m7.932s
  user    0m9.636s
  sys     0m1.623s

Called on every 16 items:

  real    0m7.559s
  user    0m9.553s
  sys     0m1.323s

Called on every 32 items:

  real    0m7.279s
  user    0m9.353s
  sys     0m1.277s

Called on every 64 items:

  real    0m7.166s
  user    0m9.389s
  sys     0m1.117s

Called on every 256 items:

  real    0m7.073s
  user    0m9.439s
  sys     0m1.027s

32 seemed like a good compromise.
2012-09-06 12:49:20 +02:00
Yorhel
fdc614126a browser.c: Display [imported] indication in title 2012-09-06 12:32:41 +02:00
Yorhel
37f390d241 dir_import.c: Don't throw an error when user aborted import 2012-09-06 09:47:00 +02:00
Yorhel
7d2cb84e70 Display "Loading..." instead of "Scanning..." when importing a file 2012-09-06 09:45:52 +02:00
Yorhel
c298e32942 Check that stdin is a tty when initializing ncurses 2012-09-06 09:33:58 +02:00
Yorhel
38b2c8f012 dir_import.c: Various fixes
- errors in item() didn't propagate properly
- empty [] and {} values weren't allowed
- fractional numbers weren't allowed
- parsing of escaped characters didn't ensure that enough data was in
  the buffer
- E() didn't propagate errors properly in all cases

I'll do some more testing later on, but the current code seems to be
working quite well already.
2012-09-05 17:46:44 +02:00
Yorhel
e6eaec30ba dir_import.c: Put a limit on the recursion depth 2012-09-05 14:15:28 +02:00
Yorhel
10dca5503a Added -f option to import an exported directory structure
This is the first working version. There's a few TODO's left.
2012-09-05 13:52:12 +02:00
Yorhel
ef4abec6cf path.c: Don't throw away remaining components after a symlink
This is a quick hack to fix http://dev.yorhel.nl/ncdu/bug/18.
path_real() is both rather unreadable, fragile, hard to maintain and a
bit inefficient. It wouldn't be too surprising if I introduced a new bug
with this commit...

*makes a note to do a proper rewrite of that code later on*
2012-08-29 22:06:43 +02:00
Yorhel
f83ed07fcf Don't include "notreg" field for excluded/error'd files in export
+ some comment fixes.
2012-08-29 11:52:52 +02:00
Yorhel
968471f602 Omit "dev" field in export when same as parent dir + "excluded" fix 2012-08-29 11:43:10 +02:00
Yorhel
c4616ff186 Added simple error checking & handling when exporting 2012-08-29 10:27:12 +02:00
Yorhel
7ccb98006a Support exporting to stdout while still allowing -u 2 to work 2012-08-29 10:26:37 +02:00
Yorhel
9d341950ff dir_common.c: Don't display total size when it's not known
The total size isn't calculated when exporting to a file.
2012-08-29 09:23:32 +02:00