summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f258c8d)
raw | patch | inline | side by side (parent: f258c8d)
author | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 15 Apr 2008 14:31:34 +0000 (14:31 +0000) | ||
committer | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 15 Apr 2008 14:31:34 +0000 (14:31 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10482 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 076894ececee3d4fb7db435996d7623a6ee57f52..866f60bf5ffbecfbbf463751726d01afb9abd118 100755 (executable)
--- a/gosa-si/gosa-si-server
+++ b/gosa-si/gosa-si-server
# TODO: Find a way to post the 'create_packages_list_db' event
if(!defined($dont_create_packages_list)) {
- &create_packages_list_db;
+ #&create_packages_list_db;
+ &create_packages_list_db(undef, undef, $session_id);
}
}
}
}
}
- daemon_log("$session_id DEBUG: Inserting ".scalar @sql_list." entries to DB",6);
+
+ daemon_log("$session_id DEBUG: Inserting ".scalar @sql_list." entries to DB",9);
if(@sql_list) {
unshift @sql_list, "DELETE FROM $table_name";
$fai_server_db->exec_statementlist(\@sql_list);
my( $baseurl, $dist, $sections ) = ($line =~ /^deb\s([^\s]+)\s+([^\s]+)\s+(.*)$/);
my $section;
foreach $section (split(' ', $sections)){
- &parse_package_info( $baseurl, $dist, $section );
+ &parse_package_info( $baseurl, $dist, $section, $session_id );
}
}
}
}
sub parse_package_info {
- my ($baseurl, $dist, $section)= @_;
+ my ($baseurl, $dist, $section, $session_id)= @_;
my ($package);
my ($path) = ($baseurl =~ m%://[^/]*(.*)$%);
foreach $package ("Packages.gz"){
daemon_log("DEBUG: create_packages_list: fetch $baseurl, $dist, $section", 7);
get_package( "$baseurl/dists/$dist/$section/binary-$arch/$package", "$outdir/$dist/$section" );
- parse_package( "$outdir/$dist/$section", $dist, $path );
+ 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 ));
}
sub get_package {
}
sub parse_package {
- my ($path, $dist, $srv_path)= @_;
+ my ($path, $dist, $srv_path, $session_id)= @_;
+ if (not defined $session_id) { $session_id = 0;}
my ($package, $version, $section, $description);
my @sql_list;
my $PACKAGES;
if(not stat("$path.in")) {
- daemon_log("ERROR: create_packages_list: parse_package: file '$path.in' is not readable",1);
+ daemon_log("$session_id ERROR: create_packages_list: parse_package: file '$path.in' is not readable",1);
return;
}
open($PACKAGES, "<$path.in");
if(not defined($PACKAGES)) {
- daemon_log("ERROR: create_packages_list_db: parse_package: can not open '$path.in'",1);
+ daemon_log("$session_id ERROR: create_packages_list_db: parse_package: can not open '$path.in'",1);
return;
}
}
sub cleanup_and_extract {
+ my ($session_id) = @_ ;
my $fileinfo = $repo_files{ $File::Find::name };
if( defined $fileinfo ) {
if( -f "$dir/DEBIAN/templates" ) {
- daemon_log("DEBUG: Found debconf templates in '$package' - $newver", 5);
+ daemon_log("$session_id DEBUG: Found debconf templates in '$package' - $newver", 5);
my $tmpl= "";
{