Skip to content

Commit 54b9b9d

Browse files
authored
Merge pull request #183 from lbr38/devel
4.4.1
2 parents 84b02eb + 9539d2e commit 54b9b9d

File tree

3 files changed

+78
-6
lines changed

3 files changed

+78
-6
lines changed

www/controllers/Repo/Mirror/Rpm.php

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ private function downloadModules(string $url)
104104
if (pathinfo($this->modulesLocation, PATHINFO_EXTENSION) == 'gz') {
105105
$modulesFileExtension = 'gz';
106106
$modulesFileTargetName = 'modules-temp.yaml.gz';
107+
} else if (pathinfo($this->modulesLocation, PATHINFO_EXTENSION) == 'bz2') {
108+
$modulesFileExtension = 'bz2';
109+
$modulesFileTargetName = 'modules-temp.yaml.bz2';
110+
} else if (pathinfo($this->modulesLocation, PATHINFO_EXTENSION) == 'xz') {
111+
$modulesFileExtension = 'xz';
112+
$modulesFileTargetName = 'modules-temp.yaml.xz';
107113
} else if (pathinfo($this->modulesLocation, PATHINFO_EXTENSION) == 'yaml') {
108114
$modulesFileExtension = 'yaml';
109115
$modulesFileTargetName = 'modules-temp.yaml';
@@ -148,6 +154,36 @@ private function downloadModules(string $url)
148154
}
149155
}
150156

157+
if ($modulesFileExtension == 'bz2') {
158+
try {
159+
\Controllers\Common::bunzip2($this->workingDir . '/' . $modulesFileTargetName, $this->workingDir . '/modules.yaml');
160+
} catch (Exception $e) {
161+
throw new Exception('Could not uncompress <code>' . $modulesFileTargetName . '</code>: ' . $e->getMessage());
162+
}
163+
164+
/**
165+
* Delete original .bz2 file
166+
*/
167+
if (!unlink($this->workingDir . '/' . $modulesFileTargetName)) {
168+
throw new Exception('Could not delete <code>' . $modulesFileTargetName . '</code> file');
169+
}
170+
}
171+
172+
if ($modulesFileExtension == 'xz') {
173+
try {
174+
\Controllers\Common::xzUncompress($this->workingDir . '/' . $modulesFileTargetName, $this->workingDir . '/modules.yaml');
175+
} catch (Exception $e) {
176+
throw new Exception('Could not uncompress <code>' . $modulesFileTargetName . '</code>: ' . $e->getMessage());
177+
}
178+
179+
/**
180+
* Delete original .xz file
181+
*/
182+
if (!unlink($this->workingDir . '/' . $modulesFileTargetName)) {
183+
throw new Exception('Could not delete <code>' . $modulesFileTargetName . '</code> file');
184+
}
185+
}
186+
151187
$this->logOK();
152188
}
153189

@@ -168,6 +204,12 @@ private function downloadUpdateInfo(string $url)
168204
if (pathinfo($this->updateInfoLocation, PATHINFO_EXTENSION) == 'gz') {
169205
$updateInfoFileExtension = 'gz';
170206
$updateInfoFileTargetName = 'updateinfo.xml.gz';
207+
} else if (pathinfo($this->updateInfoLocation, PATHINFO_EXTENSION) == 'bz2') {
208+
$updateInfoFileExtension = 'bz2';
209+
$updateInfoFileTargetName = 'updateinfo.xml.bz2';
210+
} else if (pathinfo($this->updateInfoLocation, PATHINFO_EXTENSION) == 'xz') {
211+
$updateInfoFileExtension = 'xz';
212+
$updateInfoFileTargetName = 'updateinfo.xml.xz';
171213
} else if (pathinfo($this->updateInfoLocation, PATHINFO_EXTENSION) == 'xml') {
172214
$updateInfoFileExtension = 'xml';
173215
$updateInfoFileTargetName = 'updateinfo.xml';
@@ -209,6 +251,36 @@ private function downloadUpdateInfo(string $url)
209251
}
210252
}
211253

254+
if ($updateInfoFileExtension == 'bz2') {
255+
try {
256+
\Controllers\Common::bunzip2($this->workingDir . '/' . $updateInfoFileTargetName, $this->workingDir . '/updateinfo.xml');
257+
} catch (Exception $e) {
258+
throw new Exception('Could not uncompress <code>' . $updateInfoFileTargetName . '</code>: ' . $e->getMessage());
259+
}
260+
261+
/**
262+
* Delete original .bz2 file
263+
*/
264+
if (!unlink($this->workingDir . '/' . $updateInfoFileTargetName)) {
265+
throw new Exception('Could not delete <code>' . $updateInfoFileTargetName . '</code> file');
266+
}
267+
}
268+
269+
if ($updateInfoFileExtension == 'xz') {
270+
try {
271+
\Controllers\Common::xzUncompress($this->workingDir . '/' . $updateInfoFileTargetName, $this->workingDir . '/updateinfo.xml');
272+
} catch (Exception $e) {
273+
throw new Exception('Could not uncompress <code>' . $updateInfoFileTargetName . '</code>: ' . $e->getMessage());
274+
}
275+
276+
/**
277+
* Delete original .xz file
278+
*/
279+
if (!unlink($this->workingDir . '/' . $updateInfoFileTargetName)) {
280+
throw new Exception('Could not delete <code>' . $updateInfoFileTargetName . '</code> file');
281+
}
282+
}
283+
212284
$this->logOK();
213285
}
214286

www/update/database/3.5.3.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,17 @@
3434
array(
3535
'type' => 'rpm',
3636
'name' => 'base',
37-
'url' => 'http://mirror.centos.org/centos-7/7/os/$basearch/'
37+
'url' => 'https://vault.centos.org/7.9.2009/os/x86_64/'
3838
),
3939
array(
4040
'type' => 'rpm',
4141
'name' => 'updates',
42-
'url' => 'http://mirror.centos.org/centos-7/7/updates/$basearch/'
42+
'url' => 'https://vault.centos.org/7.9.2009/updates/x86_64/'
4343
),
4444
array(
4545
'type' => 'rpm',
4646
'name' => 'extras',
47-
'url' => 'http://mirror.centos.org/centos-7/7/extras/$basearch/'
47+
'url' => 'https://vault.centos.org/7.9.2009/extras/x86_64/'
4848
),
4949
array(
5050
'type' => 'rpm',
@@ -55,12 +55,12 @@
5555
array(
5656
'type' => 'rpm',
5757
'name' => 'centos8-baseos',
58-
'url' => 'http://mirror.centos.org/centos/8-stream/BaseOS/$basearch/os/'
58+
'url' => 'http://vault.centos.org/8-stream/BaseOS/$basearch/os/'
5959
),
6060
array(
6161
'type' => 'rpm',
6262
'name' => 'centos8-appstream',
63-
'url' => 'http://mirror.centos.org/centos/8-stream/AppStream/$basearch/os/'
63+
'url' => 'http://vault.centos.org/8-stream/AppStream/$basearch/os/'
6464
),
6565
array(
6666
'type' => 'rpm',

www/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.4.0
1+
4.4.1

0 commit comments

Comments
 (0)