summaryrefslogtreecommitdiffstats
path: root/gurpmi.pm
blob: 404282c5f64dbd873bac78b48f815ae9030cb25b (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
27
28
29
30
31
32
33
34
package gurpmi;

#- This is needed because text printed by Gtk2 will always be encoded
#- in UTF-8; we first check if LC_ALL is defined, because if it is,
#- changing only LC_COLLATE will have no effect.
use POSIX qw(setlocale LC_ALL LC_COLLATE);
use locale;
BEGIN {
    my $collation_locale = $ENV{LC_ALL};
    if ($collation_locale) {
	$collation_locale =~ /UTF-8/ or setlocale(LC_ALL, "$collation_locale.UTF-8");
    } else {
	$collation_locale = setlocale(LC_COLLATE);
	$collation_locale =~ /UTF-8/ or setlocale(LC_COLLATE, "$collation_locale.UTF-8");
    }
}

use urpm;

sub usage () {
    print STDERR <<USAGE;
gurpmi version $urpm::VERSION
Usage :
    gurpmi <rpm> [ <rpm>... ]
USAGE
    exit 0;
}

#- fatal gurpmi initialisation error (*not* fatal urpmi errors)
sub fatal { print STDERR "$_[0]\n"; exit 1 }

sub but ($) { "    $_[0]    " }

1;