Skip to content

Commit

Permalink
System Update Settings - GitSync Options
Browse files Browse the repository at this point in the history
Add GitSync options support.
Minimal, Diff, Show Files, Show Command, Dry Run

(cherry picked from commit ea13447)
  • Loading branch information
NOYB committed Jan 25, 2017
1 parent 727b4a1 commit d336775
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sysutils/pfSense-upgrade/Makefile
@@ -1,7 +1,7 @@
# $FreeBSD$

PORTNAME= pfSense-upgrade
PORTVERSION= 0.9
PORTVERSION= 0.91
CATEGORIES= sysutils
MASTER_SITES= # empty
DISTFILES= # empty
Expand Down
30 changes: 28 additions & 2 deletions sysutils/pfSense-upgrade/files/pfSense-upgrade
Expand Up @@ -563,11 +563,37 @@ pkg_upgrade() {
repository_url=$(/usr/local/sbin/read_xml_tag.sh string system/gitsync/repositoryurl)
branch=$(/usr/local/sbin/read_xml_tag.sh string system/gitsync/branch)

minimal=$(/usr/local/sbin/read_xml_tag.sh boolean system/gitsync/minimal)
diff=$(/usr/local/sbin/read_xml_tag.sh boolean system/gitsync/diff)
show_files=$(/usr/local/sbin/read_xml_tag.sh boolean system/gitsync/show_files)
show_command=$(/usr/local/sbin/read_xml_tag.sh boolean system/gitsync/show_command)
dryrun=$(/usr/local/sbin/read_xml_tag.sh boolean system/gitsync/dryrun)

mute='mute'
options=''
if [ "${minimal}" = "true" ]; then
options=${options}' --minimal'
fi
if [ "${diff}" = "true" ]; then
options=${options}' --diff'
fi
if [ "${show_files}" = "true" ]; then
options=${options}' --show-files'
mute='off'
fi
if [ "${show_command}" = "true" ]; then
options=${options}' --show-command'
mute='off'
fi
if [ "${dryrun}" = "true" ]; then
options=${options}' --dry-run'
fi

# Repository URL is not mandatory
if [ -n "${branch}" ]; then
_exec "/usr/local/sbin/pfSsh.php playback gitsync \
${repositoryurl} ${branch} --upgrading" \
"Running gitsync" mute ignore_result
${repositoryurl} ${branch} ${options} --upgrading" \
"Running gitsync" ${mute} ignore_result
fi
fi
}
Expand Down

0 comments on commit d336775

Please sign in to comment.