File: get-lsb.pl

package info (click to toggle)
libsystem-info-perl 0.066-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,904 kB
  • sloc: perl: 2,516; sh: 25; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 546 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/pro/bin/perl

use strict;
use warnings;

foreach my $vf (glob ("/etc/*[-_][rRvV][eE][lLrR]*"), "/etc/issue",
                "/etc.defaults/VERSION", "/etc/VERSION", "/etc/release") {
    if (-d $vf) {
	(my $d = $vf) =~ s{.*/}{};
	print "mkdir $d\n";
	foreach my $f (grep { -f } glob "$vf/*") {
	    open my $fh, "<", $f or next;
	    $f =~ s{.*/}{};
	    print "cat > $d/$f <<EOFV\n", <$fh>, "EOFV\n";
	    }
	next;
	}
    open my $fh, "<", $vf or next;
    (my $lf = $vf) =~ s{.*/}{};
    print "cat > $lf <<EOFV\n", <$fh>, "EOFV\n";
    }