source: branches/3.2/MondoRescue/bin/mr-read-all-link @ 3228

Last change on this file since 3228 was 3228, checked in by bruno, 5 years ago
  • Add a test file for MondoRescue::File for the mr_read_all_link function which is a critical one
  • Function now work as expected including normalization
  • Property svn:executable set to *
File size: 1.6 KB
Line 
1#!/usr/bin/perl -w
2#
3# $Id$
4# Copyright B. Cornec 2005-2014
5# Provided under the GPL v2
6#
7# Get all links from a file
8#
9use strict;
10use Data::Dumper;
11use MondoRescue::File;
12
13=pod
14
15=head1 NAME
16
17mr-read-all-link keeps track of all the links of a file and display them
18
19=head1 DESCRIPTION
20
21mr-read-all-link keeps track of all the links of a file and display them, by analyzing the path under which the file is located and mentioning all links that are encountered so that all the required content for a chroot environment are given back correctly.
22
23=head1 SYNOPSIS
24
25mr-read-all-link /path/to/file ...
26
27=head1 ARGUMENTS
28
29=over 4
30
31=item B</path/to/file>
32
33This is the path of the binary file and for which we want its links to be included
34
35=back
36
37=head1 WEB SITES
38
39The main Web site of the project is available at L<http://www.mondorescue.org>. Bug reports should be filled using the trac instance of the project at L<http://trac.mondorescue.org/>.
40
41=head1 USER MAILING LIST
42
43For community exchanges around MondoRescue please use the list L<http://sourceforge.net/mailarchive/forum.php?forum_name=mondo-devel>
44
45=head1 AUTHORS
46
47The MondoRescue team lead by Bruno Cornec L<mailto:bruno@mondorescue.org>.
48
49=head1 COPYRIGHT
50
51MondoRescue is distributed under the GPL v2.0 license or later,
52described in the file C<COPYING> included with the distribution.
53
54=cut
55
56
57my $file = mr_file_read_all_link(@ARGV) if (defined $ARGV[0]);
58
59#print Dumper($file);
60
61foreach my $f (sort keys %$file) {
62    print "$f\n";
63    print "--\n";
64    #print Dumper($f);
65    foreach my $l (@{$file->{$f}}) {
66        print "$l\n";
67    }
68    print "--\n";
69}
Note: See TracBrowser for help on using the repository browser.