summaryrefslogtreecommitdiffstats
path: root/urpm/ldap.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2006-11-21 17:43:37 +0000
committerPascal Rigaux <pixel@mandriva.com>2006-11-21 17:43:37 +0000
commit871705259637a1b980f74fe118c5a23a0674b283 (patch)
treea7f98f5f3ff8d6036e631b75dfd68a5d032d3d71 /urpm/ldap.pm
parent30844e6755db13ce18727cc4e7fd113f744e99c0 (diff)
downloadurpmi-871705259637a1b980f74fe118c5a23a0674b283.tar
urpmi-871705259637a1b980f74fe118c5a23a0674b283.tar.gz
urpmi-871705259637a1b980f74fe118c5a23a0674b283.tar.bz2
urpmi-871705259637a1b980f74fe118c5a23a0674b283.tar.xz
urpmi-871705259637a1b980f74fe118c5a23a0674b283.zip
move many functions from urpm.pm to urpm/media.pm
Diffstat (limited to 'urpm/ldap.pm')
-rw-r--r--urpm/ldap.pm18
1 files changed, 9 insertions, 9 deletions
diff --git a/urpm/ldap.pm b/urpm/ldap.pm
index 6298f422..5c4d636f 100644
--- a/urpm/ldap.pm
+++ b/urpm/ldap.pm
@@ -38,7 +38,7 @@ therefore, caching is useless if server is up.
Checks if the ldap medium has all required attributes.
-=item read_ldap_cache($urpm, %options)
+=item read_ldap_cache($urpm)
Reads the cache created by the C<write_ldap_cache> function. Should be called
if the ldap server doesn't answer (upgrade, network problem, mobile user, etc.)
@@ -47,7 +47,7 @@ if the ldap server doesn't answer (upgrade, network problem, mobile user, etc.)
Cleans the ldap cache, removes all files in the directory.
-=item load_ldap_media($urpm, %options)
+=item load_ldap_media($urpm)
Loads urpmi media configuration from ldap.
@@ -97,13 +97,13 @@ sub get_vars_from_sh {
%l;
}
-sub read_ldap_cache($%) {
- my ($urpm, %options) = @_;
+sub read_ldap_cache {
+ my ($urpm) = @_;
foreach (glob("$urpm->{cachedir}/ldap/*")) {
! -f $_ and next;
my %medium = get_vars_from_sh($_);
next if !check_ldap_medium(\%medium);
- $urpm->probe_medium(\%medium, %options) and push @{$urpm->{media}}, \%medium;
+ urpm::media::add_existing_medium($urpm, \%medium);
}
}
@@ -146,8 +146,8 @@ my %ldap_changed_attributes = (
'ftp-proxy' => 'ftp_proxy',
);
-sub load_ldap_media($%) {
- my ($urpm, %options) = @_;
+sub load_ldap_media {
+ my ($urpm) = @_;
my $config = get_ldap_config() or return;
@@ -205,13 +205,13 @@ sub load_ldap_media($%) {
$medium->{ldap} = 1;
$medium->{priority} = $priority++;
next if !check_ldap_medium($medium);
- $urpm->probe_medium($medium, %options) and push @{$urpm->{media}}, $medium;
+ urpm::media::add_existing_medium($urpm, $medium);
write_ldap_cache($urpm,$medium);
}
};
if ($@) {
$urpm->{log}($@);
- read_ldap_cache($urpm, %options);
+ read_ldap_cache($urpm);
}
}