Revision 51ef2e44
Added by Steve Beaver over 3 years ago
src/etc/inc/pkg-utils.inc | ||
---|---|---|
1664 | 1664 |
global $repopath, $g; |
1665 | 1665 |
|
1666 | 1666 |
$repo = json_decode($json, true); |
1667 |
$basename = "{$repopath}/{$g['product_name']}-repo-custom."; |
|
1667 | 1668 |
|
1668 | 1669 |
if (($repo != NULL) && isset($repo['abi']) && isset($repo['altabi']) && |
1669 | 1670 |
isset($repo['conf']) && isset($repo['descr']) && |
1670 | 1671 |
isset($repo['name']) && (strlen($repo['conf']) > 10)) { |
1671 |
$basename = "{$repopath}/{$g['product_name']}-repo-custom."; |
|
1672 | 1672 |
|
1673 | 1673 |
if (!empty($repo['conf'])) {file_put_contents($basename . "conf", base64_decode($repo['conf']));} |
1674 | 1674 |
if (!empty($repo['descr'])) {file_put_contents($basename . "descr", $repo['descr']);} |
... | ... | |
1699 | 1699 |
} else { |
1700 | 1700 |
/* |
1701 | 1701 |
* If there was anything wrong with the custom repository |
1702 |
* definition, remove the help text to avoid possible confusion
|
|
1702 |
* definition, remove the custom files to avoid possible confusion
|
|
1703 | 1703 |
*/ |
1704 |
if (file_exists($basename . "help")) {
|
|
1705 |
unlink($basename . "help");
|
|
1704 |
foreach (glob($basename . "*") as $f) {
|
|
1705 |
unlink($f);
|
|
1706 | 1706 |
} |
1707 | 1707 |
} |
1708 | 1708 |
} |
Also available in: Unified diff
Delete all custom files if the custom repo specification is incomplete