[Debian-ha-commits] [crmsh] 02/03: Update dash fix from upstream
Valentin Vidic
vvidic-guest at moszumanska.debian.org
Thu Nov 3 09:53:48 UTC 2016
This is an automated email from the git hooks/post-receive script.
vvidic-guest pushed a commit to branch master
in repository crmsh.
commit a2609262856f9b8fd8009e49f7c0e6dfea12ec74
Author: Valentin Vidic <Valentin.Vidic at CARNet.hr>
Date: Thu Nov 3 10:14:24 2016 +0100
Update dash fix from upstream
https://github.com/ClusterLabs/crmsh/issues/164
---
debian/patches/0008-Fix-crm-report-for-dash.patch | 136 ++++++++++++++++++++++
debian/patches/0008-Use-bash-for-crm-report.patch | 18 ---
debian/patches/series | 2 +-
3 files changed, 137 insertions(+), 19 deletions(-)
diff --git a/debian/patches/0008-Fix-crm-report-for-dash.patch b/debian/patches/0008-Fix-crm-report-for-dash.patch
new file mode 100644
index 0000000..d4b7460
--- /dev/null
+++ b/debian/patches/0008-Fix-crm-report-for-dash.patch
@@ -0,0 +1,136 @@
+Author: Dejan Muhamedagic <dejan at hello-penguin.com>
+Bug: https://github.com/ClusterLabs/crmsh/issues/164
+Origin: commit:61c7d0cbc6363a8197d9e6f02222df8ce8bd1a20
+Subject: Medium: hb_report: don't use backticks in local
+
+ dash dislikes initializing variables along with the local
+ statmement (and it's anyway bad practice).
+
+Last-Update: 2016-11-03
+
+diff --git a/hb_report/hb_report.in b/hb_report/hb_report.in
+index 8f6fe0d..5275c29 100755
+--- a/hb_report/hb_report.in
++++ b/hb_report/hb_report.in
+@@ -137,7 +137,8 @@ version() {
+ # these are "global" variables
+ #
+ setvarsanddefaults() {
+- local now=`perl -e 'print time()'`
++ local now
++ now=`perl -e 'print time()'`
+ # used by all
+ DEST=""
+ FROM_TIME=""
+@@ -353,7 +354,8 @@ is_our_log() {
+ local from_time=$2
+ local to_time=$3
+
+- local cat=`find_decompressor $logf`
++ local cat
++ cat=`find_decompressor $logf`
+ local first_time="`$cat $logf | head -10 | find_first_ts`"
+ local last_time="`$cat $logf | tail -10 | tac | find_first_ts`"
+ if [ x = "x$first_time" -o x = "x$last_time" ]; then
+@@ -407,7 +409,8 @@ arch_logs() {
+ # print part of the log
+ #
+ print_log() {
+- local cat=`find_decompressor $1`
++ local cat
++ cat=`find_decompressor $1`
+ $cat $1
+ }
+ print_logseg() {
+@@ -422,7 +425,8 @@ print_logseg() {
+ local tmp sourcef
+
+ # uncompress to a temp file (if necessary)
+- local cat=`find_decompressor $logf`
++ local cat
++ cat=`find_decompressor $logf`
+ if [ "$cat" != "cat" ]; then
+ tmp=`mktemp` ||
+ fatal "disk full"
+@@ -462,7 +466,8 @@ print_logseg() {
+ loginfo() {
+ local logf=$1
+ local fake=$2
+- local nextpos=`python -c "f=open('$logf');f.seek(0,2);print f.tell()+1"`
++ local nextpos
++ nextpos=`python -c "f=open('$logf');f.seek(0,2);print f.tell()+1"`
+ if [ "$fake" ]; then
+ echo "synthetic:$logf $nextpos"
+ else
+@@ -477,15 +482,20 @@ dumplogset() {
+ local from_time=$2
+ local to_time=$3
+
+- local logf_set=`arch_logs $logf $from_time $to_time`
++ local logf_set
++ logf_set=`arch_logs $logf $from_time $to_time`
+ if [ x = "x$logf_set" ]; then
+ return
+ fi
+
+- local num_logs=`echo "$logf_set" | wc -l`
+- local oldest=`echo $logf_set | awk '{print $NF}'`
+- local newest=`echo $logf_set | awk '{print $1}'`
+- local mid_logfiles=`echo $logf_set | awk '{for(i=NF-1; i>1; i--) print $i}'`
++ local num_logs
++ num_logs=`echo "$logf_set" | wc -l`
++ local oldest
++ oldest=`echo $logf_set | awk '{print $NF}'`
++ local newest
++ newest=`echo $logf_set | awk '{print $1}'`
++ local mid_logfiles
++ mid_logfiles=`echo $logf_set | awk '{for(i=NF-1; i>1; i--) print $i}'`
+
+ # the first logfile: from $from_time to $to_time (or end)
+ # logfiles in the middle: all
+@@ -661,8 +671,10 @@ getbacktraces() {
+ }
+ }
+ pe2dot() {
+- local pef=`basename $1`
+- local dotf=`basename $pef .bz2`.dot
++ local pef
++ pef=`basename $1`
++ local dotf
++ dotf=`basename $pef .bz2`.dot
+ test -z "$PTEST" && return
+ (
+ cd `dirname $1`
+diff --git a/hb_report/utillib.sh b/hb_report/utillib.sh
+index 8fbbb76..8ac5f26 100644
+--- a/hb_report/utillib.sh
++++ b/hb_report/utillib.sh
+@@ -219,7 +219,8 @@ findln_by_time() {
+ local logf=$1
+ local tm=$2
+ local first=1
+- local last=`wc -l < $logf`
++ local last
++ last=`wc -l < $logf`
+ local tmid mid trycnt prevmid
+ while [ $first -le $last ]; do
+ mid=$((($last+$first)/2))
+@@ -722,14 +723,16 @@ get_pkg_mgr() {
+ }
+
+ pkg_versions() {
+- local pkg_mgr=`get_pkg_mgr`
++ local pkg_mgr
++ pkg_mgr=`get_pkg_mgr`
+ [ -z "$pkg_mgr" ] &&
+ return
+ debug "the package manager is $pkg_mgr"
+ pkg_ver_$pkg_mgr $*
+ }
+ verify_packages() {
+- local pkg_mgr=`get_pkg_mgr`
++ local pkg_mgr
++ pkg_mgr=`get_pkg_mgr`
+ [ -z "$pkg_mgr" ] &&
+ return
+ verify_$pkg_mgr $*
diff --git a/debian/patches/0008-Use-bash-for-crm-report.patch b/debian/patches/0008-Use-bash-for-crm-report.patch
deleted file mode 100644
index 8f4976e..0000000
--- a/debian/patches/0008-Use-bash-for-crm-report.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-From: Valentin Vidic <Valentin.Vidic at CARNet.hr>
-Subject: crm report script does not work with dash
-
- The problem seems to be with backticks returning multiple values:
- # crm report -f 2am -M -E /var/log/syslog -d -s -Z
- /usr/share/crmsh/hb_report/hb_report: 480: local: /var/log/syslog.1: bad variable name
-
-Bug: https://github.com/ClusterLabs/crmsh/issues/164
-Last-Update: 2016-11-02
-
---- a/hb_report/hb_report.in
-+++ b/hb_report/hb_report.in
-@@ -1,4 +1,4 @@
--#!/bin/sh
-+#!/bin/bash
- # Copyright (C) 2007 Dejan Muhamedagic <dmuhamedagic at suse.de>
- # See COPYING for license information.
-
diff --git a/debian/patches/series b/debian/patches/series
index ed074bc..815df50 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,4 +3,4 @@
0005-Fix-privacy-breach-generic-caused-by-atom-xml-templa.patch
0006-Fix-privacy-breach-generic-caused-by-youtube-iframe.patch
0007-pygmentize-lexer.patch
-0008-Use-bash-for-crm-report.patch
+0008-Fix-crm-report-for-dash.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-ha/crmsh.git
More information about the Debian-HA-Commits
mailing list