add --with-upx-pack command

This commit is contained in:
crazywhalecc
2024-02-19 12:17:03 +08:00
committed by Jerry Ma
parent c03220d1ee
commit 9dd89e6b02
6 changed files with 100 additions and 4 deletions

View File

@@ -47,6 +47,13 @@ function arch2gnu(string $arch): string
};
}
function match_pattern(string $pattern, string $subject): bool
{
$pattern = str_replace(['\*', '\\\\.*'], ['.*', '\*'], preg_quote($pattern, '/'));
$pattern = '/^' . $pattern . '$/i';
return preg_match($pattern, $subject) === 1;
}
function quote(string $str, string $quote = '"'): string
{
return $quote . $str . $quote;