aboutsummaryrefslogtreecommitdiffstats
path: root/po/get_from_compssusers.pl
blob: 16a5d174967c51d1cac72fb11a8b9680403cb496 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/perl

use MDK::Common;

@miss = (qw(Development Server Workstation), 'Graphical Environment');

my $po = $ARGV[0];
my $drakxfile = "../../../gi/perl-install/share/po/$po";

-e $drakxfile or exit 0;

my ($enc_rpmdrake) = cat_($po) =~ /Content-Type: .*; charset=(.*)\\n/i;
my ($enc_drakx)    = cat_($drakxfile) =~ /Content-Type: .*; charset=(.*)\\n/;
uc($enc_rpmdrake) ne uc($enc_drakx) and die "Encodings differ for $po! rpmdrake's encoding: $enc_rpmdrake; drakx's encoding: $enc_drakx";

foreach my $line (cat_($drakxfile)) {
    $line =~ m|^\Q#: ../../share/compssUsers:999| || ($line =~ m|^msgid "([^"]+)"| && grep { $_ eq $1 } @miss) and do {
	$current = 'inside';
	print "# DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO\n";
        $line =~ m|^#:| or print "#: ../../share/compssUsers:999\n";
    };
    $current eq 'inside' and print $line;
    $line =~ m|^$| and do {
	$current = 'outside';
    };
}