Commit f6b2cc43 authored by Leigh B Stoller's avatar Leigh B Stoller

Bug fixes to repo-based profiles.

parent 9fbac59e
......@@ -465,7 +465,10 @@ sub UpdateVersion($$)
my $version = $self->version();
my $query = "update apt_profile_versions set ".
join(",", map("$_=" . DBQuoteSpecial($argref->{$_}), keys(%{$argref})));
join(",", map("$_=" .
(defined($argref->{$_}) ?
DBQuoteSpecial($argref->{$_}) : "NULL"),
keys(%{$argref})));
$query .= " where profileid='$profileid' and version='$version'";
......
......@@ -351,6 +351,11 @@ if ($profile->repourl()) {
fatal("Illegal repository refspec");
}
}
else {
# Otherwise we are instantiating whatever the profile itself references.
$reporef = "refs/heads/master";
$repohash = $profile->repohash();
}
my $tmp = APT_Profile::SetRepo(\$rspecstr, $profile->repourl(),
$reporef, $repohash, \$errmsg);
if ($tmp) {
......@@ -805,15 +810,8 @@ if ($profile->repourl()) {
$blob->{"script"} = $script;
}
$blob->{"repourl"} = $profile->repourl();
# These come in from the instantiate page.
if (defined($reporef)) {
$blob->{"reporef"} = $reporef;
$blob->{"repohash"} = $repohash;
}
else {
# Otherwise we are instantiating whatever the profile itself references.
$blob->{"repohash"} = $profile->repohash();
}
$blob->{"reporef"} = $reporef;
$blob->{"repohash"} = $repohash;
}
if (defined($project)) {
$blob->{"pid"} = $project->pid();
......
......@@ -400,13 +400,12 @@ if (defined($script) && $script ne "" && $script =~ /^import/m) {
fatal("$RUNGENILIB failed")
if ($?);
chomp($paramdefs);
if ($paramdefs ne "") {
if ($update) {
$update_args{"paramdefs"} = $paramdefs;
}
else {
$new_args{"paramdefs"} = $paramdefs;
}
if ($update) {
# No versioning so need to clear existing paramdefs.
$update_args{"paramdefs"} = ($paramdefs ne "" ? $paramdefs : undef);
}
elsif ($paramdefs ne "") {
$new_args{"paramdefs"} = $paramdefs;
}
}
......
......@@ -393,7 +393,10 @@ function Do_CheckScript()
else {
$blob = array("rspec" => file_get_contents($outfname));
if (isset($pfname)) {
$blob["paramdefs"] = file_get_contents($pfname);
$paramdefs = file_get_contents($pfname);
if ($paramdefs != "") {
$blob["paramdefs"] = $paramdefs;
}
}
SPITAJAX_RESPONSE($blob);
}
......
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