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 9539d2e
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 6 deletions.
72 changes: 72 additions & 0 deletions www/controllers/Repo/Mirror/Rpm.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ 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) == 'xz') {
$modulesFileExtension = 'xz';
$modulesFileTargetName = 'modules-temp.yaml.xz';
} else if (pathinfo($this->modulesLocation, PATHINFO_EXTENSION) == 'yaml') {
$modulesFileExtension = 'yaml';
$modulesFileTargetName = 'modules-temp.yaml';
Expand Down Expand Up @@ -148,6 +154,36 @@ 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');
}
}

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

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

$this->logOK();
}

Expand All @@ -168,6 +204,12 @@ 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) == 'xz') {
$updateInfoFileExtension = 'xz';
$updateInfoFileTargetName = 'updateinfo.xml.xz';
} else if (pathinfo($this->updateInfoLocation, PATHINFO_EXTENSION) == 'xml') {
$updateInfoFileExtension = 'xml';
$updateInfoFileTargetName = 'updateinfo.xml';
Expand Down Expand Up @@ -209,6 +251,36 @@ 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');
}
}

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

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

$this->logOK();
}

Expand Down
10 changes: 5 additions & 5 deletions www/update/database/3.5.3.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@
array(
'type' => 'rpm',
'name' => 'base',
'url' => 'http://mirror.centos.org/centos-7/7/os/$basearch/'
'url' => 'https://vault.centos.org/7.9.2009/os/x86_64/'
),
array(
'type' => 'rpm',
'name' => 'updates',
'url' => 'http://mirror.centos.org/centos-7/7/updates/$basearch/'
'url' => 'https://vault.centos.org/7.9.2009/updates/x86_64/'
),
array(
'type' => 'rpm',
'name' => 'extras',
'url' => 'http://mirror.centos.org/centos-7/7/extras/$basearch/'
'url' => 'https://vault.centos.org/7.9.2009/extras/x86_64/'
),
array(
'type' => 'rpm',
Expand All @@ -55,12 +55,12 @@
array(
'type' => 'rpm',
'name' => 'centos8-baseos',
'url' => 'http://mirror.centos.org/centos/8-stream/BaseOS/$basearch/os/'
'url' => 'http://vault.centos.org/8-stream/BaseOS/$basearch/os/'
),
array(
'type' => 'rpm',
'name' => 'centos8-appstream',
'url' => 'http://mirror.centos.org/centos/8-stream/AppStream/$basearch/os/'
'url' => 'http://vault.centos.org/8-stream/AppStream/$basearch/os/'
),
array(
'type' => 'rpm',
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 9539d2e

Please sign in to comment.