Skip to content

Commit

Permalink
4.16.2
Browse files Browse the repository at this point in the history
  • Loading branch information
lbr38 committed Jan 21, 2025
1 parent e1951fd commit 982e65d
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 4 deletions.
17 changes: 17 additions & 0 deletions www/controllers/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,23 @@ public static function xzUncompress(string $filename, string $outputFilename = n
unset($myprocess, $content);
}

/**
* Uncompress specified zstd file 'file.zst' to 'file'
*/
public static function zstdUncompress(string $filename)
{
$myprocess = new \Controllers\Process('/usr/bin/unzstd ' . $filename);
$myprocess->execute();
$content = $myprocess->getOutput();
$myprocess->close();

if ($myprocess->getExitCode() != 0) {
throw new Exception('Error while uncompressing zstd file ' . $filename . ': ' . $content);
}

unset($myprocess, $content);
}

/**
* Return true if distant URL is reachable
* The target URL can be a file or a directory
Expand Down
4 changes: 2 additions & 2 deletions www/controllers/Repo/Mirror/Deb.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private function parseReleaseFile()
$splittedLine = explode(' ', trim($line));

/**
* We only need the location with its SHA256 (64 caracters long)
* We only need the location with its SHA256 (64 characters long)
* e.g: bd29d2ec28c10fec66a139d8e9a88ca01ff0f2533ca3fab8dc33c13b533059c1 1279885 main/binary-amd64/Packages
*/
if (strlen($splittedLine[0]) == '64') {
Expand Down Expand Up @@ -181,7 +181,7 @@ private function parseReleaseFile()
$splittedLine = explode(' ', trim($line));

/**
* We only need the location with its md5sum (32 caracters long)
* We only need the location with its md5sum (32 characters long)
* e.g: 35e89f49cdfaa179e552aee1d67c5cdb 2478327 main/i18n/Translation-fr.bz2
*/
if (strlen($splittedLine[0]) == '32') {
Expand Down
7 changes: 6 additions & 1 deletion www/controllers/Repo/Mirror/Rpm.php
Original file line number Diff line number Diff line change
Expand Up @@ -451,14 +451,19 @@ private function parsePrimaryPackagesList(string $primaryFile)
*/
} elseif ($mime == 'application/gzip') {
\Controllers\Common::gunzip($primaryFile);
/**
* Case mime type is application/zstd (.gz file)
*/
} elseif ($mime == 'application/zstd') {
\Controllers\Common::zstdUncompress($primaryFile);
/**
* Case it's another mime type, throw an error
*/
} else {
throw new Exception('MIME type not supported: ' . $mime . '. Please contact the developer to add support for this MIME type.');
}
} catch (Exception $e) {
throw new Exception($e, 'Error while uncompressing <code>'. end(explode('/', $primaryFile)) . '</code>');
throw new Exception('Error while uncompressing <code>'. end(explode('/', $primaryFile)) . '</code>: <pre class="codeblock">' . $e->getMessage() . '</pre>');
}

/**
Expand Down
5 changes: 5 additions & 0 deletions www/public/resources/styles/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ pre.codeblock {
.min-height-100 {min-height: 100px}.min-height-200 {min-height: 200px}.min-height-300 {min-height: 300px}.min-height-400 {min-height: 400px}.min-height-500 {min-height: 500px}.min-height-600 {min-height: 600px}.min-height-700 {min-height: 700px}.min-height-800 {min-height: 800px}.min-height-900 {min-height: 900px}.min-height-1000 {min-height: 1000px}
.min-width-100 {min-width: 100px}.min-width-200 {min-width: 200px}.min-width-300 {min-width: 300px}.min-width-400 {min-width: 400px}.min-width-500 {min-width: 500px}.min-width-600 {min-width: 600px}.min-width-700 {min-width: 700px}.min-width-800 {min-width: 800px}.min-width-900 {min-width: 900px}.min-width-1000 {min-width: 1000px}
.width-100{width:100%}
.height-100{height:100%}
.max-width-fit{max-width:fit-content}
.resize-disabled{resize:none;}

Expand Down Expand Up @@ -344,6 +345,10 @@ td {
/**
* Forms, button, input, textarea
*/
input {
accent-color: #15bf7f;
}

input[type=text], input[type=date], input[type=time], input[type=number], input[type=email], input[type=password], input[type=color], input[type=file], select {
width: 100%;
height: 35px;
Expand Down
2 changes: 1 addition & 1 deletion www/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.16.1
4.16.2

0 comments on commit 982e65d

Please sign in to comment.