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>
* 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.
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>
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>
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>
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>
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>
* 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.
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>
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>
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>
* 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.
- 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>
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>
* 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.
* (sftpfs_opendir): get rid of extra calculation of file name length.
* (sftpfs_open_file): likewise.
* (sftpfs_readlink): likewise.
* (sftpfs_symlink): likewise.
* (sftpfs_rename): likewise.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Whitespace tweaking here. There's no change in the code itself except for
using '%c' in the first printf too, to make it like the second printf.
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
Some printf implementations can't process with %d anything other than integers.
We solve this by re-using the awk snippet for this purpose. This makes
hp48_retsize() unecessary. And hp48_retdir() too.
(The "case" statement was left unindented to, hopefully, not affect diff's
output much. This aesthetic issue will be fixed in a following patch.)
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
Use "MM-DD-YYYY hh:mm" instead of "Mon DD YYYY hh:mm".
Note: we assign to $NOW at the top-level, not inside hp48_parser(), because the
communication is slow and we don't want each recursive call to hp48_parser() to
potentially print a different time.
Two bugs fixed:
* "printf -rw-r--r--" made printf complain about invalid option (although
changing it to "printf -- -rw-r--r-" is possible, we don't know how portble
this is).
* Quotes around $INPUT defeat the purpose of the function calls (botched in
commit 61b4642af4).