summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ea4209c)
raw | patch | inline | side by side (parent: ea4209c)
author | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 18 Apr 2008 14:20:38 +0000 (14:20 +0000) | ||
committer | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 18 Apr 2008 14:20:38 +0000 (14:20 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10567 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 e900c5b3849f0ee10883f79c29d3ecb0b648db68..290c95d71e2ac912dc26879c6be20a5b95a2458c 100755 (executable)
--- a/gosa-si/gosa-si-server
+++ b/gosa-si/gosa-si-server
unshift @sql_list, "DELETE FROM $table_name"; # at first, clear db
$fai_release_db->exec_statementlist(\@sql_list);
}
- daemon_log("$session_id DEBUG: Done with inserting",6);
+ daemon_log("$session_id DEBUG: Done with inserting",7);
}
daemon_log("$session_id INFO: create_fai_release_db: finished",5);
}
my $fai_filter= "(|(&(objectClass=FAIclass)(|(objectClass=".join(")(objectClass=", @possible_fai_classes).")))(objectClass=FAIbranch))";
my $fai_classes;
- daemon_log("$session_id DEBUG: Searching for FAI entries in base $fai_base",6);
+ daemon_log("$session_id DEBUG: Searching for FAI entries in base $fai_base",7);
my $mesg= $ldap_handle->search(
base => $fai_base,
scope => 'sub',
attrs => ['cn','objectClass','FAIstate'],
filter => $fai_filter,
);
- daemon_log("$session_id DEBUG: Found ".$mesg->count()." FAI entries",6);
+ daemon_log("$session_id DEBUG: Found ".$mesg->count()." FAI entries",7);
if($mesg->{'resultCode'} == 0 &&
$mesg->count != 0) {
}
sub create_sources_list {
+ my ($session_id) = @_;
my $ldap_handle = &get_ldap_handle;
my $result="/tmp/gosa_si_tmp_sources_list";
# Remove old file
if(stat($result)) {
unlink($result);
+ &main::daemon_log("$session_id DEBUG: remove an old version of '$result'", 7);
}
my $fh;
- open($fh, ">$result") or return undef;
+ open($fh, ">$result");
+ if (not defined $fh) {
+ &main::daemon_log("$session_id DEBUG: cannot open '$result' for writing", 7);
+ return undef;
+ }
if(defined($ldap_server_dn) and length($ldap_server_dn) > 0) {
my $mesg=$ldap_handle->search(
base => $ldap_server_dn,
}
}
}
- }
+ } else {
+ &main::daemon_log("$session_id ERROR: something wrong with ldap_server_dn '$ldap_server_dn', abort create_soureces_list", 1);
+ }
close($fh);
return $result;
sub create_packages_list_db {
- my ($ldap_handle, $sources_file, $session_id);
+ my ($ldap_handle, $sources_file, $session_id) = @_;
if (not defined $session_id) { $session_id = 0; }
if (not defined $ldap_handle) {
}
}
if (not defined $sources_file) {
- $sources_file = &create_sources_list;
+ &main::daemon_log("$session_id INFO: no sources_file given for creating packages list so trigger creation of it", 5);
+ $sources_file = &create_sources_list($session_id);
+ }
+
+ if (not defined $sources_file) {
+ &main::daemon_log("$session_id ERROR: no sources_file given under '$sources_file', skip create_packages_list_db", 1);
+
}
# it should not be possible to trigger a recreation of packages_list_db
# Interpret deb line
if ($line =~ /^deb [^\s]+\s[^\s]+\s[^\s]+/){
my( $baseurl, $dist, $sections ) = ($line =~ /^deb\s([^\s]+)\s+([^\s]+)\s+(.*)$/);
+print STDERR "baseurl: $baseurl\n";
+print STDERR "dist: $dist\n";
+print STDERR "sections: $sections\n";
my $section;
foreach $section (split(' ', $sections)){
&parse_package_info( $baseurl, $dist, $section, $session_id );
get_package( "$baseurl/dists/$dist/$section/binary-$arch/$package", "$outdir/$dist/$section", $session_id );
parse_package( "$outdir/$dist/$section", $dist, $path, $session_id );
}
- find(\&cleanup_and_extract, keys( %repo_dirs ));
+ find(\&cleanup_and_extract($session_id), keys( %repo_dirs ));
}
if(0 == system("wget '$url' -O '$dest' 2>/dev/null") ) {
system("gunzip -cd '$dest' > '$dest.in'");
daemon_log("$session_id DEBUG: run command: gunzip -cd '$dest' > '$dest.in'", 5);
-# unlink($dest);
+ unlink($dest);
daemon_log("$session_id DEBUG: delete file '$dest'", 5);
} else {
daemon_log("$session_id ERROR: create_packages_list_db: get_packages: fetching '$url' failed!", 1);
close( $PACKAGES );
# unlink( "$path.in" );
-
+ &main::daemon_log("$session_id DEBUG: unlink '$path.in'", 1);
+ my $len_sql_list = @sql_list;
+ &main::daemon_log("$session_id DEBUG: add $len_sql_list insert-statements to packages_list_db", 5);
$packages_list_db->exec_statementlist(\@sql_list);
}