Commit Graph

310 Commits

Author SHA1 Message Date
Andrew Borodin
67ec86b570 Ticket #4141: allow compound (AND) conditions in mc.ext
...to disambiguate overloaded extensions

Initial commit:
  * rename macro for mc.ext file: MC_FILEBIND_FILE -> MC_EXT_FILE.
  * (ext_cmd): fix errorous usage of MC_LIB_EXT macro. Use MC_EXT_FILE
    instead.
  * (regex_command_for): likewise. Use already existing variable
    extension_file, remove variable filebind_filename.
  * MC_LIB_EXT: remove macro.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-08-28 11:10:39 +03:00
Steef Boerrigter
e370818c09 Ticket #400: support multi-line search.
In order to use multiline search, select "Regular expression" mode and
use "\n" in the input line:

For example, if file contains lines

aaa
bbb

search string should be "aaa\nbbb".

As a side effect, non-printable ASCII symbols (\r, \t, etc) in the
search string can be used too.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-08-14 18:02:23 +03:00
Andrew Borodin
12543835f9 (edit_init): change argument for coordinates.
Use WRect instead of four values.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 11:56:31 +03:00
Andrew Borodin
390d614b5e (group_init): change argument for coordinates.
Use WRect instead of four values.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 11:55:06 +03:00
Andrew Borodin
ccdc909105 (widget_init): change argument for coordinates.
Use WRect instead of four values.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 11:55:03 +03:00
Andrew Borodin
5fae2313f3 Widget: use WRect to hold position and size.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 11:49:20 +03:00
Andrew Borodin
bf0dd8efb1 WInput: use GString for buffer.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 11:28:51 +03:00
Adam Sampson
7435010d29 Ticket #4358: tests/lib/strutil/filevercmp.c: variable redeclaration.
(filevercmp_test5): rename variables. START_TEST macro uses the variable
name _i, so GCC complains about redefining it with a different type
here.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 11:23:37 +03:00
Andrew Borodin
dc67246c27 Ticket #4374: fix file sort by version.
filevercmp: don't treat entire filename as suffix.

Sync with gnulib 1ba2b66ea45f9bc43cdc0f6f93efa59157d2b2ba.

(file_prefixlen): When stripping (\.[A-Za-z~][A-Za-z0-9~]*)*$ suffixes,
do not strip the entire file name.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-04 09:01:43 +03:00
Andrew Borodin
7408272361 filevercmp: fix several unexpected results.
Sync with gnulib 9f48fb992a3d7e96610c4ce8be969cff2d61a01b.
Problems reported by Michael Debertol in <https://bugs.gnu.org/49239>.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:27 +03:00
Andrew Borodin
d00a1c22b9 tests/lib/strutil/filevercmp.c: use _GL_CMP() to get sign.
tests/lib/strutil/str_verscmp.c: likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:27 +03:00
Andrew Borodin
39e7a048f7 tests/lib/strutil/filevercmp.c: minor improvements.
Use ck_assert_int_lt() and ck_assert_int_gt() to check integer values.

Increase minimal version of Check up to 0.9.10.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:27 +03:00
Andrew Borodin
4f22598c9a Tests: clarification of boolean values tests.
Use mctest_assert_true and mctest_assert_false macros to check boolean
values.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:27 +03:00
Andrew Borodin
f411d44fea Tests clean up.
Remove mc-specific macros mctest_assert_int_eq and mctest_assert_int_ne.
Use ck_assert_int_eq() and ck_assert_int_ne() functions respectively.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:27 +03:00
Andrew Borodin
2c205c5928 Update copyright years.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:26 +03:00
Andrew Borodin
89d8fa4ac1 Ticket #1: remove SMB suport.
The mc's built-in samba library which is used to access data across
smb links is taken from an old samba version.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-09-26 10:03:49 +03:00
Andrew Borodin
b77961a14d mcedit: move all completion-related stuff to editcomplete.[ch].
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 16:16:45 +03:00
Andrew Borodin
de16ae9180 Use G_OPTION_ENTRY_NULL macro.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:56 +03:00
Andrew Borodin
2cd33ad0d5 Convert widget coordinates from global to local and vice versa.
Add two widget callbacks:
  * (make_global): convert widget coordinates from local (relative to
    owner) to global (screen).
  * (make_local): convert widget coordinates from global (screen) to
    local (relative to owner).

Such conversions are required when nested widgets and groups are added to
or removed from another groups.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:56 +03:00
Andrew Borodin
4df5bbf9ef Fix indentation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 20:15:00 +03:00
Andreas Mohr
fa8c5e1c37 libcheck: replace deprecated fail_unless() function.
libcheck fail_unless() is deprecated since 0.10.0.
Also fix -Wformat-extra-args warnings.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:57:25 +03:00
Andreas Mohr
da97a2a626 libcheck: replace deprecated fail() function.
libcheck fail() is deprecated since 0.10.0.
Also fix -Wformat-extra-args warnings.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:57:25 +03:00
Andreas Mohr
79fb2be8d1 (hex_translate_to_regex.c): fix maybe-uninitialized warning.
hex_translate_to_regex.c: In function 'test_hex_translate_to_regex_fn':
hex_translate_to_regex.c:172:9: error: 'error' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  172 |         mctest_assert_int_eq (error, data->expected_error);
      |         ^
hex_translate_to_regex.c:154:33: note: 'error' was declared here
  154 |     mc_search_hex_parse_error_t error;
      |                                 ^

Found by gcc-9.3.0

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:57:24 +03:00
Andreas Mohr
7b9c9564e8 Fix lto-type-mismatch warning.
Found by gcc-9.3.0.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:57:24 +03:00
Andrew Borodin
d88f439a69 (mc_g_string_dup): new API that extends GString one.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:57:24 +03:00
Andrew Borodin
6f859e52d0 (file_entry_t): use GString instead of fname & fnamelen.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:52:39 +03:00
Andrew Borodin
536fb676d8 (vfs_path_free): add 2nd parameter...
...to free or not to free the string representation
of vfs_path_t object.

It allows to get rid of string duplication in following cases:

vfs_path_t *vpath;
char *path;
...
vpath = vfs_path_from_str (...);
path = g_strdup (vfs_path_as_str (vpath));
vfs_path_free (vpath);

Now we can write:

vfs_path_t *vpath;
char *path;
...
vpath = vfs_path_from_str (...);
path = vfs_path_free (vpath, FALSE);

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:52:39 +03:00
Andrew Borodin
0c02118fad Define macros for bashrc, ashrc, and inputrc files.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:52:38 +03:00
Andrew Borodin
9ee52e77c3 Ticket #4179: code clean up before 4.8.27 release.
Update copyright years.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:30:42 +03:00
Andrew Borodin
a10bf6a244 (mc_pstream_get_string): new API.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:17:08 +03:00
Andrew Borodin
6cc697beff Add test for new ftp parser.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:02:12 +03:00
Andrew Borodin
76847e08fd Ticket #4203: support custom .zshrc.
Custom .zshrc file is  ~/.local/share/mc/.zshrc.

If ZDOTDIR environment variable is not set, set it to ~/.local/share/mc
if a .zshrc is found there. It is the only way to point zsh to an other
rc file than the default.

Thanks Sebastian Gniazdowski <sgniazdowski@gmail.com> for the original
patch.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-13 20:17:31 +03:00
Andrew Borodin
285eb5c186 Ticket #3682: drop automatic migration of configuration
...from ~/.mc to XDG-base.

Now MC ignores ~/.mc directory and uses XDG-based only.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-02-22 21:16:52 +03:00
Andrew Borodin
ba6b42802f Ticket #4154: support unrar v6.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-02-13 16:52:07 +03:00
Andreas Mohr
631cf4f3bf Ticket #3986: tests: do not write parallel to logfile.
Since automake-1.12 (test-driver script) libcheck logfile is written
parallel by automake.
Print test logging to stdout and let write to logfile by automake only.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-02-07 20:58:45 +03:00
Andrew Borodin
2420b7180b editor: completing from all open files.
Thanks Sebastian Gniazdowski <sgniazdowski@gmail.com> for the original
patch.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-02-07 20:37:36 +03:00
Andrew Borodin
29720d04ab editor: word completion: refactoring.
(edit_collect_completions): return GQueue. Use GQueue inside.
Do not return an empty queue, create it if needed only.

(edit_complete_word_cmd): Use GQueue inside. Ged rid of limitation
of completions count. Rename variable.

(editcmd_dialog_completion_show): take GQueue. Rename and reorder
arguments.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-02-07 20:37:13 +03:00
Andrew Borodin
c1ed403c02 tests/lib/strutil/Makefile.am: remove unsed include path.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andrew Borodin
d37dbcca4c Move cd_to() to separate file.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andrew Borodin
344af14029 Refactoring: rename functions
_do_panel_cd -> panel_do_cd_int
do_panel_cd -> panel_do_cd
do_cd -> panel_cd
do_cd_command -> cd_to

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andrew Borodin
e3519f8966 (do_cd_command): refactoring: get path only
...instead of command "cd path".

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andrew Borodin
6f96cad1ca (examine_cd): return GString.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:47 +03:00
Andrew Borodin
819e0908f6 src/filemanager/ext.c: minor refactoring.
(exec_get_export_variables): return GString.
(exec_make_shell_string): likewise.
(exec_extension): exec_get_export_variables() and
exec_make_shell_string() retur GString now.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:46 +03:00
Andrew Borodin
0e272b9e90 (do_cd): get rid of global variable current_panel usage...
...and related changes.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:46 +03:00
Andrew Borodin
41a35b9b8a Rename files:
src/filemanager/midnight.[ch] -> src/filemanager/filemanager.[ch].

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:46 +03:00
Andrew Borodin
78893d85b8 Drop mc_timer. Use g_get_real_time() instead.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-12 20:39:01 +03:00
Andrew Borodin
fc26346cdb tests: extfs/zip: file names with leading space or dash.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-11-21 14:48:06 +03:00
Andrew Borodin
03b9af4e5d Revert "urar extfs: don't start path with ./ in file list."
This reverts commit 6dc337ff90.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-11-21 14:48:06 +03:00
Andrew Borodin
b814b3dd02 extfs/uzip: add leading ./ to file name
...to handle files with name started with space or dash.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-11-21 14:48:06 +03:00
Andrew Borodin
562889ce1e Rename macro MC_SKINS_SUBDIR to MC_SKINS_DIR.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:19 +03:00
Andrew Borodin
b65a951ee4 Clean up files unused by mcedit anymore.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:19 +03:00
Andrew Borodin
81b1f47e01 Rename macros with editor-related file locations.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:19 +03:00
Andrew Borodin
a94dd7d2de VFS GC: use mc_timer.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:18 +03:00
Andrew Borodin
e9d23e90f0 Find widget API: support groups.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-03-08 20:13:33 +03:00
Andrew Borodin
fdf3d9c3b7 WGroup: implement init & destroy.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-03-08 20:12:45 +03:00
Andrew Borodin
31b37a1f79 Ticket #4050: code cleanup before 4.8.25 release.
Update copyright years.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-02-29 19:10:17 +03:00
Andrew Borodin
851d2022a9 (hotkey_equal): new hotkey API.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-12-15 13:02:31 +03:00
Andrew Borodin
68d9961977 Ticket #4022: fix compile failure on AIX 7.2.
Rename MC VFS flags to avoid name conflicts with system-wide VFS flags
on some OSes (such as AIX).

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-11-18 21:27:56 +03:00
Andrew Borodin
6dc337ff90 urar extfs: don't start path with ./ in file list.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-09-29 15:11:53 +03:00
Enrico Weigelt, metux IT consult
3470cdf76f tests: add .gitignore
Don't wanna accidentially add autogenerated files to the git repo,
so ignore them.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-09-01 20:13:52 +03:00
Andrew Borodin
2b982dc6dc tests: editcmd__edit_complete_word_cmd.c: override mc_refresh()
...after refactoring of SIGWINCH handling
(37ffc02422).

Replacing variable with pipe cause a timeout in original tty_got_winch()
in this test and test fails. Use an empty replacement of mc_refresh().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-09-01 19:58:06 +03:00
Andrew Borodin
0efb799db3 lib/mcconfig: fix coding style; apply source file template.
Unconstify some function arguments.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-09-01 19:41:12 +03:00
Andrew Borodin
01a1a01d4e Rename VFS module initialization functions.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-06-15 17:43:00 +03:00
Andrew Borodin
7d80e8a175 Always use vfs_s_subclass as base class for VFS modules.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-06-15 17:43:00 +03:00
Andrew Borodin
4f06ba9346 Ticket #3971: clarify sighandler_t usage in non-GNU OSes.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-06-15 09:38:53 +03:00
Andrew Borodin
3e08cc7226 VFS: derive VFS-specific super class from vfs_s_super.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-04-27 19:29:24 +03:00
Andrew Borodin
d51f1f4963 VFS: refactor VFS unit initialization.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-04-27 19:29:24 +03:00
Andrew Borodin
672ba46c8b VFS: make vfs_class and vfs_s_subclass related macros more readable.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-04-27 19:29:24 +03:00
Andrew Borodin
0fbd98fece Join vfs_class_flags_t and vfs_subclass_flags_t.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-04-27 19:29:24 +03:00
Andrew Borodin
c764d60238 VFS: (vfs_s_subclass): derive from vfs_class.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-04-27 19:29:24 +03:00
Andrew Borodin
f11c78f9d0 (vfs_unregister_class): new API.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-04-27 19:29:24 +03:00
Andrew Borodin
c97893279c tests: fix comments.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-04-27 19:29:24 +03:00
Andrew Borodin
acc0bbdfbf tests/lib/strutil/parse_integer.c: use macros, fix comments.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-04-27 19:29:24 +03:00
Andrew Borodin
e1461bcfd3 tests: fix memory leaks.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-04-27 19:29:24 +03:00
Andrew Borodin
d6ed25d143 tests: set up writable directory to allow create temporary files.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-04-27 19:29:24 +03:00
Andrew Borodin
5454a1c740 Fix indentation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-03-10 11:55:45 +03:00
Andrew Borodin
a2a5fa017e Fix file version sort.
Use filevercmp() instead of str_verscmp().
Source code of filevercmp() is taken from Gnulib.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-03-02 11:24:07 +03:00
Andrew Borodin
2163009270 Ticket #3905, 3956: fix file version sort.
* Update str_verscmp implementation: sync with Gnulib.
  * Add tests. Testcases are taken from Gnulib.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-02-20 15:42:53 +03:00
Andrew Borodin
aa9d18e3ed (examine_cd): refactoring: use GString.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-02-03 12:47:59 +03:00
Andrew Borodin
1dd8a47987 Ticket #3955: code cleanup before 4.8.23 release.
Update copyright years.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-02-03 12:44:40 +03:00
Yury V. Zaytsev
b44bfee6bf Ticket #3789: remove faulty test in rpm helper to detect CONFLICTS tag
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2018-05-27 15:17:31 +02:00
Yury V. Zaytsev
b692136645 maint: fix test fixtures for extfs rpm helper (broken in 8d0c1c3)
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2018-05-27 15:00:38 +02:00
Andrew Borodin
ddd645526a Update copyright years. 2018-02-04 11:30:22 +03:00
Andrew Borodin
a38accd389 (mc_realpath): ignore path encoding.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-02-04 11:30:22 +03:00
Andrew Borodin
3ae7ad4449 tests: fix DSO link error in case of --enable-mclib.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-02-04 11:30:22 +03:00
Yury V. Zaytsev
f0414be51d Zero struct stat tv_nsec (if supported) whenever st is filled manually
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2017-05-17 21:18:58 +02:00
Mooffie
e2f5034303 Ticket #3786: extfs: rpm: fix test's "expected output".
As will be explained in a following commit, our rpm helper has a bug stemming
from the use of 'echo'.

Before we fix it, we update the test's "expected output" to reflect the
intended output (as it's currently reflects a faulty output).

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-03-09 01:03:34 +02:00
Mooffie
d0131271f3 Ticket #3787: extfs: tests for helpers using 'sort' may fail.
The "expected output" files we provide must be generated in the same locale the
tester (that is, the helpers) are run. Otherwise helpers using the 'sort'
utility may generate output different than our provided "expected output",
hence failing the tests.

Therefore we:

(1) Regenerate the "expected output" files in the C locale.

(2) Make sure the tester is run in the C locale.

(Tip: to regenerate the "expected output" files we deleted all the *.output
files and run the tester with "LC_ALL=C ./run --create-output".)

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-03-08 14:01:46 +02:00
Mooffie
f782b037d8 extfs: tester: fix indentation.
No code is modified here. Only whitespace.

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-03-08 11:34:09 +02:00
Mooffie
55624eae3b Ticket #3784: extfs: add diff output to tester.
Signed-off-by: Mooffie <mooffie@gmail.com>
2017-03-07 23:57:35 +02:00
Yury V. Zaytsev
ab4fcb6d30 Revert "Ticket #3687: store the 'hotlist' file in data dir, not config dir."
This reverts commit 306b30ed30.
2017-02-24 21:32:01 +01:00
Andrew Borodin
e9fd11bfcd Update copyright years.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-22 19:12:55 +03:00
Mooffie
65299b8310 extfs: rpm: fix tests for transaction scripts.
We update our .output file to include the entries
`INFO/SCRIPTS/{PRE,POST}TRANS[PROG]`, which the rpm helper now emits.

(Tip: here's how we do this: we delete the output file and recreate it by
running the tester thus: "./run --create-output".)

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-01-16 17:14:38 +02:00
Mooffie
a3b9b95c2d extfs: rpm: move misc/* to misc/rpm/*.
In the future we will probably place each helper's tests in a separate folder.
We'll then get rid of this 'misc/rpm' folder by moving it there.

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-01-16 13:58:07 +02:00
Mooffie
b10f34e898 extfs: rpm: add test for a custom package.
We use a 'spec' contributed by Jiri Tyr.

We keep the previous test (by renaming rpm.* to rpm.glib.*), though, in case
somebody wants to work on data from "the real world".

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-01-16 13:58:07 +02:00
Mooffie
4b8785ead6 extfs: rpm: add tests.
Signed-off-by: Mooffie <mooffie@gmail.com>
2017-01-16 13:58:07 +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
f42bdb1261 extfs: tester: improve HTML documentation output.
- We now have 4'th level headers: adjust --doc-depth.
- We have many short sections: highlight the active section's header.

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-01-15 19:43:45 +02:00
Mooffie
e4e4b214b4 extfs: tester: export some more useful variables.
New environment variables:

- MC_TEST_EXTFS_DATA_DIR
- MC_TEST_EXTFS_INPUT

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-01-15 19:43:40 +02:00