Tabs to spaces
diff --git a/jenkins-support b/jenkins-support
index 0e3ea92..1ee4a8c 100755
--- a/jenkins-support
+++ b/jenkins-support
@@ -2,35 +2,35 @@
# compare if version1 < version2
versionLT() {
- local v1; v1=$(echo "$1" | cut -d '-' -f 1 )
- local q1; q1=$(echo "$1" | cut -s -d '-' -f 2- )
- local v2; v2=$(echo "$2" | cut -d '-' -f 1 )
- local q2; q2=$(echo "$2" | cut -s -d '-' -f 2- )
- if [ "$v1" = "$v2" ]; then
- if [ "$q1" = "$q2" ]; then
- return 1
- else
- if [ -z "$q1" ]; then
- return 1
- else
- if [ -z "$q2" ]; then
- return 0
- else
- [ "$q1" = "$(echo -e "$q1\n$q2" | sort -V | head -n1)" ]
- fi
- fi
- fi
- else
- [ "$v1" = "$(echo -e "$v1\n$v2" | sort -V | head -n1)" ]
- fi
+ local v1; v1=$(echo "$1" | cut -d '-' -f 1 )
+ local q1; q1=$(echo "$1" | cut -s -d '-' -f 2- )
+ local v2; v2=$(echo "$2" | cut -d '-' -f 1 )
+ local q2; q2=$(echo "$2" | cut -s -d '-' -f 2- )
+ if [ "$v1" = "$v2" ]; then
+ if [ "$q1" = "$q2" ]; then
+ return 1
+ else
+ if [ -z "$q1" ]; then
+ return 1
+ else
+ if [ -z "$q2" ]; then
+ return 0
+ else
+ [ "$q1" = "$(echo -e "$q1\n$q2" | sort -V | head -n1)" ]
+ fi
+ fi
+ fi
+ else
+ [ "$v1" = "$(echo -e "$v1\n$v2" | sort -V | head -n1)" ]
+ fi
}
# returns a plugin version from a plugin archive
get_plugin_version() {
- local archive; archive=$1
- local version; version=$(unzip -p "$archive" META-INF/MANIFEST.MF | grep "^Plugin-Version: " | sed -e 's#^Plugin-Version: ##')
- version=${version%%[[:space:]]}
- echo "$version"
+ local archive; archive=$1
+ local version; version=$(unzip -p "$archive" META-INF/MANIFEST.MF | grep "^Plugin-Version: " | sed -e 's#^Plugin-Version: ##')
+ version=${version%%[[:space:]]}
+ echo "$version"
}
# Copy files from /usr/share/jenkins/ref into $JENKINS_HOME
@@ -38,21 +38,21 @@
# Don't override, as this is just a reference setup, and use from UI
# can then change this, upgrade plugins, etc.
copy_reference_file() {
- f="${1%/}"
- b="${f%.override}"
- rel="${b:23}"
- version_marker="${rel}.version_from_image"
- dir=$(dirname "${b}")
- local action;
- local reason;
- local container_version;
- local image_version;
- local marker_version;
- local log; log=false
- if [[ ${rel} == plugins/*.jpi ]]; then
- container_version=$(get_plugin_version "$JENKINS_HOME/${rel}")
+ f="${1%/}"
+ b="${f%.override}"
+ rel="${b:23}"
+ version_marker="${rel}.version_from_image"
+ dir=$(dirname "${b}")
+ local action;
+ local reason;
+ local container_version;
+ local image_version;
+ local marker_version;
+ local log; log=false
+ if [[ ${rel} == plugins/*.jpi ]]; then
+ container_version=$(get_plugin_version "$JENKINS_HOME/${rel}")
image_version=$(get_plugin_version "${f}")
- if [[ -e $JENKINS_HOME/${version_marker} ]]; then
+ if [[ -e $JENKINS_HOME/${version_marker} ]]; then
marker_version=$(cat "$JENKINS_HOME/${version_marker}")
if versionLT "$marker_version" "$container_version"; then
action="SKIPPED"
@@ -93,19 +93,19 @@
fi
fi
fi
- fi
+ fi
if [[ ! -e $JENKINS_HOME/${rel} || "$action" == "UPGRADED" || $f = *.override ]]; then
action=${action:-"INSTALLED"}
log=true
mkdir -p "$JENKINS_HOME/${dir:23}"
cp -r "${f}" "$JENKINS_HOME/${rel}";
- # pin plugins on initial copy
- touch "$JENKINS_HOME/${rel}.pinned"
+ # pin plugins on initial copy
+ touch "$JENKINS_HOME/${rel}.pinned"
echo "$image_version" > "$JENKINS_HOME/${version_marker}"
reason=${reason:-$image_version}
else
action=${action:-"SKIPPED"}
- fi
+ fi
else
if [[ ! -e $JENKINS_HOME/${rel} || $f = *.override ]]
then
@@ -116,12 +116,12 @@
else
action="SKIPPED"
fi
- fi
- if [[ -n "$VERBOSE" || "$log" == "true" ]]; then
+ fi
+ if [[ -n "$VERBOSE" || "$log" == "true" ]]; then
if [ -z "$reason" ]; then
echo "$action $rel" >> "$COPY_REFERENCE_FILE_LOG"
else
echo "$action $rel : $reason" >> "$COPY_REFERENCE_FILE_LOG"
fi
- fi
+ fi
}
\ No newline at end of file