Skip to content

Commit

Permalink
4.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lbr38 committed Jul 23, 2024
1 parent 84b02eb commit 126bb98
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
36 changes: 36 additions & 0 deletions www/controllers/Repo/Mirror/Rpm.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ private function downloadModules(string $url)
if (pathinfo($this->modulesLocation, PATHINFO_EXTENSION) == 'gz') {
$modulesFileExtension = 'gz';
$modulesFileTargetName = 'modules-temp.yaml.gz';
} else if (pathinfo($this->modulesLocation, PATHINFO_EXTENSION) == 'bz2') {
$modulesFileExtension = 'bz2';
$modulesFileTargetName = 'modules-temp.yaml.bz2';
} else if (pathinfo($this->modulesLocation, PATHINFO_EXTENSION) == 'yaml') {
$modulesFileExtension = 'yaml';
$modulesFileTargetName = 'modules-temp.yaml';
Expand Down Expand Up @@ -148,6 +151,21 @@ private function downloadModules(string $url)
}
}

if ($modulesFileExtension == 'bz2') {
try {
\Controllers\Common::bunzip2($this->workingDir . '/' . $modulesFileTargetName, $this->workingDir . '/modules.yaml');
} catch (Exception $e) {
throw new Exception('Could not uncompress <code>' . $modulesFileTargetName . '</code>: ' . $e->getMessage());
}

/**
* Delete original .bz2 file
*/
if (!unlink($this->workingDir . '/' . $modulesFileTargetName)) {
throw new Exception('Could not delete <code>' . $modulesFileTargetName . '</code> file');
}
}

$this->logOK();
}

Expand All @@ -168,6 +186,9 @@ private function downloadUpdateInfo(string $url)
if (pathinfo($this->updateInfoLocation, PATHINFO_EXTENSION) == 'gz') {
$updateInfoFileExtension = 'gz';
$updateInfoFileTargetName = 'updateinfo.xml.gz';
} else if (pathinfo($this->updateInfoLocation, PATHINFO_EXTENSION) == 'bz2') {
$updateInfoFileExtension = 'bz2';
$updateInfoFileTargetName = 'updateinfo.xml.bz2';
} else if (pathinfo($this->updateInfoLocation, PATHINFO_EXTENSION) == 'xml') {
$updateInfoFileExtension = 'xml';
$updateInfoFileTargetName = 'updateinfo.xml';
Expand Down Expand Up @@ -209,6 +230,21 @@ private function downloadUpdateInfo(string $url)
}
}

if ($updateInfoFileExtension == 'bz2') {
try {
\Controllers\Common::bunzip2($this->workingDir . '/' . $updateInfoFileTargetName, $this->workingDir . '/updateinfo.xml');
} catch (Exception $e) {
throw new Exception('Could not uncompress <code>' . $updateInfoFileTargetName . '</code>: ' . $e->getMessage());
}

/**
* Delete original .bz2 file
*/
if (!unlink($this->workingDir . '/' . $updateInfoFileTargetName)) {
throw new Exception('Could not delete <code>' . $updateInfoFileTargetName . '</code> file');
}
}

$this->logOK();
}

Expand Down
2 changes: 1 addition & 1 deletion www/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.4.0
4.4.1

0 comments on commit 126bb98

Please sign in to comment.