Commit Graph

213 Commits

Author SHA1 Message Date
Yury V. Zaytsev 9932087cec Ticket #3836: maint - set default `--with-homedir` value to `.mc` instead of `yes`
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
Reviewed-by: Andrew Borodin <aborodin@vmail.ru>
2017-07-15 22:52:47 +02:00
Andrey Gursky 243cdc1755 Ticket #3821: initialize struct stat st_[acm]tim.tv_nsec when present
struct stat in libc for Linux kernel contains few fields more since 14+
years [1]. From bits/stat.h:

```
        struct timespec st_atim;		/* Time of last access.  */
        struct timespec st_mtim;		/* Time of last modification.  */
        struct timespec st_ctim;		/* Time of last status change.  */
    # define st_atime st_atim.tv_sec	/* Backward compatibility.  */
    # define st_mtime st_mtim.tv_sec
    # define st_ctime st_ctim.tv_sec
```

The conventional fields became an alias.

POSIX.1-2008 made struct stat st_[acm]tim mandatory [2].

OS takes care to initialize struct stat properly [3]. By not using an OS
syscall or a libc wrapper to fill struct stat, we have to take care of
initializing all fields (or at least those being used later) explicitly.

[1]: https://www.sourceware.org/ml/libc-alpha/2002-12/msg00011.html
[2]: https://www.sourceware.org/ml/libc-alpha/2009-11/msg00102.html
[3]: https://www.sourceware.org/ml/libc-alpha/2002-12/msg00013.html

Fixes: file timestamps not preserved (https://mail.gnome.org/archives/mc-devel/2017-April/msg00000.html)
Reported-By: Nerijus Baliunas <nerijus@users.sourceforge.net>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2017-05-17 21:18:58 +02:00
Mooffie e3cef7576b extfs: rpm: introduce the rpm2tags tool.
This is a preliminary step before being able to write tests for our rpm helper.

We introduce 'rpm2tags', a tool for converting RPM packages to parsable text
files. This will enable us to write tests that can run even where the 'rpm'
program isn't installed.

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-01-16 13:58:07 +02:00
Mooffie 69897e94fd Ticket #3753: extfs: tester: let test scripts easily access configure-time parameters.
We introduce a mechanism by which tests can easily access configure-time
parameters (like @PERL@, @AWK@, ...).

It works by "sourcing" a file named config.sh (residing in the build tree):

    . "$MC_TEST_EXTFS_CONFIG_SH"
    $PERL -e 'print "hello"'

(Although config.sh has a shell syntax, Perl and Python programs too can
benefit from it, because it can be sourced into an .env_vars file and the
values exported from there.)

Of course, one can also use the traditional method, of *.in files listed in
configure.ac, but the mechanism introduced here is a more comfortable approach.

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-01-15 20:10:01 +02:00
Mooffie 4a559344fb Ticket #3708: fix usability problems with `--enable-tests`
Signed-off-by: Mooffie <mooffie@gmail.com>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-12-27 16:46:38 +04:00
Andrey Gursky 4c418047b2 Ticket #3575: preserve timestamps with nanosecond precisions during file copy
MC truncates timestamps during file copy and drops sub-second precision.

Make use of utimensat(), introduced in Linux kernel 2.6.22 (and since
2.6.26 compatible with POSIX-1.2008).

Signed-off-by: Andrey Gursky <andrey.gursky@e-mail.ua>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-12-25 08:46:10 +03:00
Andrew Borodin 9764511b08 Move extfs tester from tests/src/extfs-helpers-listcmd into tests/src/vfs/extfs/helpers-list.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-12-19 09:39:15 +03:00
Mooffie 13a805bd79 Ticket #3730: extfs: introduce a command-line tool for parsing file lists.
We introduce 'mc_parse_ls_l', a tool for parsing file-listings in format
similar to that of 'ls -l'. This format is used by the various extfs helpers.

We'll use this tool, in the next commit, to build a tester.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-12-14 13:15:29 +03:00
Andrew Borodin 9a39e35dc3 Use g_assert() instead of assert(3).
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-11-21 13:12:55 +03:00
Andrew Borodin b22e376abf Fix typos. 2016-09-11 11:11:01 +03:00
Andrew Borodin 406765f044 Ticket #1885: minimal gettext version is 0.18.1.
Since 0.18.1, the 'autopoint' program uses the 'git' program instead of
'cvs' one by default.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-04-28 09:25:18 +03:00
Andrew Borodin e7c01c7781 Ticket #2193: use Coreutils way to define buffer size to copy file.
m4.include/stat-size.m4, lib/stat-size.h: get these files from Gnulib.
src/filemanager/ioblksize.h: get this file from Coreutils.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-04-25 13:12:51 +03:00
Mooffie 0e89375772 Ticket #3617: (mc_open): handle varargs mode_t promotion issue.
On systems where 'mode_t' is smaller than 'int', doing 'va_arg (ap, mode_t)' is
wrong because of C's "default argument promotions". GCC 4 creates crashing code
in this case.

The "va_arg" page of Gnulib's manual describes the problem and a simple solution:

    https://www.gnu.org/software/gnulib/manual/html_node/va_005farg.html

However, since that solution reportedly (see thread at next link) still causes
GCC to print warnings (for no good reason; perhaps this was fixed in newer
GCCs), we pick a solution that defines a PROMOTED_MODE_T at the configuration
stage:

    https://lists.gnu.org/archive/html/bug-gnulib/2009-05/msg00231.html

(We take our 'mode_t.m4' from the most recent Gnulib source.)

(If any of the URLs above no longer works, simply search the web for the
mentioned words.)
2016-03-28 08:59:14 +03:00
Yury V. Zaytsev fff8b4dd7a Delete outdated and unmaintained `mc.menu.sr.in`
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-03-08 20:43:05 +01:00
Andrew Borodin 0eae2cb8dc Unify m4 macro names.
Macros get from other projects keep their original names:
gl_FSTYPENAME, AX_PATH_LIB_PCRE, etc.

Macros initially writtem for MC have original names with prefix mc_:
mc_VERSION, mc_CHECK_GLIB, etc

Macros get from other projects and modified for MC keep their
original names with prefix mc_:
mc_cu_PREREQ_STAT_PROG, mc_AC_GET_FS_INFO.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-03-04 09:23:36 +03:00
Slava Zanko 974ab368ec Ticket #3547: code cleanup before 4.8.16 release.
Move subshell stuff into subdir.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2016-01-01 11:48:06 +03:00
Andreas Mohr 8a2f9e253d Ticket #3430: introduce -Wundef check to catch macro typos.
Use always defined MC_HOMEDIR_XDG macro.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2015-05-03 19:43:48 +03:00
Slava Zanko d3e80d0c46 Ticket #3243: "User menu -> View manual page" doesn't do coloring
Rename menu.mc and menu.mc.sr for substitute variables from configure.ac file

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2014-09-04 13:01:40 +03:00
Andrew Borodin 14973bfe79 Use AC_HEADER_MAJOR.
Instead of checking for sys/mkdev.h headerfile, there is the
AC_HEADER_MAJOR helper for how to get major(), minor(), makedev().

Sinc with GLib efb1701bf3baf6f5b05fd1a7a5a4ff990a7dc460.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-11-25 13:47:40 +04:00
Sergei Trofimovich d362fc964e Ticket #3029: configure.ac: warning about unknown '--with-' / '--enable-' options.
As we use 'AC_CONFIG_SUBDIRS' macro for samba sources option checking is
disabled for us.

Before the patch:

    $ ./configure --with-i-have-misspelled-editor-for-edit
    ...
    # no warnings

The patch enables warnings back only for top-level ./configure:

    $ ./configure --with-i-have-misspelled-editor-for-edit
    ...
    configure: WARNING: unrecognized options: --with-i-have-misspelled-editor-for-edit

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
2013-09-05 14:44:51 +04:00
Andrew Borodin 5260d6612c Ticket #2995: do not link GModule if it is not required (save space on embedded systems).
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-08-02 21:53:17 +04:00
Andrew Borodin 45d8b20ad9 --with-edit: rename to --with-internal-edit.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-07-02 15:29:35 +03:00
Adrian Bunk 73588a1a59 Ticket #2998: configure.ac cleanups.
Remove tests whose results are not used:
  * AC_CHECK_HEADERS of unistd.h, fcntl.h, sys/time.h, sys/types.h
  * AC_HEADER_MAJOR
  * AC_HEADER_TIME
  * AC_HEADER_DIRENT
  * AC_CHECK_FUNCS of isascii, statfs, sysconf, tcgetattr, tcsetattr, ftruncate
  * AC_FUNC_STRCOLL

AC_C_CONST is obsolete, today it is safe to assume all C compilers
support at least C89.

The INTERACTIVE UNIX that needed AC_ISC_POSIX is long dead.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-03 10:58:14 +03:00
Slava Zanko 389b55ae6f Add the hint-files synchronization with Transifex.
For upload English hint-file to transifex, type:
cd doc/hints/po && make to-transifex

For download translation from Transifex type:
cd doc/hints/po && make from-transifex && \
    git add ../l10n/mc.hints.* && \
    git commit -s -m 'Update hints files from Transifex'

WARNING! For the functionality you should have installed 'tx' and 'po4a'
utilities. These utilities isn't required for compile and install mc
(you may install these utilities only if you want to interact with Transifex).

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-04-02 11:24:16 +03:00
Slava Zanko d0345661d8 Add tests for coverage the bug.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-03-28 16:50:28 +04:00
Slava Zanko 808988b1f1 Add lib/strutil/replace:str_replace_all() function.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-02-16 17:40:37 +03:00
Slava Zanko 9935acea33 Ticket #55: savannah: tab completion vs. spaces and escaping
* Split big functions.
* Add unit tests

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-02-04 15:29:15 +03:00
Andrew Borodin 17cadc50ec Portability: use g_ascii_strtoll instead of strtoll, atoll and atof.
Set minimal version of GLib up to 2.12 because of g_ascii_strtoll.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-12-20 15:35:35 +04:00
Andrew Borodin 1d3132c08f Clarify of sig_atomic_t usage (got from Mutt).
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-11-09 10:05:13 +04:00
Andrew Borodin b2f97443e2 Refactoring of subshell support.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-10-21 18:19:47 +04:00
Andrew Borodin a8b8cdcc47 Use AC_MSG_NOTICE to print configure results.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-10-20 15:39:44 +04:00
Andrew Borodin d27a4f86ea Ticket #2888: cleanups in master branch.
Check perl, python and ruby programs and substitute them in various files.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-10-20 15:39:44 +04:00
Adrian Bunk adbb6492ec Ticket #2871: remove the empty contrib/dist/debian/
It was empty and the up-to-date Debian packaging is anyway
maintained separately in Debian.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-09-27 17:17:03 +04:00
Andrew Borodin 48846a3b37 Ticket #2888: cleanups in master branch.
Fix of exec_prefix expansion and usage.

Some distros use autoconf site scripts resourced via $CONFIG_SITE
environment varaible. That scripts are defined variable libexecdir
as

libexecdir='${exec_prefix}/lib'

In this case, EXTHELPERSDIR variable is generated wrongly, because
the 'exec_prefix' variable isn't expanded.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-09-27 17:17:03 +04:00
Andrew Borodin c34fdcf946 Reorder checks in configure.ac.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-09-10 14:29:52 +03:00
Slava Zanko 43e4938a09 Ticket #2864: New implementation of uc1541 VFS
Due to date formatting, uc1541 extfs plugin is unusable, even tough the date formatting,
which is the one cause of the problem is coherent with the attached documentation (MM-DD-YYYY hh:mm).

Another problem with uc1541 script is connected rather with legal characters used in filename
rather than with script itself - in PET ASCII it is perfectly fine to use slash "/" character
in filenames, and as a side effect all files containing slash inside d64 image are represented
as directories on MC.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-09-05 14:29:53 +03:00
Andrew Borodin 596203f9a9 Ticket #2849: bad EXTHELPERSDIR substitution if --prefix is not used.
If --prefix is not set in command line, EXTHELPERSDIR was expanded to
NONE/libexec/mc/ext.d in misc/mc.ext and misc/ext.d/Makefile.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-08-06 13:21:05 +04:00
Ilia Maslakov 1d4ca9608a Ticket #2788 (aspell support)
Add aspell support for internal editor.
The aspell library is dinamycally loaded.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2012-07-12 16:00:45 +04:00
Andrew Borodin 3cf76f69bf Ticket #2825: obtain FS name from stat info: sync with coreutils.
src/filemanager/filegui.c does not compile on Solaris due to missing macros.
AVE_STRUCT_STATVFS_F_BASETYPE and HAVE_STRUCT_STATVFS_F_FSTYPENAME macros
are not set or even defined in config.h. configure scrips does not even
check for those members.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-07-02 20:50:19 +04:00
Slava Zanko 7e44bfb32d Fixed libexec hardcoded value
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-06-29 13:14:29 +03:00
Slava Zanko da03697e84 Ticket #1535: SFTP support
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-06-21 14:29:32 +03:00
Molnár Károly 06285250aa Ticket #2751: Support *.lib artifacts generated by gputils utility
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-06-12 14:35:48 +03:00
Slava Zanko ec7aafef83 Use xdg-open by default in mc.ext.in if present to open files,
fallback on current scheme otherwise.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-05-18 13:06:20 +03:00
Slava Zanko cd1f7773b1 Ticket #2692: Date not set properly in manpage
After installing mc-4.8.1 the footer of the manpage says:
MC Version VER @DATE_OF_MAN_PAGE@ MC(1)

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-04-02 13:43:19 +03:00
Andrew Borodin c7bde637f9 Tweak background operations support.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-03-19 11:04:57 +03:00
Andrew Borodin f7f37f674e Check assert.h header and use it conditionally.
assert(3) should be replaced with g_assert().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-03-19 11:04:57 +03:00
Andrew Borodin 49dd358a16 Removed check of unused functions.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-03-19 11:04:57 +03:00
Andrew Borodin 1b4df2bdd2 Removed check of unused header files.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-03-19 11:04:57 +03:00
Andrew Borodin e2b67a33ba Ticket #2740: code cleanup before 4.8.2 release.
Removes references to AC_HEADER_STDC macro, marked as obsolescent
in the Autoconf 2.60 release.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-03-19 11:04:56 +03:00
Andrew Borodin ec476d0b88 Added tests for examine_cd() function.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-02-24 09:39:04 +03:00