Check-in Number:
|
4844 | |
Date: |
2004-Nov-17 09:53:21 (local)
2004-Nov-17 08:53:21 (UTC) |
User: | rse |
Branch: | |
Comment: |
fix logic for SRC/00INDEX.rdf.bz2 files where both rdf:Description and Repository containers are inside a top-level Repository container |
Tickets: |
|
Inspections: |
|
Files: |
|
ossp-pkg/quos/openpkg-rdf2sql.pl 1.6 -> 1.7
--- openpkg-rdf2sql.pl 2004/11/16 16:23:28 1.6
+++ openpkg-rdf2sql.pl 2004/11/17 08:53:21 1.7
@@ -116,14 +116,15 @@
# iterate over XML/RDF data structure
foreach my $repo (@{$rdf->{'rdf:RDF'}->[0]->{'Repository'}}) {
my $rd_url = $repo->{'rdf:resource'};
+
+ # start SQL transaction
+ $db->begin_work();
# store repository information
- $db->begin_work();
$sql->{-rdf}->execute($rd_url);
# iterate over all packages in a repository
if (defined($repo->{'rdf:Description'})) {
- # from now on package descriptions
foreach my $desc (@{$repo->{'rdf:Description'}}) {
# store simple (single-value) properties of a package
my $prop = {};
@@ -160,8 +161,9 @@
}
}
}
- else {
- # from now on RDF references
+
+ # iterate over all sub-repositities in repository
+ if (defined($repo->{'Repository'})) {
foreach my $repcont (@{$repo->{'Repository'}}) {
$url =~ m|^(.*/)|;
my $actpath = $1;
@@ -169,6 +171,8 @@
sleep(1);
}
}
+
+ # end SQL transaction
$db->commit();
}
}
|
|