public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
* Re: [PATCH] Clean-up scripts
  2017-01-01  0:00 [PATCH] Clean-up scripts Ondrej Oprala
@ 2017-01-01  0:00 ` Dodji Seketeli
  0 siblings, 0 replies; 2+ messages in thread
From: Dodji Seketeli @ 2017-01-01  0:00 UTC (permalink / raw)
  To: Ondrej Oprala; +Cc: libabigail

Ondrej Oprala <ondrej.oprala@gmail.com> a écrit:

>
> 	* scripts/dot_to_png.sh: Clean up the script according to
> 	shellcheck warnings and remarks.
> 	* scripts/dot_to_svg.sh: Likewise.
> 	* scripts/svg_to_plain_svg.sh: Likewise.
> 	* scripts/svg_to_png_and_pdf.sh: Likewise.

Applied to master.

> Signed-off-by: Ondrej Oprala <ondrej.oprala@gmail.com>

Thanks!

-- 
		Dodji

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] Clean-up scripts
@ 2017-01-01  0:00 Ondrej Oprala
  2017-01-01  0:00 ` Dodji Seketeli
  0 siblings, 1 reply; 2+ messages in thread
From: Ondrej Oprala @ 2017-01-01  0:00 UTC (permalink / raw)
  To: libabigail

[-- Attachment #1: Type: text/plain, Size: 113 bytes --]

Hi, attached are a few robustness safety nets that have appeared in 
shellcheck's warnings.

Cheers,

   Ondrej


[-- Attachment #2: 0001-Clean-up-scripts.patch --]
[-- Type: text/x-patch, Size: 2430 bytes --]

From 077df47f791837a114f49178f37f0453683b92b5 Mon Sep 17 00:00:00 2001
From: Ondrej Oprala <ondrej.oprala@gmail.com>
Date: Tue, 11 Apr 2017 16:57:07 +0200
Subject: [PATCH 1/3] Clean up scripts/*

	* scripts/dot_to_png.sh: Clean up the script according to
	shellcheck warnings and remarks.
	* scripts/dot_to_svg.sh: Likewise.
	* scripts/svg_to_plain_svg.sh: Likewise.
	* scripts/svg_to_png_and_pdf.sh: Likewise.

Signed-off-by: Ondrej Oprala <ondrej.oprala@gmail.com>
---
 scripts/dot_to_png.sh         | 10 +++++-----
 scripts/dot_to_svg.sh         | 10 +++++-----
 scripts/svg_to_plain_svg.sh   |  6 +++---
 scripts/svg_to_png_and_pdf.sh |  6 +++---
 4 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/scripts/dot_to_png.sh b/scripts/dot_to_png.sh
index 24a7dc7..0929bdd 100755
--- a/scripts/dot_to_png.sh
+++ b/scripts/dot_to_png.sh
@@ -1,9 +1,9 @@
-#!/bin/bash 
+#!/bin/bash
 
 for i in *.gv
 do
-  echo $i
-  outputpng=`echo $i | sed -e 's/gv/png/'`; 
-  echo $outputpng
-  dot -v -Tpng:cairo -o $outputpng $i;
+  echo "$i"
+  outputpng=${i//gv/png}
+  echo "$outputpng"
+  dot -v -Tpng:cairo -o "$outputpng" "$i"
 done
diff --git a/scripts/dot_to_svg.sh b/scripts/dot_to_svg.sh
index 6b211f7..72d298e 100755
--- a/scripts/dot_to_svg.sh
+++ b/scripts/dot_to_svg.sh
@@ -1,9 +1,9 @@
-#!/bin/bash 
+#!/bin/bash
 
 for i in *.gv
 do
-  echo $i
-  outputsvg=`echo $i | sed -e 's/gv/svg/'`; 
-  echo $outputsvg
-  dot -v -Tsvg:cairo -o $outputsvg $i;
+  echo "$i"
+  outputsvg=${i//gv/svg}
+  echo "$outputsvg"
+  dot -v -Tsvg:cairo -o "$outputsvg" "$i"
 done
diff --git a/scripts/svg_to_plain_svg.sh b/scripts/svg_to_plain_svg.sh
index 7d877f9..5ebb7a4 100755
--- a/scripts/svg_to_plain_svg.sh
+++ b/scripts/svg_to_plain_svg.sh
@@ -1,5 +1,5 @@
-#!/bin/bash 
+#!/bin/bash
 
-for i in *.svg; 
-  do inkscape $i --export-plain-svg=`echo $i | sed -e 's/svg$/plain.svg/'`; 
+for i in *.svg;
+  do inkscape "$i" --export-plain-svg="${i//svg/plain.svg}"
 done
diff --git a/scripts/svg_to_png_and_pdf.sh b/scripts/svg_to_png_and_pdf.sh
index 451747a..b55515b 100755
--- a/scripts/svg_to_png_and_pdf.sh
+++ b/scripts/svg_to_png_and_pdf.sh
@@ -1,5 +1,5 @@
-#!/bin/bash 
+#!/bin/bash
 
-for i in *.svg; 
-  do inkscape $i --export-png=`echo $i | sed -e 's/svg$/png/'` --export-pdf=`echo $i | sed -e 's/svg$/pdf/'`; 
+for i in *.svg;
+  do inkscape "$i" --export-png="${i//svg/png}" --export-pdf="${i//svg/pdf}"
 done
-- 
2.7.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-14  9:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-01  0:00 [PATCH] Clean-up scripts Ondrej Oprala
2017-01-01  0:00 ` Dodji Seketeli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).