[sec-notice PATCH 2/2] scripts: require bash for bashisms

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use of ${BASH_SOURCE[0]} is a syntax error in dash.
Use of `` is pointless when we know we are in bash.

* scripts/lsn2text: Make more robust.
* scripts/lsn2html: Likewise.
* scripts/lsn2indexhtml: Likewise.
* scripts/lsn2index: Likewise.

Signed-off-by: Eric Blake <eblake@xxxxxxxxxx>
---
 scripts/lsn2html      | 4 ++--
 scripts/lsn2index     | 4 ++--
 scripts/lsn2indexhtml | 4 ++--
 scripts/lsn2text      | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/scripts/lsn2html b/scripts/lsn2html
index 904bba6..68a5852 100755
--- a/scripts/lsn2html
+++ b/scripts/lsn2html
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Copyright (C) 2013-2014 Red Hat, Inc.
 #
@@ -20,4 +20,4 @@ set -e

 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

-xsltproc $DIR/../templates/lsn2html.xsl $1
+xsltproc "$DIR/../templates/lsn2html.xsl" "$1"
diff --git a/scripts/lsn2index b/scripts/lsn2index
index 85224b3..e5523da 100755
--- a/scripts/lsn2index
+++ b/scripts/lsn2index
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Copyright (C) 2013-2014 Red Hat, Inc.
 #
@@ -23,7 +23,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 echo '<security-notice-list xmlns="http://security.libvirt.org/xmlns/security-notice-list/1.0";>'
 for n in $@
 do
-  n=`echo $n | sed -e 's,notices/,,'`
+  n=$(echo $n | sed -e 's,notices/,,')
   echo "  <security-notice name='$n'/>"
 done
 echo '</security-notice-list>'
diff --git a/scripts/lsn2indexhtml b/scripts/lsn2indexhtml
index 401dce9..993f14b 100755
--- a/scripts/lsn2indexhtml
+++ b/scripts/lsn2indexhtml
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Copyright (C) 2013-2014 Red Hat, Inc.
 #
@@ -20,4 +20,4 @@ set -e

 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

-xsltproc $DIR/../templates/lsn2indexhtml.xsl $1
+xsltproc "$DIR/../templates/lsn2indexhtml.xsl" "$1"
diff --git a/scripts/lsn2text b/scripts/lsn2text
index 177712e..427a7d7 100755
--- a/scripts/lsn2text
+++ b/scripts/lsn2text
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Copyright (C) 2013-2014 Red Hat, Inc.
 #
@@ -20,4 +20,4 @@ set -e

 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

-xsltproc $DIR/../templates/lsn2text.xsl $1
+xsltproc "$DIR/../templates/lsn2text.xsl" "$1"
-- 
1.8.4.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]