summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9d6413c)
raw | patch | inline | side by side (parent: 9d6413c)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 18 Mar 2008 13:31:36 +0000 (13:31 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 18 Mar 2008 13:31:36 +0000 (13:31 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9923 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 018d67f4f61c61c45f6244680b1c66e58176cfbf..238fcd6fca51637e5a01176f7cfca1f84b35adef 100755 (executable)
--- a/gosa-si/gosa-si-server
+++ b/gosa-si/gosa-si-server
# This is ugly, but I've no time to take a look at "how it works in perl"
if(0 == system("wget '$url' -O '$dest' 2>/dev/null") ) {
system("gunzip -cd '$dest' > '$dest.in'");
- system("rm -f '$dest'");
+ unlink($dest);
} else {
daemon_log("ERROR: create_packages_list_db: get_packages: fetching '$url' failed!", 1);
}
}
sub cleanup_and_extract {
-
- my %templates = ();
my $fileinfo = $repo_files{ $File::Find::name };
if( defined $fileinfo ) {
- print STDERR "============> $File::Find::name\n";
my $dir = "$outdir/$fileinfo->{ 'dist' }/debconf.d";
- system( "mkdir -p '$dir'" );
+ my $sql;
+ my $package = $fileinfo->{ 'package' };
+ my $newver = $fileinfo->{ 'version' };
+ mkpath($dir);
system( "dpkg -e '$File::Find::name' '$dir/DEBIAN'" );
+
if( -f "$dir/DEBIAN/templates" ) {
- my $package = $fileinfo->{ 'package' };
- my $newver = $fileinfo->{ 'version' };
daemon_log("DEBUG: Found debconf templates in '$package' - $newver", 5);
- if( exists $templates{ "$fileinfo->{ 'dist' }/$package" } ) {
- my $oldver = $templates{ "$fileinfo->{ 'dist' }/$package" };
- my $ret = system( "dpkg --compare-versions '$oldver' gt '$newver'" );
- if( ! $ret ) {
- daemon_log("DEBUG: duplicated '$package' ($newver) in $fileinfo->{ 'dist' } - keeping tmpl v'$oldver'", 5);
- return;
- }
- else {
- daemon_log("DEBUG: duplicated '$package' ($newver) in $fileinfo->{ 'dist' } - overwriting tmpl v'$oldver'", 5);
- }
+
+ my $tmpl= "";
+ {
+ local $/=undef;
+ open FILE, "$dir/DEBIAN/templates";
+ $tmpl = &encode_base64(<FILE>);
+ close FILE;
}
- $templates{ "$fileinfo->{ 'dist' }/$package" } = $newver;
- move( "$dir/DEBIAN/templates", "$dir/$package.templates" );
+ rmtree("$dir/DEBIAN/templates");
+
+ $sql= "update $main::packages_list_tn set template = '$tmpl' where package = '$package' and version = '$newver';";
+
+ } else {
+ $sql= "update $main::packages_list_tn set template = '' where package = '$package' and version = '$newver';";
}
+
+ my $res= $main::packages_list_db->update_dbentry($sql);
}
}