summaryrefslogtreecommitdiffstats
path: root/etc/phpshellsessions
diff options
context:
space:
mode:
authorErik Fonnesbeck <efonnes@gmail.com>2012-02-28 12:14:21 -0700
committerErik Fonnesbeck <efonnes@gmail.com>2012-02-28 12:32:36 -0700
commitdfb4dcaa3204b5570dfbf2fbfe96cc529d80a447 (patch)
tree7d0864f8411e15cbf4ecc91c629cbe7fbc86208e /etc/phpshellsessions
parentce3da5d20f2e9259d0c85c5678695d6c0e49cd52 (diff)
downloadpfsense-dfb4dcaa3204b5570dfbf2fbfe96cc529d80a447.zip
pfsense-dfb4dcaa3204b5570dfbf2fbfe96cc529d80a447.tar.gz
Allow specifying the branch name after the repository URL for gitsync command-line arguments and remove an unnecessary use of the backtick operator.
Diffstat (limited to 'etc/phpshellsessions')
-rw-r--r--etc/phpshellsessions/gitsync32
1 files changed, 22 insertions, 10 deletions
diff --git a/etc/phpshellsessions/gitsync b/etc/phpshellsessions/gitsync
index 0689f7c..9550d5d 100644
--- a/etc/phpshellsessions/gitsync
+++ b/etc/phpshellsessions/gitsync
@@ -112,18 +112,30 @@ foreach($branches as $branchname => $branchdesc) {
}
if(!$found) {
if(isURL($branch) && !$upgrading) {
- echo "\n";
- echo "NOTE: $branch was not found.\n\n";
- $command = readline("Is this a custom GIT URL? [y]? ");
- if(strtolower($command) == "y" or $command == "") {
+ if($command_split[3]) {
+ $GIT_REPO = $branch;
+ $branch = $command_split[3];
+ $found = true;
+ }
+ else if($argv[4]) {
$GIT_REPO = $branch;
- $command = readline("Checkout which branch [RELENG_2_0]? ");
- if($command == "")
- $branch = "RELENG_2_0";
- if($command)
- $branch = $command;
+ $branch = $argv[4];
$found = true;
}
+ else {
+ echo "\n";
+ echo "NOTE: $branch was not found.\n\n";
+ $command = readline("Is this a custom GIT URL? [y]? ");
+ if(strtolower($command) == "y" or $command == "") {
+ $GIT_REPO = $branch;
+ $command = readline("Checkout which branch [RELENG_2_0]? ");
+ if($command == "")
+ $branch = "RELENG_2_0";
+ if($command)
+ $branch = $command;
+ $found = true;
+ }
+ }
}
if(!$found) {
echo "\nNo valid branch found. Exiting.\n\n";
@@ -200,7 +212,7 @@ if($branch == "build_commit") {
$git_cmd = array(
"cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git branch " . escapeshellarg($branch) . " 2>/dev/null",
"cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git checkout -f " . escapeshellarg($branch) . " 2>/dev/null",
- "cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git reset --hard `cat /etc/version.lastcommit`"
+ "cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git reset --hard " . escapeshellarg(file_get_contents("/etc/version.lastcommit"))
);
} else {
$git_cmd = array(
OpenPOWER on IntegriCloud