[-]
[+]
|
Changed |
_service
|
@@ -3,5 +3,5 @@
- <param name="protocol">http</param><param name="path">/download/ncdu-1.10.tar.gz</param><param name="host">dev.yorhel.nl</param></service>
+ <param name="protocol">http</param><param name="path">/download/ncdu-1.11.tar.gz</param><param name="host">dev.yorhel.nl</param></service>
</services>
\ No newline at end of file
|
[-]
[+]
|
Changed |
_service:download_url:ncdu-1.11.tar.gz/COPYING
^
|
@@ -1,4 +1,4 @@
-Copyright (c) 2007-2012 Yoran Heling
+Copyright (c) 2007-2014 Yoran Heling
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
|
[-]
[+]
|
Changed |
_service:download_url:ncdu-1.11.tar.gz/ChangeLog
^
|
@@ -1,3 +1,9 @@
+1.11 - 2014-04-05
+ - Added 'b' key to spawn shell in the current directory
+ - Support scanning (and refreshing) of empty directories
+ - Added --si flag for base 10 prefixes
+ - Fix toggle dirs before files
+
1.10 - 2013-05-09
- Added 'c' key to display item counts
- Added 'C' key to order by item counts
|
[-]
[+]
|
Changed |
_service:download_url:ncdu-1.11.tar.gz/Makefile.am
^
|
@@ -12,6 +12,7 @@
src/dir_scan.c\
src/exclude.c\
src/help.c\
+ src/shell.c\
src/main.c\
src/path.c\
src/util.c
@@ -26,6 +27,7 @@
src/exclude.h\
src/global.h\
src/help.h\
+ src/shell.h\
src/path.h\
src/util.h
|
[-]
[+]
|
Changed |
_service:download_url:ncdu-1.11.tar.gz/Makefile.in
^
|
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.13.1 from Makefile.am.
+# Makefile.in generated by automake 1.13.4 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -16,23 +16,51 @@
VPATH = @srcdir@
-am__make_dryrun = \
- { \
- am__dry=no; \
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
- echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
- | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
- *) \
- for am__flg in $$MAKEFLAGS; do \
- case $$am__flg in \
- *=*|--*) ;; \
- *n*) am__dry=yes; break;; \
- esac; \
- done;; \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
- test $$am__dry = yes; \
- }
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -72,8 +100,8 @@
src/dirlist.$(OBJEXT) src/dir_common.$(OBJEXT) \
src/dir_export.$(OBJEXT) src/dir_import.$(OBJEXT) \
src/dir_mem.$(OBJEXT) src/dir_scan.$(OBJEXT) \
- src/exclude.$(OBJEXT) src/help.$(OBJEXT) src/main.$(OBJEXT) \
- src/path.$(OBJEXT) src/util.$(OBJEXT)
+ src/exclude.$(OBJEXT) src/help.$(OBJEXT) src/shell.$(OBJEXT) \
+ src/main.$(OBJEXT) src/path.$(OBJEXT) src/util.$(OBJEXT)
ncdu_OBJECTS = $(am_ncdu_OBJECTS)
ncdu_LDADD = $(LDADD)
AM_V_P = $(am__v_P_@AM_V@)
@@ -286,6 +314,7 @@
src/dir_scan.c\
src/exclude.c\
src/help.c\
+ src/shell.c\
src/main.c\
src/path.c\
src/util.c
@@ -300,6 +329,7 @@
src/exclude.h\
src/global.h\
src/help.h\
+ src/shell.h\
src/path.h\
src/util.h
@@ -426,9 +456,11 @@
src/exclude.$(OBJEXT): src/$(am__dirstamp) \
src/$(DEPDIR)/$(am__dirstamp)
src/help.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/shell.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
src/main.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
src/path.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
src/util.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+
ncdu$(EXEEXT): $(ncdu_OBJECTS) $(ncdu_DEPENDENCIES) $(EXTRA_ncdu_DEPENDENCIES)
@rm -f ncdu$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(ncdu_OBJECTS) $(ncdu_LDADD) $(LIBS)
@@ -452,6 +484,7 @@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/help.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/main.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/path.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/shell.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/util.Po@am__quote@
.c.o:
|
[-]
[+]
|
Changed |
_service:download_url:ncdu-1.11.tar.gz/README
^
|
@@ -1,4 +1,4 @@
-ncdu 1.10
+ncdu 1.11
=========
DESCRIPTION
@@ -33,7 +33,7 @@
COPYING
- Copyright (c) 2007-2013 Yoran Heling
+ Copyright (c) 2007-2014 Yoran Heling
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
|
[-]
[+]
|
Changed |
_service:download_url:ncdu-1.11.tar.gz/aclocal.m4
^
|
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.13.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.13.4 -*- Autoconf -*-
-# Copyright (C) 1996-2012 Free Software Foundation, Inc.
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -250,7 +250,7 @@
[am__api_version='1.13'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.13.1], [],
+m4_if([$1], [1.13.4], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -266,7 +266,7 @@
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.13.1])dnl
+[AM_AUTOMAKE_VERSION([1.13.4])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
@@ -588,7 +588,7 @@
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
+ test -z "$am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
@@ -1140,76 +1140,114 @@
# Substitute a variable $(am__untar) that extract such
# a tarball read from stdin.
# $(am__untar) < result.tar
+#
AC_DEFUN([_AM_PROG_TAR],
[# Always define AMTAR for backward compatibility. Yes, it's still used
# in the wild :-( We should find a proper way to deprecate it ...
AC_SUBST([AMTAR], ['$${TAR-tar}'])
-m4_if([$1], [v7],
- [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
- [m4_case([$1], [ustar],, [pax],,
- [m4_fatal([Unknown tar format])])
-AC_MSG_CHECKING([how to create a $1 tar archive])
-# Loop over all known methods to create a tar archive until one works.
+
+# We'll loop over all known methods to create a tar archive until one works.
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
-_am_tools=${am_cv_prog_tar_$1-$_am_tools}
-# Do not fold the above two line into one, because Tru64 sh and
-# Solaris sh will not grok spaces in the rhs of '-'.
-for _am_tool in $_am_tools
-do
- case $_am_tool in
- gnutar)
- for _am_tar in tar gnutar gtar;
- do
- AM_RUN_LOG([$_am_tar --version]) && break
- done
- am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
- am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
- am__untar="$_am_tar -xf -"
- ;;
- plaintar)
- # Must skip GNU tar: if it does not support --format= it doesn't create
- # ustar tarball either.
- (tar --version) >/dev/null 2>&1 && continue
- am__tar='tar chf - "$$tardir"'
- am__tar_='tar chf - "$tardir"'
- am__untar='tar xf -'
- ;;
- pax)
- am__tar='pax -L -x $1 -w "$$tardir"'
- am__tar_='pax -L -x $1 -w "$tardir"'
- am__untar='pax -r'
- ;;
- cpio)
- am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
- am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
- am__untar='cpio -i -H $1 -d'
- ;;
- none)
- am__tar=false
- am__tar_=false
- am__untar=false
- ;;
- esac
- # If the value was cached, stop now. We just wanted to have am__tar
- # and am__untar set.
- test -n "${am_cv_prog_tar_$1}" && break
+m4_if([$1], [v7],
+ [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
- # tar/untar a dummy directory, and stop if the command works
- rm -rf conftest.dir
- mkdir conftest.dir
- echo GrepMe > conftest.dir/file
- AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ [m4_case([$1],
+ [ustar],
+ [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
+ # There is notably a 21 bits limit for the UID and the GID. In fact,
+ # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
+ # and bug#13588).
+ am_max_uid=2097151 # 2^21 - 1
+ am_max_gid=$am_max_uid
+ # The $UID and $GID variables are not portable, so we need to resort
+ # to the POSIX-mandated id(1) utility. Errors in the 'id' calls
+ # below are definitely unexpected, so allow the users to see them
+ # (that is, avoid stderr redirection).
+ am_uid=`id -u || echo unknown`
+ am_gid=`id -g || echo unknown`
+ AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
+ if test $am_uid -le $am_max_uid; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ _am_tools=none
+ fi
+ AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
+ if test $am_gid -le $am_max_gid; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ _am_tools=none
+ fi],
+
+ [pax],
+ [],
+
+ [m4_fatal([Unknown tar format])])
+
+ AC_MSG_CHECKING([how to create a $1 tar archive])
+
+ # Go ahead even if we have the value already cached. We do so because we
+ # need to set the values for the 'am__tar' and 'am__untar' variables.
+ _am_tools=${am_cv_prog_tar_$1-$_am_tools}
+
+ for _am_tool in $_am_tools; do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar; do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works.
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ AM_RUN_LOG([cat conftest.dir/file])
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+ done
rm -rf conftest.dir
- if test -s conftest.tar; then
- AM_RUN_LOG([$am__untar <conftest.tar])
- grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
- fi
-done
-rm -rf conftest.dir
-AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
-AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+ AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+ AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+
AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
|
[-]
[+]
|
Changed |
_service:download_url:ncdu-1.11.tar.gz/config.h.in
^
|
@@ -1,5 +1,8 @@
/* config.h.in. Generated from configure.ac by autoheader. */
+/* Used default shell interpreter */
+#undef DEFAULT_SHELL
+
/* Define to 1 if you have the `chdir' function. */
#undef HAVE_CHDIR
@@ -15,6 +18,9 @@
/* Define to 1 if you have the `getcwd' function. */
#undef HAVE_GETCWD
+/* Define to 1 if you have the `getenv' function. */
+#undef HAVE_GETENV
+
/* Define to 1 if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY
@@ -39,9 +45,6 @@
/* Define to 1 if you have the `rmdir' function. */
#undef HAVE_RMDIR
-/* Define to 1 if you have the `setlocale' function. */
-#undef HAVE_SETLOCALE
-
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
@@ -61,6 +64,9 @@
`HAVE_STRUCT_STAT_ST_BLOCKS' instead. */
#undef HAVE_ST_BLOCKS
+/* Define to 1 if you have the `system' function. */
+#undef HAVE_SYSTEM
+
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
|
[-]
[+]
|
Changed |
_service:download_url:ncdu-1.11.tar.gz/configure
^
|
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for ncdu 1.10.
+# Generated by GNU Autoconf 2.69 for ncdu 1.11.
#
# Report bugs to <projects@yorhel.nl>.
#
@@ -580,8 +580,8 @@
# Identity of this package.
PACKAGE_NAME='ncdu'
PACKAGE_TARNAME='ncdu'
-PACKAGE_VERSION='1.10'
-PACKAGE_STRING='ncdu 1.10'
+PACKAGE_VERSION='1.11'
+PACKAGE_STRING='ncdu 1.11'
PACKAGE_BUGREPORT='projects@yorhel.nl'
PACKAGE_URL=''
@@ -725,6 +725,7 @@
enable_largefile
with_ncurses
with_ncursesw
+with_shell
'
ac_precious_vars='build_alias
host_alias
@@ -1280,7 +1281,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures ncdu 1.10 to adapt to many kinds of systems.
+\`configure' configures ncdu 1.11 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1346,7 +1347,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of ncdu 1.10:";;
+ short | recursive ) echo "Configuration of ncdu 1.11:";;
esac
cat <<\_ACEOF
@@ -1368,6 +1369,8 @@
--with-ncurses compile/link with ncurses library
--with-ncursesw compile/link with wide-char ncurses library
[default]
+ --with-shell used interpreter as default shell (default is
+ /bin/sh)
Some influential environment variables:
CC C compiler command
@@ -1454,7 +1457,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-ncdu configure 1.10
+ncdu configure 1.11
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2010,7 +2013,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by ncdu $as_me 1.10, which was
+It was created by ncdu $as_me 1.11, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2876,7 +2879,7 @@
# Define the identity of the package.
PACKAGE='ncdu'
- VERSION='1.10'
+ VERSION='1.11'
cat >>confdefs.h <<_ACEOF
@@ -2916,6 +2919,10 @@
# in the wild :-( We should find a proper way to deprecate it ...
AMTAR='$${TAR-tar}'
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar pax cpio none'
+
am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
@@ -2923,6 +2930,7 @@
+
# Check for programs.
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
@@ -4517,7 +4525,7 @@
done
-for ac_header in limits.h sys/time.h sys/types.h sys/stat.h dirent.h unistd.h fnmatch.h ncurses.h locale.h
+for ac_header in limits.h sys/time.h sys/types.h sys/stat.h dirent.h unistd.h fnmatch.h ncurses.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -4533,6 +4541,19 @@
done
+for ac_header in locale.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "locale.h" "ac_cv_header_locale_h" "$ac_includes_default"
+if test "x$ac_cv_header_locale_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LOCALE_H 1
+_ACEOF
+
+fi
+
+done
+
+
# Check for typedefs, structures, and compiler characteristics.
ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t"
case $ac_cv_c_int64_t in #(
@@ -4781,7 +4802,7 @@
# Check for library functions.
-for ac_func in getcwd gettimeofday fnmatch chdir rmdir unlink lstat setlocale
+for ac_func in getcwd gettimeofday fnmatch chdir rmdir unlink lstat system getenv
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -5127,6 +5148,22 @@
fi
fi
+# Configure default shell for spawning shell when $SHELL is not set
+
+# Check whether --with-shell was given.
+if test "${with_shell+set}" = set; then :
+ withval=$with_shell; DEFAULT_SHELL=$withval
+else
+ DEFAULT_SHELL=/bin/sh
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Using $DEFAULT_SHELL as the default shell if \$SHELL is not set" >&5
+$as_echo "$as_me: Using $DEFAULT_SHELL as the default shell if \$SHELL is not set" >&6;}
+
+cat >>confdefs.h <<_ACEOF
+#define DEFAULT_SHELL "$DEFAULT_SHELL"
+_ACEOF
+
ac_config_files="$ac_config_files Makefile"
@@ -5661,7 +5698,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by ncdu $as_me 1.10, which was
+This file was extended by ncdu $as_me 1.11, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -5727,7 +5764,7 @@
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-ncdu config.status 1.10
+ncdu config.status 1.11
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
@@ -6506,7 +6543,7 @@
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
+ test -z "$am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
@@ -6585,4 +6622,3 @@
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
-
|
[-]
[+]
|
Changed |
_service:download_url:ncdu-1.11.tar.gz/configure.ac
^
|
@@ -1,5 +1,5 @@
-AC_INIT(ncdu, 1.10, projects@yorhel.nl)
+AC_INIT(ncdu, 1.11, projects@yorhel.nl)
AC_CONFIG_SRCDIR([src/global.h])
AC_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE([foreign subdir-objects])
@@ -12,9 +12,11 @@
# Check for header files.
AC_CHECK_HEADERS(
- [limits.h sys/time.h sys/types.h sys/stat.h dirent.h unistd.h fnmatch.h ncurses.h locale.h],[],
+ [limits.h sys/time.h sys/types.h sys/stat.h dirent.h unistd.h fnmatch.h ncurses.h],[],
AC_MSG_ERROR([required header file not found]))
+AC_CHECK_HEADERS(locale.h)
+
# Check for typedefs, structures, and compiler characteristics.
AC_TYPE_INT64_T
AC_TYPE_UINT64_T
@@ -23,7 +25,7 @@
# Check for library functions.
AC_CHECK_FUNCS(
- [getcwd gettimeofday fnmatch chdir rmdir unlink lstat setlocale],[],
+ [getcwd gettimeofday fnmatch chdir rmdir unlink lstat system getenv],[],
AC_MSG_ERROR([required function missing]))
@@ -53,7 +55,14 @@
])
fi
+# Configure default shell for spawning shell when $SHELL is not set
+AC_ARG_WITH([shell],
+ [AS_HELP_STRING([--with-shell],
+ [used interpreter as default shell (default is /bin/sh)])],
+ [DEFAULT_SHELL=$withval],
+ [DEFAULT_SHELL=/bin/sh])
+AC_MSG_NOTICE([Using $DEFAULT_SHELL as the default shell if \$SHELL is not set])
+AC_DEFINE_UNQUOTED(DEFAULT_SHELL, "$DEFAULT_SHELL", [Used default shell interpreter])
AC_OUTPUT([Makefile])
-
|
[-]
[+]
|
Changed |
_service:download_url:ncdu-1.11.tar.gz/depcomp
^
|
@@ -1,7 +1,7 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
-scriptversion=2012-10-18.11; # UTC
+scriptversion=2013-05-30.07; # UTC
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
@@ -552,6 +552,7 @@
G
p
}' >> "$depfile"
+ echo >> "$depfile" # make sure the fragment doesn't end with a backslash
rm -f "$tmpdepfile"
;;
|
[-]
[+]
|
Changed |
_service:download_url:ncdu-1.11.tar.gz/doc/ncdu.pod
^
|
@@ -97,6 +97,12 @@
interface in that case. It has no effect when C<-f> is used, either, because
the deletion feature is disabled in that case anyway.
+=item --si
+
+List sizes using base 10 prefixes, that is, powers of 1000 (KB, MB, etc), as
+defined in the International System of Units (SI), instead of the usual base 2
+prefixes, that is, powers of 1024 (KiB, MiB, etc).
+
=back
=head2 Scan Options
@@ -204,6 +210,14 @@
Refresh/recalculate the current directory.
+=item b
+
+Spawn shell in current directory.
+
+We first check the $SHELL environment variable of the user for the preferred
+shell interpreter. If it's not set, we fall back to the compile time
+configured default shell (usually /bin/bash).
+
=item q
Quit
|
[-]
[+]
|
Changed |
_service:download_url:ncdu-1.11.tar.gz/ncdu.1
^
|
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.20)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -38,6 +38,8 @@
. ds PI \(*p
. ds L" ``
. ds R" ''
+. ds C`
+. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
@@ -48,17 +50,24 @@
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
-.ie \nF \{\
-. de IX
-. tm Index:\\$1\t\\n%\t"\\$2"
+.\"
+.\" Avoid warning from groff about undefined register 'F'.
+.de IX
..
-. nr % 0
-. rr F
-.\}
-.el \{\
-. de IX
+.nr rF 0
+.if \n(.g .if rF .nr rF 1
+.if (\n(rF:(\n(.g==0)) \{
+. if \nF \{
+. de IX
+. tm Index:\\$1\t\\n%\t"\\$2"
..
+. if !\nF==2 \{
+. nr % 0
+. nr F 2
+. \}
+. \}
.\}
+.rr rF
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
@@ -124,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "NCDU 1"
-.TH NCDU 1 "2013-04-12" "ncdu-1.10" "ncdu manual"
+.TH NCDU 1 "2014-12-14" "ncdu-1.10g" "ncdu manual"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -205,6 +214,11 @@
option has no effect when \f(CW\*(C`\-o\*(C'\fR is used, because there will not be a browser
interface in that case. It has no effect when \f(CW\*(C`\-f\*(C'\fR is used, either, because
the deletion feature is disabled in that case anyway.
+.IP "\-\-si" 4
+.IX Item "--si"
+List sizes using base 10 prefixes, that is, powers of 1000 (\s-1KB, MB,\s0 etc), as
+defined in the International System of Units (\s-1SI\s0), instead of the usual base 2
+prefixes, that is, powers of 1024 (KiB, MiB, etc).
.SS "Scan Options"
.IX Subsection "Scan Options"
These options affect the scanning progress, and have no effect when importing
@@ -224,7 +238,7 @@
by a newline.
.IP "\-\-exclude\-caches" 4
.IX Item "--exclude-caches"
-Exclude directories containing \s-1CACHEDIR\s0.TAG. The directories will still be
+Exclude directories containing \s-1CACHEDIR.TAG. \s0 The directories will still be
displayed, but not their content, and they are not counted towards the disk
usage statistics.
See http://www.brynosaurus.com/cachedir/
@@ -282,6 +296,13 @@
.IP "r" 4
.IX Item "r"
Refresh/recalculate the current directory.
+.IP "b" 4
+.IX Item "b"
+Spawn shell in current directory.
+.Sp
+We first check the \f(CW$SHELL\fR environment variable of the user for the preferred
+shell interpreter. If it's not set, we fall back to the compile time
+configured default shell (usually /bin/bash).
.IP "q" 4
.IX Item "q"
Quit
|
[-]
[+]
|
Changed |
_service:download_url:ncdu-1.11.tar.gz/src/browser.c
^
|
@@ -1,6 +1,6 @@
/* ncdu - NCurses Disk Usage
- Copyright (c) 2007-2012 Yoran Heling
+ Copyright (c) 2007-2014 Yoran Heling
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -98,13 +98,12 @@
/* reference to parent dir has a different format */
if(n == dirlist_parent) {
mvhline(row, 0, ' ', wincols);
- o = graph == 0 ? 12 :
- graph == 1 ? 24 :
- graph == 2 ? 20 :
- 31 ;
- if (show_items) {
+ o = graph == 0 ? 13 :
+ graph == 1 ? 25 :
+ graph == 2 ? 21 :
+ 32 ;
+ if(show_items)
o += 7;
- }
mvaddstr(row, o, "/..");
if(n->flags & FF_BSEL)
attroff(A_REVERSE);
@@ -142,8 +141,8 @@
x = 0;
- mvprintw(row, x, "%c %8s ", ct, size);
- x += 11;
+ mvprintw(row, x, "%c %9s ", ct, size);
+ x += 12;
if (show_items) {
if (n->items > 99999)
@@ -169,7 +168,7 @@
void browse_draw() {
struct dir *t;
- char fmtsize[9], *tmp;
+ char fmtsize[10], *tmp;
int selected = 0, i;
erase();
@@ -188,9 +187,9 @@
/* second line - the path */
mvhline(1, 0, '-', wincols);
- if(t) {
+ if(dirlist_par) {
mvaddch(1, 3, ' ');
- tmp = getpath(t->parent);
+ tmp = getpath(dirlist_par);
mvaddstr(1, 4, cropstr(tmp, wincols-8));
mvaddch(1, 4+((int)strlen(tmp) > wincols-8 ? wincols-8 : (int)strlen(tmp)), ' ');
}
@@ -350,7 +349,7 @@
info_show = 0;
break;
case 't':
- dirlist_set_sort(DL_NOCHANGE, DL_NOCHANGE, dirlist_sort_df);
+ dirlist_set_sort(DL_NOCHANGE, DL_NOCHANGE, !dirlist_sort_df);
info_show = 0;
break;
case 'a':
@@ -364,8 +363,8 @@
case 10:
case KEY_RIGHT:
case 'l':
- if(sel != NULL && sel->sub != NULL) {
- dirlist_open(sel->sub);
+ if(sel != NULL && sel->flags & FF_DIR) {
+ dirlist_open(sel == dirlist_parent ? dirlist_par->parent : sel);
dirlist_top(-3);
}
info_show = 0;
@@ -373,8 +372,8 @@
case KEY_LEFT:
case 'h':
case '<':
- if(sel != NULL && sel->parent->parent != NULL) {
- dirlist_open(sel->parent);
+ if(dirlist_par && dirlist_par->parent != NULL) {
+ dirlist_open(dirlist_par->parent);
dirlist_top(-3);
}
info_show = 0;
@@ -386,10 +385,10 @@
message = "Directory imported from file, won't refresh.";
break;
}
- if(sel != NULL) {
+ if(dirlist_par) {
dir_ui = 2;
- dir_mem_init(sel->parent);
- dir_scan_init(getpath(sel->parent));
+ dir_mem_init(dirlist_par);
+ dir_scan_init(getpath(dirlist_par));
}
info_show = 0;
break;
@@ -426,9 +425,16 @@
info_show = 0;
if((t = dirlist_get(1)) == sel)
if((t = dirlist_get(-1)) == sel || t == dirlist_parent)
- t = sel->parent;
+ t = NULL;
delete_init(sel, t);
break;
+ case 'b':
+ if(dir_import_active) {
+ message = "Shell feature not available for imported directories.";
+ break;
+ }
+ shell_init();
+ break;
}
/* make sure the info_* options are correct */
@@ -442,9 +448,9 @@
}
-void browse_init(struct dir *cur) {
+void browse_init(struct dir *par) {
pstate = ST_BROWSE;
message = NULL;
- dirlist_open(cur);
+ dirlist_open(par);
}
|
[-]
[+]
|
Changed |
_service:download_url:ncdu-1.11.tar.gz/src/browser.h
^
|
@@ -1,6 +1,6 @@
/* ncdu - NCurses Disk Usage
- Copyright (c) 2007-2012 Yoran Heling
+ Copyright (c) 2007-2014 Yoran Heling
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
|
[-]
[+]
|
Changed |
_service:download_url:ncdu-1.11.tar.gz/src/delete.c
^
|
@@ -1,6 +1,6 @@
/* ncdu - NCurses Disk Usage
- Copyright (c) 2007-2012 Yoran Heling
+ Copyright (c) 2007-2014 Yoran Heling
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -209,11 +209,13 @@
void delete_process() {
+ struct dir *par;
+
/* confirm */
seloption = 1;
while(state == DS_CONFIRM && !noconfirm)
if(input_handle(0)) {
- browse_init(root);
+ browse_init(root->parent);
return;
}
@@ -229,13 +231,13 @@
/* delete */
seloption = 0;
state = DS_PROGRESS;
- if(delete_dir(root))
- browse_init(root);
- else {
+ par = root->parent;
+ delete_dir(root);
+ if(nextsel)
nextsel->flags |= FF_BSEL;
- browse_init(nextsel);
+ browse_init(par);
+ if(nextsel)
dirlist_top(-4);
- }
}
|
[-]
[+]
|
Changed |
_service:download_url:ncdu-1.11.tar.gz/src/delete.h
^
|
@@ -1,6 +1,6 @@
/* ncdu - NCurses Disk Usage
- Copyright (c) 2007-2012 Yoran Heling
+ Copyright (c) 2007-2014 Yoran Heling
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
|
[-]
[+]
|
Changed |
_service:download_url:ncdu-1.11.tar.gz/src/dir.h
^
|
@@ -1,6 +1,6 @@
/* ncdu - NCurses Disk Usage
- Copyright (c) 2007-2012 Yoran Heling
+ Copyright (c) 2007-2014 Yoran Heling
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
|
[-]
[+]
|
Changed |
_service:download_url:ncdu-1.11.tar.gz/src/dir_common.c
^
|
@@ -1,6 +1,6 @@
/* ncdu - NCurses Disk Usage
- Copyright (c) 2007-2012 Yoran Heling
+ Copyright (c) 2007-2014 Yoran Heling
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
|
[-]
[+]
|
Changed |
_service:download_url:ncdu-1.11.tar.gz/src/dir_export.c
^
|
@@ -1,6 +1,6 @@
/* ncdu - NCurses Disk Usage
- Copyright (c) 2007-2012 Yoran Heling
+ Copyright (c) 2007-2014 Yoran Heling
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
|
[-]
[+]
|
Changed |
_service:download_url:ncdu-1.11.tar.gz/src/dir_import.c
^
|
@@ -1,6 +1,6 @@
/* ncdu - NCurses Disk Usage
- Copyright (c) 2007-2012 Yoran Heling
+ Copyright (c) 2007-2014 Yoran Heling
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -547,8 +547,6 @@
if(!isroot)
dir_curpath_leave();
- else /* The root item must not be empty. */
- E(ctx->items <= 1, "Empty directory");
return 0;
}
|
[-]
[+]
|
Changed |
_service:download_url:ncdu-1.11.tar.gz/src/dir_mem.c
^
|
@@ -1,6 +1,6 @@
/* ncdu - NCurses Disk Usage
- Copyright (c) 2007-2012 Yoran Heling
+ Copyright (c) 2007-2014 Yoran Heling
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -198,7 +198,7 @@
freedir(orig);
}
- browse_init(root->sub);
+ browse_init(root);
dirlist_top(-3);
return 0;
}
|
[-]
[+]
|
Changed |
_service:download_url:ncdu-1.11.tar.gz/src/dir_scan.c
^
|
@@ -1,6 +1,6 @@
/* ncdu - NCurses Disk Usage
- Copyright (c) 2007-2012 Yoran Heling
+ Copyright (c) 2007-2014 Yoran Heling
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -266,12 +266,6 @@
if(!dir_fatalerr && !(dir = dir_read(&fail)))
dir_seterr("Error reading directory: %s", strerror(errno));
- /* Special case: empty directory = error */
- if(!dir_fatalerr && !*dir) {
- dir_seterr("Directory empty");
- free(dir);
- }
-
if(!dir_fatalerr) {
curdev = (uint64_t)fs.st_dev;
d = dir_createstruct(dir_curpath);
|
[-]
[+]
|
Changed |
_service:download_url:ncdu-1.11.tar.gz/src/dirlist.c
^
|
@@ -1,6 +1,6 @@
/* ncdu - NCurses Disk Usage
- Copyright (c) 2007-2012 Yoran Heling
+ Copyright (c) 2007-2014 Yoran Heling
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -29,7 +29,8 @@
/* public variables */
-struct dir *dirlist_parent = NULL;
+struct dir *dirlist_parent = NULL,
+ *dirlist_par = NULL;
int64_t dirlist_maxs = 0,
dirlist_maxa = 0;
@@ -186,29 +187,33 @@
void dirlist_open(struct dir *d) {
+ dirlist_par = d;
+
/* set the head of the list */
- head_real = head = d == NULL ? NULL : d->parent == NULL ? d->sub : d->parent->sub;
+ head_real = head = d == NULL ? NULL : d->sub;
/* reset internal status */
dirlist_maxs = dirlist_maxa = 0;
/* stop if this is not a directory list we can work with */
- if(head == NULL) {
+ if(d == NULL) {
dirlist_parent = NULL;
return;
}
/* sort the dir listing */
- head_real = head = dirlist_sort(head);
+ if(head)
+ head_real = head = dirlist_sort(head);
/* set the reference to the parent dir */
dirlist_parent_alloc.flags &= ~FF_BSEL;
- if(head->parent->parent) {
+ dirlist_parent_alloc.flags |= FF_DIR;
+ if(d->parent) {
dirlist_parent = &dirlist_parent_alloc;
strcpy(dirlist_parent->name, "..");
dirlist_parent->next = head;
- dirlist_parent->parent = head->parent;
- dirlist_parent->sub = head->parent;
+ dirlist_parent->parent = d;
+ dirlist_parent->sub = d;
head = dirlist_parent;
} else
dirlist_parent = NULL;
|
[-]
[+]
|
Changed |
_service:download_url:ncdu-1.11.tar.gz/src/dirlist.h
^
|
@@ -1,6 +1,6 @@
/* ncdu - NCurses Disk Usage
- Copyright (c) 2007-2012 Yoran Heling
+ Copyright (c) 2007-2014 Yoran Heling
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -68,6 +68,9 @@
/* The 'reference to parent dir' */
extern struct dir *dirlist_parent;
+/* The actual parent dir */
+extern struct dir *dirlist_par;
+
/* current sorting configuration (set with dirlist_set_sort()) */
extern int dirlist_sort_desc, dirlist_sort_col, dirlist_sort_df;
|
[-]
[+]
|
Changed |
_service:download_url:ncdu-1.11.tar.gz/src/exclude.c
^
|
@@ -1,6 +1,6 @@
/* ncdu - NCurses Disk Usage
- Copyright (c) 2007-2012 Yoran Heling
+ Copyright (c) 2007-2014 Yoran Heling
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
|
[-]
[+]
|
Changed |
_service:download_url:ncdu-1.11.tar.gz/src/exclude.h
^
|
@@ -1,6 +1,6 @@
/* ncdu - NCurses Disk Usage
- Copyright (c) 2007-2012 Yoran Heling
+ Copyright (c) 2007-2014 Yoran Heling
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
|
[-]
[+]
|
Changed |
_service:download_url:ncdu-1.11.tar.gz/src/global.h
^
|
@@ -1,6 +1,6 @@
/* ncdu - NCurses Disk Usage
- Copyright (c) 2007-2012 Yoran Heling
+ Copyright (c) 2007-2014 Yoran Heling
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -55,6 +55,7 @@
#define ST_BROWSE 1
#define ST_DEL 2
#define ST_HELP 3
+#define ST_SHELL 4
/* structure representing a file or directory */
@@ -102,5 +103,6 @@
#include "help.h"
#include "path.h"
#include "util.h"
+#include "shell.h"
#endif
|
[-]
[+]
|
Changed |
_service:download_url:ncdu-1.11.tar.gz/src/help.c
^
|
@@ -1,6 +1,6 @@
/* ncdu - NCurses Disk Usage
- Copyright (c) 2007-2012 Yoran Heling
+ Copyright (c) 2007-2014 Yoran Heling
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -32,7 +32,7 @@
int page, start;
-#define KEYS 16
+#define KEYS 17
char *keys[KEYS*2] = {
/*|----key----| |----------------description----------------|*/
"up, k", "Move cursor up",
@@ -50,6 +50,7 @@
"e", "Show/hide hidden or excluded files",
"i", "Show information about selected item",
"r", "Recalculate the current directory",
+ "b", "Spawn shell in current directory",
"q", "Quit ncdu"
};
@@ -60,7 +61,7 @@
browse_draw();
nccreate(15, 60, "ncdu help");
- ncaddstr(13, 38, "Press q to continue");
+ ncaddstr(13, 42, "Press q to close");
if(page == 1)
attron(A_REVERSE);
|
[-]
[+]
|
Changed |
_service:download_url:ncdu-1.11.tar.gz/src/help.h
^
|
@@ -1,6 +1,6 @@
/* ncdu - NCurses Disk Usage
- Copyright (c) 2007-2012 Yoran Heling
+ Copyright (c) 2007-2014 Yoran Heling
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
|
[-]
[+]
|
Changed |
_service:download_url:ncdu-1.11.tar.gz/src/main.c
^
|
@@ -1,6 +1,6 @@
/* ncdu - NCurses Disk Usage
- Copyright (c) 2007-2012 Yoran Heling
+ Copyright (c) 2007-2014 Yoran Heling
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -32,7 +32,6 @@
#include <unistd.h>
#include <sys/time.h>
-#include <locale.h>
#include <yopt.h>
@@ -53,6 +52,7 @@
case ST_CALC: dir_draw(); break;
case ST_BROWSE: browse_draw(); break;
case ST_HELP: help_draw(); break;
+ case ST_SHELL: shell_draw(); break;
case ST_DEL: delete_draw(); break;
}
}
@@ -127,10 +127,12 @@
{ 1, 1, "--exclude" },
{ 'X', 1, "-X,--exclude-from" },
{ 'C', 0, "--exclude-caches" },
+ { 's', 0, "--si" },
{0,0,NULL}
};
dir_ui = -1;
+ si = 0;
yopt_init(&yopt, argc, argv, opts);
while((v = yopt_next(&yopt, &val)) != -1) {
@@ -146,6 +148,7 @@
printf(" -o FILE Export scanned directory to FILE\n");
printf(" -f FILE Import scanned directory from FILE\n");
printf(" -0,-1,-2 UI to use when scanning (0=none,2=full ncurses)\n");
+ printf(" --si Use base 10 (SI) prefixes instead of base 2\n");
printf(" --exclude PATTERN Exclude files that match PATTERN\n");
printf(" -X, --exclude-from FILE Exclude files that match any pattern in FILE\n");
printf(" --exclude-caches Exclude directories containing CACHEDIR.TAG\n");
@@ -156,6 +159,7 @@
exit(0);
case 'x': dir_scan_smfs = 1; break;
case 'r': read_only = 1; break;
+ case 's': si = 1; break;
case 'o': export = val; break;
case 'f': import = val; break;
case '0': dir_ui = 0; break;
@@ -251,7 +255,6 @@
/* main program */
int main(int argc, char **argv) {
- setlocale(LC_ALL, "");
read_locale();
argv_parse(argc, argv);
|
[-]
[+]
|
Changed |
_service:download_url:ncdu-1.11.tar.gz/src/path.c
^
|
@@ -1,6 +1,6 @@
/* ncdu - NCurses Disk Usage
- Copyright (c) 2007-2012 Yoran Heling
+ Copyright (c) 2007-2014 Yoran Heling
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
|
[-]
[+]
|
Changed |
_service:download_url:ncdu-1.11.tar.gz/src/path.h
^
|
@@ -1,6 +1,6 @@
/* ncdu - NCurses Disk Usage
- Copyright (c) 2007-2012 Yoran Heling
+ Copyright (c) 2007-2014 Yoran Heling
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
|
[-]
[+]
|
Added |
_service:download_url:ncdu-1.11.tar.gz/src/shell.c
^
|
@@ -0,0 +1,78 @@
+/* ncdu - NCurses Disk Usage
+
+ Copyright (c) 2007-2014 Yoran Heling
+ Shell support: Copyright (c) 2014 Thomas Jarosch
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+*/
+
+#include "config.h"
+#include "global.h"
+#include "dirlist.h"
+#include "util.h"
+
+#include <ncurses.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+void shell_draw() {
+ char *full_path;
+ int res;
+
+ /* suspend ncurses mode */
+ def_prog_mode();
+ endwin();
+
+ full_path = getpath(dirlist_par);
+ res = chdir(full_path);
+ if (res != 0) {
+ reset_prog_mode();
+ clear();
+ printw("ERROR: Can't change directory: %s (errcode: %d)\n"
+ "\n"
+ "Press any key to continue.",
+ full_path, res);
+ } else {
+ char *shell = getenv("SHELL");
+ if (shell == NULL)
+ shell = DEFAULT_SHELL;
+
+ res = system(shell);
+
+ /* resume ncurses mode */
+ reset_prog_mode();
+
+ if (res == -1 || !WIFEXITED(res) || WEXITSTATUS(res) == 127) {
+ clear();
+ printw("ERROR: Can't execute shell interpreter: %s\n"
+ "\n"
+ "Press any key to continue.",
+ shell);
+ }
+ }
+
+ refresh();
+ pstate = ST_BROWSE;
+}
+
+void shell_init() {
+ pstate = ST_SHELL;
+}
|
[-]
[+]
|
Added |
_service:download_url:ncdu-1.11.tar.gz/src/shell.h
^
|
@@ -0,0 +1,35 @@
+/* ncdu - NCurses Disk Usage
+
+ Copyright (c) 2007-2014 Yoran Heling
+ Shell support: Copyright (c) 2014 Thomas Jarosch
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+*/
+
+#ifndef _shell_h
+#define _shell_h
+
+#include "global.h"
+
+void shell_draw(void);
+void shell_init();
+
+#endif
|
[-]
[+]
|
Changed |
_service:download_url:ncdu-1.11.tar.gz/src/util.c
^
|
@@ -1,6 +1,6 @@
/* ncdu - NCurses Disk Usage
- Copyright (c) 2007-2012 Yoran Heling
+ Copyright (c) 2007-2014 Yoran Heling
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -28,10 +28,14 @@
#include <string.h>
#include <stdlib.h>
#include <ncurses.h>
+#include <stdarg.h>
+#ifdef HAVE_LOCALE_H
#include <locale.h>
+#endif
int winrows, wincols;
int subwinr, subwinc;
+int si;
char thou_sep;
@@ -57,17 +61,29 @@
char *formatsize(int64_t from) {
- static char dat[9]; /* "xxx.xMiB" */
+ static char dat[10]; /* "xxx.x MiB" */
float r = from;
char c = ' ';
- if(r < 1000.0f) { }
- else if(r < 1023e3f) { c = 'K'; r/=1024.0f; }
- else if(r < 1023e6f) { c = 'M'; r/=1048576.0f; }
- else if(r < 1023e9f) { c = 'G'; r/=1073741824.0f; }
- else if(r < 1023e12f){ c = 'T'; r/=1099511627776.0f; }
- else if(r < 1023e15f){ c = 'P'; r/=1125899906842624.0f; }
- else { c = 'E'; r/=1152921504606846976.0f; }
- sprintf(dat, "%5.1f%c%cB", r, c, c == ' ' ? ' ' : 'i');
+ if (si) {
+ if(r < 1000.0f) { }
+ else if(r < 1e6f) { c = 'K'; r/=1e3f; }
+ else if(r < 1e9f) { c = 'M'; r/=1e6f; }
+ else if(r < 1e12f){ c = 'G'; r/=1e9f; }
+ else if(r < 1e15f){ c = 'T'; r/=1e12f; }
+ else if(r < 1e18f){ c = 'P'; r/=1e15f; }
+ else { c = 'E'; r/=1e18f; }
+ sprintf(dat, "%5.1f %cB", r, c);
+ }
+ else {
+ if(r < 1000.0f) { }
+ else if(r < 1023e3f) { c = 'K'; r/=1024.0f; }
+ else if(r < 1023e6f) { c = 'M'; r/=1048576.0f; }
+ else if(r < 1023e9f) { c = 'G'; r/=1073741824.0f; }
+ else if(r < 1023e12f){ c = 'T'; r/=1099511627776.0f; }
+ else if(r < 1023e15f){ c = 'P'; r/=1125899906842624.0f; }
+ else { c = 'E'; r/=1152921504606846976.0f; }
+ sprintf(dat, "%5.1f %c%cB", r, c, c == ' ' ? ' ' : 'i');
+ }
return dat;
}
@@ -99,12 +115,13 @@
void read_locale() {
+ thou_sep = '.';
+#ifdef HAVE_LOCALE_H
+ setlocale(LC_ALL, "");
char *locale_thou_sep = localeconv()->thousands_sep;
- if (locale_thou_sep && 1 == strlen(locale_thou_sep)) {
+ if(locale_thou_sep && 1 == strlen(locale_thou_sep))
thou_sep = locale_thou_sep[0];
- } else {
- thou_sep = '.';
- }
+#endif
}
|
[-]
[+]
|
Changed |
_service:download_url:ncdu-1.11.tar.gz/src/util.h
^
|
@@ -1,6 +1,6 @@
/* ncdu - NCurses Disk Usage
- Copyright (c) 2007-2012 Yoran Heling
+ Copyright (c) 2007-2014 Yoran Heling
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -35,6 +35,9 @@
/* used by the nc* functions and macros */
extern int subwinr, subwinc;
+/* used by formatsize to choose between base 2 or 10 prefixes */
+extern int si;
+
/* Instead of using several ncurses windows, we only draw to stdscr.
* the functions nccreate, ncprint and the macros ncaddstr and ncaddch
|