summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6628ada)
raw | patch | inline | side by side (parent: 6628ada)
author | janw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 12 Mar 2008 11:54:52 +0000 (11:54 +0000) | ||
committer | janw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 12 Mar 2008 11:54:52 +0000 (11:54 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9705 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/gosa-si-server | patch | blob | history |
diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server
index 0f0aa84d4177c9ab3970a5e284df7f628d9208ff..4c540d879ce566afbb23ef3ab87883d583229992 100755 (executable)
--- a/gosa-si/gosa-si-server
+++ b/gosa-si/gosa-si-server
our $verbose;
our $forground;
our $cfg_file;
-our ($ldap_handle, $ldap_uri, $ldap_base, $ldap_admin_dn, $ldap_admin_password );
+our ($ldap_handle, $ldap_uri, $ldap_base, $ldap_admin_dn, $ldap_admin_password, $ldap_server_dn);
# specifies the verbosity of the daemon_log
}
sub create_sources_list {
- my $result="";
-
- my $query_result= $fai_server_db->select_dbentry('SELECT * FROM '.$fai_server_tn);
- if($query_result) {
- my $fh;
- $result= '/tmp/gosa_si_tmp_sources_list';
- open($fh, ">$result") or return undef;
- while (my ($hit_num, $hit) = each %{$query_result}) {
- my $line = "deb ".$hit->{'server'}." ".$hit->{'release'};
- my $sections= $hit->{'sections'};
- $sections =~ s/,/ /g;
- $line.= " $sections";
- print $fh $line."\n";
+ my $result="/tmp/gosa_si_tmp_sources_list";
+
+ # Remove old file
+ if(stat($result)) {
+ unlink($result);
+ }
+
+ my $fh;
+ open($fh, ">$result") or return undef;
+ if(defined($ldap_server_dn) && length($ldap_server_dn)>0) {
+ my $mesg=$ldap_handle->search(
+ base => $ldap_server_dn,
+ scope => 'base',
+ attrs => 'FAIrepository',
+ );
+
+ if($mesg->count) {
+ foreach my $entry(@{$mesg->{'entries'}}) {
+ my ($server, $tag, $release, $sections)= split /\|/, $entry->get_value('FAIrepository');
+ my $line = "deb $server $release";
+ $sections =~ s/,/ /g;
+ $line.= " $sections";
+ print $fh $line."\n";
+ }
}
- close($fh);
}
+ close($fh);
return $result;
}