mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Adding custom branch support. Just enter the URL instead of master
or RELENG_1_2 etc.
This commit is contained in:
parent
446ffdbdfd
commit
3ab35d3058
@ -58,6 +58,7 @@ if($command_split[2]) {
|
||||
foreach($branches as $branchname => $branchdesc) {
|
||||
echo "{$branchname} \t {$branchdesc}\n";
|
||||
}
|
||||
echo "\nOr alternatively you may enter a custom branch URL.\n\n";
|
||||
$branch = readline("> ");
|
||||
echo "\n";
|
||||
} else {
|
||||
@ -78,8 +79,20 @@ foreach($branches as $branchname => $branchdesc) {
|
||||
$found = true;
|
||||
}
|
||||
if(!$found) {
|
||||
echo "\nInvalid branch.\n";
|
||||
exit;
|
||||
if(isURL($branch)) {
|
||||
echo "\n";
|
||||
echo "NOTE: $branch was not found.\n\n";
|
||||
$command = readline("Is this a custom branch URL? [y]? ");
|
||||
if(strtolower($command) == "y" or $command == "") {
|
||||
$GIT_REPO = $branch;
|
||||
$branch = "master";
|
||||
$found = true;
|
||||
}
|
||||
}
|
||||
if(!$found) {
|
||||
echo "\nNo valid branch found. Exiting.\n\n";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
if($branch == "RESTORE" && $g['platform'] == "pfSense") {
|
||||
@ -196,4 +209,11 @@ function post_cvssync_commands() {
|
||||
echo "\n";
|
||||
}
|
||||
|
||||
function isUrl($url = "") {
|
||||
if($url)
|
||||
if(strstr($url, "rcs.pfsense.org") or strstr($url, "mainline"))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
conf_mount_ro();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user