Commit Graph

13867 Commits

Author SHA1 Message Date
Sergei Trofimovich
bc8eb09256 vfs/tar/tar.c: add makedev() declaration
Noticed as a build failure on gentoo/glibc-2.24 as:

      CCLD     mc
    ./.libs/libinternal.a(tar.o): In function `tar_fill_stat':
    /home/slyfox/dev/git/mc/src/vfs/tar/tar.c:428: undefined reference to `makedev'
    collect2: error: ld returned 1 exit status

The change uses "lib/unixcompat.h" to pull
'makedev()' declaration from proper header.

Signed-off-by: Sergei Trofimovich <siarheit@google.com>
2017-01-22 17:05:39 +00:00
Andrew Borodin
9845fa6ce5 Merge branch '3693_cleanup'
* 3693_cleanup: (22 commits)
  Update copyright years.
  (tar_fill_stat): add omitted breaks.
  Aggressive use of whitespace() and whiteness() macros.
  WCheck, WRadio: send MSG_MOTIFY without parameter.
  Fish shell integration: ignore mc's prompt in history.
  (tty_color_get_name_by_index): cleanup format compiler warning.
  Cleanup comma compiler warnings.
  (sftpfs_open_file): GCC zero initialization bug workaround.
  Cleanup maybe-uninitialized compiler warnings.
  (mc_search__g_regex_match_full_safe): don't use negative string length.
  mcedit: syntax.syntax: highlight comments preceded by spaces.
  misc/syntax/Syntax.in: fix patterns.
  Use g_queue_free_full().
  (mc_search__cond_struct_new_regex_ci_str): add documentation.
  option_auto_syntax: change type to gboolean.
  src/setup.c: minor refactoring of main options load.
  setup: split integer and boolean options.
  Change type from int to gboolean for variables controlled by checkboxes.
  WCheck: change type of 'state' from int to gboolean.
  WCheck: remove unused C_CHANGE.
  ...
2017-01-22 19:13:49 +03:00
Andrew Borodin
e9fd11bfcd Update copyright years.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-22 19:12:55 +03:00
Andrew Borodin
b9085cc1c8 (tar_fill_stat): add omitted breaks.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-22 18:45:56 +03:00
Andrew Borodin
28ca14d73a Aggressive use of whitespace() and whiteness() macros.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-22 18:44:22 +03:00
Andrew Borodin
e0c02c9c77 WCheck, WRadio: send MSG_MOTIFY without parameter.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-22 18:44:22 +03:00
Fabian Homborg
4e74d7d255 Fish shell integration: ignore mc's prompt in history.
Fish does something equivalent to bash's "HISTCONTROL=ignoreboth" by default,
so simply prefixing a command with a space will let it be ignored.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-22 18:44:22 +03:00
Andreas Mohr
469dc1352b (tty_color_get_name_by_index): cleanup format compiler warning.
Found by GCC 6.2.0.

color-internal.c:186:33: error: format '%X' expects argument of type 'unsigned int', but argument 3 has type 'int' [-Werror=format=]

Signed-off-by: Andreas Mohr <and@gmx.li>
2017-01-22 18:44:22 +03:00
Andreas Mohr
238d3ac53c Cleanup comma compiler warnings.
Found by Clang 3.9.0.

Signed-off-by: Andreas Mohr <and@gmx.li>
2017-01-22 18:44:22 +03:00
Andrew Borodin
04c1eb6160 (sftpfs_open_file): GCC zero initialization bug workaround.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-22 18:44:22 +03:00
Andreas Mohr
8f304f558d Cleanup maybe-uninitialized compiler warnings.
Found by GCC 6.2.0.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-22 18:44:22 +03:00
Andrew Borodin
37de8e6253 (mc_search__g_regex_match_full_safe): don't use negative string length.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-22 18:44:22 +03:00
Mooffie
2e078ff774 mcedit: syntax.syntax: highlight comments preceded by spaces.
Comments don't have to start at the 1st column. We add support for this case.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-22 18:44:22 +03:00
Andrew Borodin
079d989877 misc/syntax/Syntax.in: fix patterns.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-22 18:44:22 +03:00
Andrew Borodin
1ff4005228 Use g_queue_free_full().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-22 18:44:22 +03:00
Mooffie
c0abaa6508 (mc_search__cond_struct_new_regex_ci_str): add documentation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-22 18:44:22 +03:00
Andrew Borodin
d078ae4713 option_auto_syntax: change type to gboolean.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-22 18:44:22 +03:00
Andrew Borodin
cd3a5ee373 src/setup.c: minor refactoring of main options load.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-22 18:44:22 +03:00
Andrew Borodin
8b14798cc4 setup: split integer and boolean options.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-22 18:44:22 +03:00
Andrew Borodin
c4550374b2 Change type from int to gboolean for variables controlled by checkboxes.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-22 18:44:22 +03:00
Andrew Borodin
5e2f4a8069 WCheck: change type of 'state' from int to gboolean.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-22 18:44:22 +03:00
Andrew Borodin
76ee3b1644 WCheck: remove unused C_CHANGE.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-22 18:44:22 +03:00
Andrew Borodin
d7ecbd51cf (radio_callback): cosmetics.
* [MSG_HOTKEY]: remove extra block.
 * [MSG_KEY]: do not fall through.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-22 18:44:22 +03:00
Andrew Borodin
aa6055b6aa Ticket #3693: code cleanup before 4.8.19 release.
WRadio: remove unused 'state' field.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-22 18:44:22 +03:00
Mooffie
43d7fce730 Merge branch '3750_extfs_rpm_trans_scripts'
* 3750_extfs_rpm_trans_scripts:
  extfs: rpm: fix tests for transaction scripts.
  Ticket #3750: Adding support for RPM transaction scripts.
2017-01-17 12:12:59 +02: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
Jiri Tyr
4310b066e2 Ticket #3750: Adding support for RPM transaction scripts.
Adding support for PRETRANS, PRETRANSPROG, POSTTRANS and
POSTTRANSPROG RPM tags which allow the relevant scripts to be visible
in the INFO/SCRIPTS vfs directory.

Signed-off-by: Jiri Tyr <jiri.tyr@gmail.com>
Signed-off-by: Mooffie <mooffie@gmail.com>
2017-01-16 17:01:31 +02:00
Mooffie
91ca170e1b Merge branch '3751_extfs_rpm_tests'
* 3751_extfs_rpm_tests:
  extfs: rpm: move misc/* to misc/rpm/*.
  extfs: rpm: add test for a custom package.
  extfs: rpm: add tests.
  extfs: rpm: introduce the rpm2tags tool.
  extfs: rpm: make it testable.
  Ticket #3751: extfs: rpm: introduce the $RPM_QUERY_FMT variable.
2017-01-16 15:00:48 +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
97bc2af3b2 extfs: rpm: make it testable.
The way we make this helper testable is a bit different than with other
helpers:

While in other helpers we make it possible to override just one or two
variables, here we make it possible to inject a code snippet into it. This is a
more powerful approach which lets us override even functions, as will be shown
in a following patch.

(As for relocating the "AllTAGS=..." line: all non-declarative code needs to be
moved past our new injection point, or else this code won't be affected by the
injection. BTW, the "$1" on that line isn't used; a vestige from old days.)

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-01-16 13:58:07 +02:00
Mooffie
65ebc83f88 Ticket #3751: extfs: rpm: introduce the $RPM_QUERY_FMT variable.
This minor refactoring will enable us to make this helper testable.

Instead of doing:

    $RPM -qp --qf a b c

we are now doing:

    $RPM_QUERY_FMT a b c

In a future patch we'll then be able to point $RPM_QUERY_FMT to some mock
program.

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-01-16 13:58:07 +02:00
Mooffie
3078e74afe Merge branch '3757_two_plus_columns_broken'
* 3757_two_plus_columns_broken:
  Documentation: panels nowadays can display more than 2 columns.
  Ticket #3757: cannot show more than one column in user defined listing mode.
2017-01-16 13:57:44 +02:00
Mooffie
76c2c42bd9 Documentation: panels nowadays can display more than 2 columns.
In the past panels supported up to 2 "columns" only. We update the
documentation.

Note: a naive fix is to change it to say "After the panel size, you may specify
the number of columns to display in the panel". Unfortunately, users may think
by "columns" we mean "fields", so we have to word it differrently.

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-01-16 13:54:24 +02:00
Mooffie
05661eda1d Ticket #3757: cannot show more than one column in user defined listing mode.
In user-defined listing mode, the format string lets us specify how many
columns to display. E.g., for 3 columns:

    "half 3 type name | size | perm"

However, parse_panel_size() reads this digit only when `panel->list_type ==
list_brief`. We remove this check.

Incidentally, the assignment there to `panel->brief_cols` isn't needed. In
list_brief mode, `panel->brief_cols` is already set.

We also fix a related problem in the mouse handler: it erroneously assumes
`panel->list_cols > 1` happens only in list_brief mode.

(These bugs were introduced in commit fb474bc1c157.)

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-01-16 00:23:03 +02:00
Mooffie
b229abc1eb Merge branch '3753_extfs_tester_access_configure_parameters'
* 3753_extfs_tester_access_configure_parameters:
  Ticket #3753: extfs: tester: let test scripts easily access configure-time parameters.
2017-01-15 21:15:39 +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
0fdcfa6aa4 Merge branch '3752_extfs_tester_export_more_variables'
* 3752_extfs_tester_export_more_variables:
  extfs: tester: improve HTML documentation output.
  extfs: tester: export some more useful variables.
  Ticket #3752: extfs: tester: use lowercase for private variables.
2017-01-15 19:50:45 +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
Mooffie
9f99838fbe Ticket #3752: extfs: tester: use lowercase for private variables.
We switch to a modern practice of using lowercase for private variables ("shell
variables") and uppercase for the system's ("environment variables"). Constants
too are made lowercase, as it takes a philosopher to define "constant".

This gives us two advantages:

- If an .env_vars file accesses a private variable (e.g. $DATA_DIR or $INPUT),
  something we want to discourage, we'll easily see this.

- Somewhat confusing code like "MC_TEST_DATA_DIR=$DATA_DIR" (which was to occur
  in the following patch) becomes self-documenting after the change.

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-01-13 15:36:18 +02:00
Andrew Borodin
9d735e02f1 Merge branch '3749_vfs_blksize'
* 3749_vfs_blksize:
  (vfs_adjust_stat): new VFS API, currently used to calculate st_blocks.
  Clarify usage of st_rdev. Use it if HAVE_STRUCT_STAT_ST_RDEV is defined.
  ftpfs: define st_blksize as equal to 64K.
  fishfs: define st_blksize as equal to 64K.
  Modify VFS APIs.
  tarfs: define st_blksize as equal to 8K.
  sftpfs: (sftpfs_fix_filename): refactoring: return length of result.
  sftpfs: minor optimization.
  sftpfs: define st_blksize and st_blocks.
  (vfs_s_default_stat): define st_blksize and st_blocks explicitly.
  Clarify usage of st_blocks. Use it if HAVE_STRUCT_STAT_ST_BLOCKS is defined.
  Ticket #3749: fix segfault in VFS if block size is not set.
2017-01-11 14:53:02 +03:00
Andrew Borodin
aae43d362f (vfs_adjust_stat): new VFS API, currently used to calculate st_blocks.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-11 14:52:35 +03:00
Andrew Borodin
bf40acf420 Clarify usage of st_rdev. Use it if HAVE_STRUCT_STAT_ST_RDEV is defined.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-11 14:52:35 +03:00
Andrew Borodin
d1c2c2d47e ftpfs: define st_blksize as equal to 64K.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-11 14:52:35 +03:00
Andrew Borodin
21fd0c3fec fishfs: define st_blksize as equal to 64K.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-11 14:52:35 +03:00
Andrew Borodin
061d60b82f Modify VFS APIs.
* vfs_s_stat: make public.
  * vfs_s_lstat: likewise.
  * vfs_s_fstat: likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-11 14:52:35 +03:00
Andrew Borodin
560ca526bd tarfs: define st_blksize as equal to 8K.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-11 14:52:35 +03:00