summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3396345)
raw | patch | inline | side by side (parent: 3396345)
author | psc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 12 Apr 2011 08:36:04 +0000 (08:36 +0000) | ||
committer | psc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 12 Apr 2011 08:36:04 +0000 (08:36 +0000) |
Several changes in gosa-si to properly support multiple repositories
in different pathes:
- Add a new configuration option repo-basepath, which stores the common
prefix of repositories (e.g. /srv/www)
- Determine relative path of a repository by extracting the path
component of a repository URL as stord in gosa (e.g.
http://localhost/repo -> /repo) and make it the repo_path
- Process all repo_path'es (when adding packages and scanning debconf
templates)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@20705 594d385d-05f5-0310-b6e9-bd551577e9d8
in different pathes:
- Add a new configuration option repo-basepath, which stores the common
prefix of repositories (e.g. /srv/www)
- Determine relative path of a repository by extracting the path
component of a repository URL as stord in gosa (e.g.
http://localhost/repo -> /repo) and make it the repo_path
- Process all repo_path'es (when adding packages and scanning debconf
templates)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@20705 594d385d-05f5-0310-b6e9-bd551577e9d8
trunk/gosa-si/gosa-si-server | patch | blob | history |
index 9d574ed0670cad58248da6b5e49d0d25e6450be8..b3c88c1d8f32cf13cfe9164aab04b9a9d12fe0f0 100755 (executable)
my $sources_list;
my $max_clients;
my %repo_files=();
-my $repo_path;
my %repo_dirs=();
# Variables declared in config file are always set to 'our'
-our (%cfg_defaults, $log_file, $pid_file,
+our (%cfg_defaults, $log_file, $pid_file, $repo_basepath,
$server_ip, $server_port, $ClientPackages_key, $dns_lookup,
$arp_activ, $gosa_unit_tag,
$GosaPackages_key, $gosa_timeout,
%cfg_defaults = (
"general" => {
- "log-file" => [\$log_file, "/var/run/".$prg.".log"],
- "pid-file" => [\$pid_file, "/var/run/".$prg.".pid"],
+ "log-file" => [\$log_file, "/var/run/".$prg.".log"],
+ "pid-file" => [\$pid_file, "/var/run/".$prg.".pid"],
+ "repo-basepath" => [\$repo_basepath, "/srv/www"],
},
"server" => {
"ip" => [\$server_ip, "0.0.0.0"],
"messaging" => [\$messaging_file_name, '/var/lib/gosa-si/messaging.db'],
"foreign-clients" => [\$foreign_clients_file_name, '/var/lib/gosa-si/foreign_clients.db'],
"source-list" => [\$sources_list, '/etc/apt/sources.list'],
- "repo-path" => [\$repo_path, '/srv/www/repository'],
"ldap-uri" => [\$ldap_uri, ""],
"ldap-base" => [\$ldap_base, ""],
"ldap-admin-dn" => [\$ldap_admin_dn, ""],
sub create_packages_list_db {
my ($ldap_handle, $sources_file, $session_id) = @_;
-
+
+ # Cleanup repo basepath
+ $repo_basepath = File::Spec->canonpath($repo_basepath);
+
# it should not be possible to trigger a recreation of packages_list_db
# while packages_list_db is under construction, so set flag packages_list_under_construction
# which is tested befor recreation can be started
my ($baseurl, $dist, $section, $session_id)= @_;
my ($package);
if (not defined $session_id) { $session_id = 0; }
- my ($path) = ($baseurl =~ m%://[^/]*(.*)$%);
+ my ($path) = ($baseurl =~ m%://[^/]*/(.*)$%);
+
+ my $repo_path = File::Spec->join($repo_basepath, $path);
+
$repo_dirs{ "${repo_path}/pool" } = 1;
foreach $package ("Packages.gz"){
# Trigger for filename
if ($line =~ /^Filename:\s/){
my ($filename) = ($line =~ /^Filename: (.*)$/);
+ # Construct real path
+ my $repo_path = File::Spec->join($repo_basepath, $srv_path);
store_fileinfo( $package, $filename, $dist, $srv_path, $version, $repo_path );
next;
}