Last change
on this file since 3343 was 3311, checked in by Bruno Cornec, 10 years ago |
- Fix an issue reported by Dider Diaz for older perl version where the code was incompatible
|
-
Property svn:executable
set to
*
|
File size:
1.8 KB
|
Rev | Line | |
---|
[3224] | 1 | #!/usr/bin/perl -w
|
---|
| 2 | #
|
---|
| 3 | # $Id$
|
---|
[3226] | 4 | # Copyright B. Cornec 2005-2014
|
---|
[3224] | 5 | # Provided under the GPL v2
|
---|
| 6 | #
|
---|
| 7 | # Get all links from a file
|
---|
| 8 | #
|
---|
| 9 | use strict;
|
---|
[3228] | 10 | use Data::Dumper;
|
---|
[3224] | 11 | use MondoRescue::File;
|
---|
[3262] | 12 | # For pbdebug
|
---|
| 13 | use ProjectBuilder::Base;
|
---|
[3224] | 14 |
|
---|
| 15 | =pod
|
---|
| 16 |
|
---|
| 17 | =head1 NAME
|
---|
| 18 |
|
---|
| 19 | mr-read-all-link keeps track of all the links of a file and display them
|
---|
| 20 |
|
---|
| 21 | =head1 DESCRIPTION
|
---|
| 22 |
|
---|
| 23 | mr-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.
|
---|
| 24 |
|
---|
| 25 | =head1 SYNOPSIS
|
---|
| 26 |
|
---|
| 27 | mr-read-all-link /path/to/file ...
|
---|
| 28 |
|
---|
| 29 | =head1 ARGUMENTS
|
---|
| 30 |
|
---|
| 31 | =over 4
|
---|
| 32 |
|
---|
| 33 | =item B</path/to/file>
|
---|
| 34 |
|
---|
| 35 | This is the path of the binary file and for which we want its links to be included
|
---|
| 36 |
|
---|
| 37 | =back
|
---|
| 38 |
|
---|
| 39 | =head1 WEB SITES
|
---|
| 40 |
|
---|
| 41 | The 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/>.
|
---|
| 42 |
|
---|
| 43 | =head1 USER MAILING LIST
|
---|
| 44 |
|
---|
| 45 | For community exchanges around MondoRescue please use the list L<http://sourceforge.net/mailarchive/forum.php?forum_name=mondo-devel>
|
---|
| 46 |
|
---|
| 47 | =head1 AUTHORS
|
---|
| 48 |
|
---|
| 49 | The MondoRescue team lead by Bruno Cornec L<mailto:bruno@mondorescue.org>.
|
---|
| 50 |
|
---|
| 51 | =head1 COPYRIGHT
|
---|
| 52 |
|
---|
| 53 | MondoRescue is distributed under the GPL v2.0 license or later,
|
---|
| 54 | described in the file C<COPYING> included with the distribution.
|
---|
| 55 |
|
---|
| 56 | =cut
|
---|
| 57 |
|
---|
[3262] | 58 | $pbdebug = 2 if ((defined $ARGV[0]) && ($ARGV[0] eq "-v"));
|
---|
[3224] | 59 |
|
---|
| 60 | my $file = mr_file_read_all_link(@ARGV) if (defined $ARGV[0]);
|
---|
[3262] | 61 | my %h;
|
---|
[3224] | 62 |
|
---|
[3228] | 63 | #print Dumper($file);
|
---|
| 64 |
|
---|
[3224] | 65 | foreach my $f (sort keys %$file) {
|
---|
[3262] | 66 | print "$f\n" if ($pbdebug >= 1);
|
---|
| 67 | print "--\n" if ($pbdebug >= 1);
|
---|
[3228] | 68 | #print Dumper($f);
|
---|
[3311] | 69 | foreach my $l (sort keys %{$file->{$f}}) {
|
---|
[3262] | 70 | print "==" if ($pbdebug >= 1);
|
---|
| 71 | print "$l\n" if ($pbdebug >= 1);
|
---|
| 72 | $h{$l} = 1;
|
---|
[3228] | 73 | }
|
---|
[3262] | 74 | print "--\n" if ($pbdebug >= 1);
|
---|
[3224] | 75 | }
|
---|
[3262] | 76 |
|
---|
| 77 | foreach my $l (sort keys %h) {
|
---|
| 78 | print "$l\n";
|
---|
| 79 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.