aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ManaTools/Shared
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ManaTools/Shared')
-rw-r--r--lib/ManaTools/Shared/urpmi_backend/tools.pm20
1 files changed, 14 insertions, 6 deletions
diff --git a/lib/ManaTools/Shared/urpmi_backend/tools.pm b/lib/ManaTools/Shared/urpmi_backend/tools.pm
index ad037b6..05768c9 100644
--- a/lib/ManaTools/Shared/urpmi_backend/tools.pm
+++ b/lib/ManaTools/Shared/urpmi_backend/tools.pm
@@ -302,7 +302,8 @@ sub find_installed_fullname {
#=============================================================
sub is_mageia {
my $self = shift;
- cat_('/etc/release') =~ /Mageia/;
+
+ return cat_('/etc/release') =~ /Mageia/;
}
#=============================================================
@@ -319,9 +320,10 @@ sub is_mageia {
sub vendor {
my $self = shift;
- is_mageia() ? "mageia" : "mandriva";
+ return $self->is_mageia() ? "mageia" : "mandriva";
}
+
#=============================================================
=head2 get_package_id
@@ -365,11 +367,16 @@ sub get_package_id {
#=============================================================
sub pkg2medium {
my ($self, $p, $urpm) = @_;
+
return if ref($p) ne 'URPM::Package';
- return { name => $self->loc()->N("None (installed)") } if !defined($p->id); # if installed
+ return {
+ name => $self->loc->N_("None (installed)")
+ } if !defined($p->id); # if installed
- return URPM::pkg2media($urpm->{media}, $p) || { name => $self->loc()->N("Unknown"), fake => 1 };
+ return URPM::pkg2media($urpm->{media}, $p) || {
+ name => $self->loc->N("Unknown"), fake => 1
+ };
}
#=============================================================
@@ -393,7 +400,7 @@ sub fullname_to_package_id {
chomp($pkg_string);
if ($pkg_string =~ /^(.*)-([^-]*)-([^-]*)\.([^\.]*)$/) {
# TODO NOTE check package kit backend it seems the urpm package_id is "name;varsion-release;arch;vendor"
- return join(';', $1, "$2-$3", $4, vendor());
+ return join(';', $1, "$2-$3", $4, $self->vendor());
}
}
@@ -484,4 +491,5 @@ sub get_package_upgrade {
}
-1; \ No newline at end of file
+1;
+