diff options
author | Guillaume Cottenceau <gc@mandriva.com> | 2004-01-12 17:52:12 +0000 |
---|---|---|
committer | Guillaume Cottenceau <gc@mandriva.com> | 2004-01-12 17:52:12 +0000 |
commit | 23c2826b2cb204b6970396e79a839dbc6009b58c (patch) | |
tree | 6e1ba46492a174d268e42287e4a45bbe8b63565d | |
parent | 910b0f7eaa21374d775a44dc0fb6f65a76e95218 (diff) | |
download | rpmdrake-23c2826b2cb204b6970396e79a839dbc6009b58c.tar rpmdrake-23c2826b2cb204b6970396e79a839dbc6009b58c.tar.gz rpmdrake-23c2826b2cb204b6970396e79a839dbc6009b58c.tar.bz2 rpmdrake-23c2826b2cb204b6970396e79a839dbc6009b58c.tar.xz rpmdrake-23c2826b2cb204b6970396e79a839dbc6009b58c.zip |
need to handle exceptions or we'll get duplicates :/
-rwxr-xr-x | po/get_from_compssusers.pl | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/po/get_from_compssusers.pl b/po/get_from_compssusers.pl index 16a5d174..e9c7adf7 100755 --- a/po/get_from_compssusers.pl +++ b/po/get_from_compssusers.pl @@ -2,7 +2,8 @@ use MDK::Common; -@miss = (qw(Development Server Workstation), 'Graphical Environment'); +our @miss = (qw(Server Workstation), 'Graphical Environment'); +our @exceptions = qw(Configuration Mail); my $po = $ARGV[0]; my $drakxfile = "../../../gi/perl-install/share/po/$po"; @@ -13,14 +14,18 @@ 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"; +our $current; +our $entry; foreach my $line (cat_($drakxfile)) { - $line =~ m|^\Q#: ../../share/compssUsers:999| || ($line =~ m|^msgid "([^"]+)"| && grep { $_ eq $1 } @miss) and do { + $line =~ m|^\Q#: ../../share/compssUsers:999| || ($line =~ m|^msgid "([^"]+)"| && member($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"; + $entry = "# DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO\n"; + $line =~ m|^#:| or $entry .= "#: ../../share/compssUsers:999\n"; }; - $current eq 'inside' and print $line; - $line =~ m|^$| and do { + $current eq 'inside' and $entry .= $line; + $line =~ m|^msgid "([^"]+)"| && member($1, @exceptions) and $current = 'outside'; + $line =~ m|^$| && $current eq 'inside' and do { $current = 'outside'; + print $entry; }; } |