Ticket #3789: remove faulty test in rpm helper to detect CONFLICTS tag
[midnight-commander.git] / tests / src / vfs / extfs / helpers-list / data / rpm.rewrite.sh
blob08867fadd6022aebb3a43f5561996491f64c1a13
2 # This file gets source'd into our rpm helper.
4 # It imitates the 'rpm' program by overriding a few functions.
7 # The tags file.
8 TAGSF="$MC_TEST_EXTFS_INPUT"
10 . "$MC_TEST_EXTFS_CONFIG_SH" # Gain access to $PERL.
12 # ----------------------------------------------------------------------------
15 # Imitates 'rpm -qp --qf <TEMPLATE> <PACKAGE_FILE>'.
17 # (It ignores <PACKAGE_FILE>, using our input instead.)
19 # E.g.: given "Name: %{NAME} Ver: %{VERSION}",
20 # prints "Name: php-pear-Twig Ver: 1.0.0".
22 rpm_qf()
24 $PERL -w -e '
25 $tagsf = $ARGV[0];
26 $tmplt = $ARGV[1];
28 do $tagsf or die("$tagsf: $!");
29 $tmplt =~ s/\\n/\n/g;
30 $tmplt =~ s/%\{(.*?)\}/
31 (my $tag = $1) =~ s,^RPMTAG_,,; # Tag names may be specified with or without this prefix.
32 exists $tags->{$tag} ? $tags->{$tag} : "(none)"
33 /eg;
34 print $tmplt;
35 ' \
36 "$TAGSF" "$1"
38 RPM_QUERY_FMT=rpm_qf # Tell the helper to use it instead of the 'rpm' binary.
40 # ----------------------------------------------------------------------------
43 # Overrides helper's.
45 # @Mock
47 mcrpmfs_getDesription()
49 rpm_qf "%{_INFO}"
52 # ----------------------------------------------------------------------------