Commit 3c600619 authored by Leigh Stoller's avatar Leigh Stoller

More versioning fixes; the fix goes on and on.

parent 48043e6e
......@@ -54,6 +54,14 @@ my $TBWWW = "@TBWWW@";
my %images = ();
my $debug = 0;
# Concat id/vers.
sub versid($)
{
my ($self) = @_;
return $self->imageid() . ":" . $self->version();
}
# Little helper and debug function.
sub mysystem($)
{
......@@ -101,6 +109,11 @@ sub Lookup($$;$$)
return BlessRow($class, $result->fetchrow_hashref());
}
elsif ($arg1 =~ /^(\d*):(\d*)$/) {
$arg1 = $1;
$arg2 = $2;
goto versid;
}
elsif ($arg1 =~ /^([-\w]*),([-\w\.\+]*)$/ ||
$arg1 =~ /^([-\w]*)\/([-\w\.\+]*)$/) {
my $result =
......@@ -161,6 +174,7 @@ sub Lookup($$;$$)
}
elsif (!defined($arg3)) {
if ($arg1 =~ /^\d+$/ && $arg2 =~ /^\d+$/) {
versid:
#
# This will get deleted images, but that is okay.
#
......@@ -1030,6 +1044,19 @@ sub Delete($;$)
" image_permissions write")
or return -1;
#
# If provenance is on and not purging, then want to stash the
# current type list so we can recall it later.
#
if (!$purge && $DOPROVENANCE && !defined($self->nodetypes())) {
my @typelist = $self->TypeList();
if (@typelist) {
my $typelist = join(",", @typelist);
DBQueryWarn("update image_versions set nodetypes='$typelist' ".
"where imageid='$imageid'")
}
}
#
# If this is an EZ imageid, then delete the corresponding OSID too.
#
......
......@@ -576,7 +576,7 @@ sub LightUpNodes($@)
if ($op == $RELOAD) {
my $image = $node->_loadimage();
my @images = ($image);
my $imageids = $image->imageid();
my $imageids = $image->versid();
my $auxloads = $node->_loadimages();
#
......@@ -585,7 +585,7 @@ sub LightUpNodes($@)
#
if (defined($auxloads)) {
foreach my $aux (@{ $auxloads }) {
my $auxid = $aux->imageid();
my $auxid = $aux->versid();
unshift(@images, $aux);
$imageids = "${auxid},${imageids}";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment