summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Fonnesbeck <efonnes@gmail.com>2011-02-04 05:52:30 -0700
committerErik Fonnesbeck <efonnes@gmail.com>2011-02-04 05:58:41 -0700
commitb5efd82a93eb7f73dd9119b2669c9dca704b430f (patch)
tree47081beda37165c8939970f9805b3c80590dde29
parent891012ce078fc49deaaff8fae0954b2caadb2d50 (diff)
downloadpfsense-b5efd82a93eb7f73dd9119b2669c9dca704b430f.zip
pfsense-b5efd82a93eb7f73dd9119b2669c9dca704b430f.tar.gz
Display the last used repository and branch and add a couple more descriptions.
-rwxr-xr-xusr/local/www/system_firmware_settings.php37
1 files changed, 36 insertions, 1 deletions
diff --git a/usr/local/www/system_firmware_settings.php b/usr/local/www/system_firmware_settings.php
index ea3c215..793b8fc 100755
--- a/usr/local/www/system_firmware_settings.php
+++ b/usr/local/www/system_firmware_settings.php
@@ -179,18 +179,53 @@ function enable_altfirmwareurl(enable_over) {
<?=gettext("After updating, sync with the following repository/branch before reboot."); ?>
</td>
</tr>
+<?php
+ if(is_dir("/root/pfsense/pfSenseGITREPO/pfSenseGITREPO")) {
+ exec("cd /root/pfsense/pfSenseGITREPO/pfSenseGITREPO && git config remote.origin.url", $output_str);
+ if(is_array($output_str) && !empty($output_str[0]))
+ $lastrepositoryurl = $output_str[0];
+ unset($output_str);
+ }
+?>
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Repository URL"); ?></td>
<td width="78%" class="vtable">
<input name="repositoryurl" type="input" class="formfld url" id="repositoryurl" size="64" value="<?php if ($gitcfg['repositoryurl']) echo $gitcfg['repositoryurl']; ?>">
+<?php if($lastrepositoryurl): ?>
+ <br />
+ <?=sprintf(gettext("The most recently used repository was %s"), $lastrepositoryurl); ?>
+ <br />
+ <?=gettext("This will be used if the field is left blank."); ?>
+<?php endif; ?>
</td>
</tr>
+<?php
+ if(is_dir("/root/pfsense/pfSenseGITREPO/pfSenseGITREPO")) {
+ exec("cd /root/pfsense/pfSenseGITREPO/pfSenseGITREPO && git branch", $output_str);
+ if(is_array($output_str)) {
+ foreach($output_str as $output_line) {
+ if(strstr($output_line, '* ')) {
+ $lastbranch = substr($output_line, 2);
+ break;
+ }
+ }
+ }
+ unset($output_str);
+ }
+?>
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Branch name"); ?></td>
<td width="78%" class="vtable">
<input name="branch" type="input" class="formfld unknown" id="branch" size="64" value="<?php if ($gitcfg['branch']) echo $gitcfg['branch']; ?>">
+<?php if($lastbranch): ?>
+ <br />
+ <?=sprintf(gettext("The most recently used branch was %s"), $lastbranch); ?>
+<?php else: ?>
+ <br />
+ <?=gettext("Usually the branch name is master"); ?>
+<?php endif; ?>
<br />
- <?=gettext("Sync will not be performed if a branch is not specified."); ?>
+ <?=gettext("Note: Sync will not be performed if a branch is not specified."); ?>
</td>
</tr>
<?php endif; ?>
OpenPOWER on IntegriCloud