Check in of patch in bug 357892. I thought I had initially checked it in, but instead I re-tagged STAGING with the old versions. Should be up-to-date. Verified that acceptance tests all passed.

This commit is contained in:
mike.morgan%oregonstate.edu 2006-11-02 23:50:43 +00:00
Родитель af455fb559
Коммит ea13b9f4a3
2 изменённых файлов: 17 добавлений и 37 удалений

Просмотреть файл

@ -264,13 +264,15 @@ class Patch extends AUS_Object {
// If we have the latest complete build, the path is valid, the file exists, and the filesize is greater than zero, we have a valid complete patch.
if ($latestCompleteBuild && $this->setPath($product,$platform,$locale,$branchVersion,$latestCompleteBuild,2,$channel) && file_exists($this->path) && filesize($this->path) > 0) {
return $this->setSnippet($this->path);
$this->setSnippet($this->path);
return $this->isNewerBuild($build);
}
}
// Otherwise, check for the partial snippet info. If an update exists, pass it along.
if ($this->isPartial() && $this->isNightlyChannel($channel) && $this->setPath($product,$platform,$locale,$branchVersion,$build,2,$channel) && file_exists($this->path) && filesize($this->path) > 0) {
return $this->setSnippet($this->path);
$this->setSnippet($this->path);
return $this->isNewerBuild($build);
}
// Note: Other data sets were made obsolete in 0.6. May incoming/0,1 rest in peace.
@ -345,29 +347,11 @@ class Patch extends AUS_Object {
/**
* Does this object contain a valid patch file?
* The build id check only happens for nightly channels.
*
* For business logic that doesn't exist yet, this is also a good place to extend overriding reasons why
* a patch should be invalid even if the data exists.
*
* @TODO migrate the os compatibility stuff here
* @param string $build
* @param string $channel
* @return boolean
*/
function isPatch($build, $channel=null) {
// For nightlies, we only want to deliver the complete patch if the destination build is newer than the client build.
if ($this->isNightlyChannel($channel) && $this->isComplete()) {
return $this->isNewerBuild($build);
}
// For nightlies, we only want to deliver the partial patch if the destination build for the partial patch is equal to the build in the complete patch (which will always point to the latest).
elseif ($this->isNightlyChannel($channel) && $this->isPartial()) {
return $this->isNewerBuild($build);
} else {
function isPatch() {
return $this->isPatch;
}
}
/**
* Determine whether or not this patch is a complete patch.

Просмотреть файл

@ -114,7 +114,7 @@ switch ($clean['updateVersion']) {
$completePatch = new Patch($branchVersions,$nightlyChannels,'complete');
// If our complete patch exists and is valid, set the patch line.
if ($completePatch->findPatch($clean['product'],$clean['platform'],$clean['locale'],$clean['version'],$clean['build'],$clean['channel']) && $completePatch->isPatch($clean['build'],$clean['channel'])) {
if ($completePatch->findPatch($clean['product'],$clean['platform'],$clean['locale'],$clean['version'],$clean['build'],$clean['channel']) && $completePatch->isPatch()) {
// Set our patchLine.
$xml->setPatchLine($completePatch);
@ -142,19 +142,15 @@ switch ($clean['updateVersion']) {
}
}
// We only check for a partial patch if the complete patch was successfully retrieved.
if ($completePatch->isPatch($clean['build'],$clean['channel'])) {
// Instantiate our partial patch.
$partialPatch = new Patch($branchVersions,$nightlyChannels,'partial');
// If our partial patch exists and is valid, set the patch line.
if ($partialPatch->findPatch($clean['product'],$clean['platform'],$clean['locale'],$clean['version'],$clean['build'],$clean['channel'])
&& $partialPatch->isPatch($clean['build'],$clean['channel'])
&& $partialPatch->isPatch()
&& $partialPatch->isOneStepFromLatest($completePatch->build)) {
$xml->setPatchLine($partialPatch);
}
}
// If we have valid patchLine(s), set up our output.
if ($xml->hasPatchLine()) {
@ -179,7 +175,7 @@ switch ($clean['updateVersion']) {
$patch->findPatch($clean['product'],$clean['platform'],$clean['locale'],$clean['version'],$clean['build'],null);
if ($patch->isPatch($clean['build'])) {
if ($patch->isPatch()) {
$xml->setPatchLine($patch);
}