Skip to contentSkip to conversation

csstoh.sh shell script fixes cross compiling issues

PATCH Applied Thomas Waldecker 5 participants 12 messages Nov 30, 2012 – Feb 6, 2013

lore
Share & tools
lore

Thomas Waldecker

author
#0 lore raw

PATCH 1/1 csstoh.sh shell script fixes cross compiling issues

From: Thomas Waldecker <thomas.waldecker(a)tqs.de>

Added the csstoh.sh shell script from Igor Zhbanov found here:
http://lists.01.org/pipermail/powertop/2012-July/000151.html
also patched the Makefile.am to use the csstoh.sh script. The compiled csstoh binary doesn't work for cross compiling, however Igors Patch never got applied upstream.

---
 src/Makefile.am |    8 +++-----
 src/csstoh.sh   |   45 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 48 insertions(+), 5 deletions(-)
 create mode 100755 src/csstoh.sh
src/Makefile.am +3 -5
index f60426a..a53d942 100644
@@ -1,9 +1,6 @@
 AUTOMAKE_OPTIONS = subdir-objects
 ACLOCAL_AMFLAGS = -I ../m4 
 
-noinst_PROGRAMS = csstoh
-csstoh_SOURCES = csstoh.c 
-
 sbin_PROGRAMS = powertop
 nodist_powertop_SOURCES = css.h
 
@@ -48,6 +45,7 @@ AM_LDFLAGS = $(LIBS) $(NCURSES_LIBS) $(PCIUTILS_LIBS) $(LIBNL_LIBS) $(LIBZ_LIBS)
 
 BUILT_SOURCES = css.h
 CLEANFILES = css.h
-css.h: csstoh powertop.css
-	./csstoh "$(srcdir)"/powertop.css css.h
+css.h: powertop.css
+	chmod +x ./csstoh.sh
+	./csstoh.sh "$(srcdir)"/powertop.css css.h
 
src/csstoh.sh new file +45 -0

45 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 15 lines · Thomas Waldecker

Date: Fri, 30 Nov 2012 13:46:27 +0100
From: Thomas Waldecker <thomas.waldecker(a)gmail.com>
To: powertop(a)lists.01.org
Cc: Thomas Waldecker <thomas.waldecker(a)tqs.de>
Subject: [Powertop] [PATCH] csstoh.sh shell script fixes cross compiling
issues
X-Mailer: git-send-email 1.7.11.7

From: Thomas Waldecker <thomas.waldecker(a)tqs.de>

Added the csstoh.sh shell script from Igor Zhbanov found here:
http://lists.01.org/pipermail/powertop/2012-July/000151.html
also patched the Makefile.am to use the csstoh.sh script. The compiled csstoh binary doesn't work for cross compiling, however Igors Patch never got applied upstream.

Quoted 6 lines
---
 src/Makefile.am |    8 +++-----
 src/csstoh.sh   |   45 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 48 insertions(+), 5 deletions(-)
 create mode 100755 src/csstoh.sh

looks good to me, thanks.

	-ss
Quoted 83 lines
src/Makefile.am +3 -5
index f60426a..a53d942 100644
@@ -1,9 +1,6 @@
 AUTOMAKE_OPTIONS = subdir-objects
 ACLOCAL_AMFLAGS = -I ../m4 
 
-noinst_PROGRAMS = csstoh
-csstoh_SOURCES = csstoh.c 
-
 sbin_PROGRAMS = powertop
 nodist_powertop_SOURCES = css.h
 
@@ -48,6 +45,7 @@ AM_LDFLAGS = $(LIBS) $(NCURSES_LIBS) $(PCIUTILS_LIBS) $(LIBNL_LIBS) $(LIBZ_LIBS)
 
 BUILT_SOURCES = css.h
 CLEANFILES = css.h
-css.h: csstoh powertop.css
-	./csstoh "$(srcdir)"/powertop.css css.h
+css.h: powertop.css
+	chmod +x ./csstoh.sh
+	./csstoh.sh "$(srcdir)"/powertop.css css.h
 
src/csstoh.sh new file +45 -0
new file mode 100755
index 0000000..5918d12
@@ -0,0 +1,45 @@
+#!/bin/bash
+#
+# This program file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program in a file named COPYING; if not, write to the
+# Free Software Foundation, Inc,
+# 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301 USA
+# or just google for it.
+#
+# Written by Igor Zhbanov<i.zhbanov at samsung.com>
+
+
+if [ $# -lt 2 ]; then
+	echo "Usage: csstoh.sh cssfile header.h"
+	exit 1
+fi
+
+if [ ! -r $1 ]; then
+	echo "Can't find file $1"
+	exit 1
+fi
+
+if ! echo -n>$2; then
+	echo "Can't open file $2 for writing."
+	exit 1
+fi
+
+echo "#ifndef __INCLUDE_GUARD_CCS_H">>  $2
+echo "#define __INCLUDE_GUARD_CCS_H">>  $2
+echo>>  $2
+echo "const char css[] = ">>  $2
+
+sed -r 's/^(.*)$/\t\"\1\\n\"/' $1>>  $2
+
+echo ";">>  $2
+echo "#endif">>  $2
Signature · 6 lines
1.7.9.5

_______________________________________________
PowerTop mailing list
PowerTop(a)lists.01.org
https://lists.01.org/mailman/listinfo/powertop
Applied
#2 lore raw
In reply to Thomas Waldecker
Quoted 78 lines · On Fri, 30 Nov 2012 13:46:27 +0100 Thomas Waldecker…

From: Thomas Waldecker <thomas.waldecker(a)tqs.de>

Added the csstoh.sh shell script from Igor Zhbanov found here:
http://lists.01.org/pipermail/powertop/2012-July/000151.html
also patched the Makefile.am to use the csstoh.sh script. The compiled csstoh binary doesn't work for cross compiling, however Igors Patch never got applied upstream.

---
 src/Makefile.am |    8 +++-----
 src/csstoh.sh   |   45 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 48 insertions(+), 5 deletions(-)
 create mode 100755 src/csstoh.sh
src/Makefile.am +3 -5
index f60426a..a53d942 100644
@@ -1,9 +1,6 @@
 AUTOMAKE_OPTIONS = subdir-objects
 ACLOCAL_AMFLAGS = -I ../m4 
 
-noinst_PROGRAMS = csstoh
-csstoh_SOURCES = csstoh.c 
-
 sbin_PROGRAMS = powertop
 nodist_powertop_SOURCES = css.h
 
@@ -48,6 +45,7 @@ AM_LDFLAGS = $(LIBS) $(NCURSES_LIBS)
 $(PCIUTILS_LIBS) $(LIBNL_LIBS) $(LIBZ_LIBS) 
 BUILT_SOURCES = css.h
 CLEANFILES = css.h
-css.h: csstoh powertop.css
-	./csstoh "$(srcdir)"/powertop.css css.h
+css.h: powertop.css
+	chmod +x ./csstoh.sh
+	./csstoh.sh "$(srcdir)"/powertop.css css.h
 
src/csstoh.sh new file +3 -0
new file mode 100755
index 0000000..5918d12
@@ -0,0 +1,45 @@
+#!/bin/bash
+#
+# This program file is free software; you can redistribute it and/or

modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; version 2 of the License. +#
+# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details.

src/csstoh.sh new file +3 -0
+#
+# You should have received a copy of the GNU General Public License
+# along with this program in a file named COPYING; if not, write to

the +# Free Software Foundation, Inc,

src/csstoh.sh new file +21 -0
+# 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301 USA
+# or just google for it.
+#
+# Written by Igor Zhbanov<i.zhbanov at samsung.com>
+
+
+if [ $# -lt 2 ]; then
+	echo "Usage: csstoh.sh cssfile header.h"
+	exit 1
+fi
+
+if [ ! -r $1 ]; then
+	echo "Can't find file $1"
+	exit 1
+fi
+
+if ! echo -n>$2; then
+	echo "Can't open file $2 for writing."
+	exit 1
+fi

src/csstoh.sh line 45

Quoted 10 lines
src/csstoh.sh new file +10 -0
+
+echo "#ifndef __INCLUDE_GUARD_CCS_H">>  $2
+echo "#define __INCLUDE_GUARD_CCS_H">>  $2
+echo>>  $2
+echo "const char css[] = ">>  $2
+
+sed -r 's/^(.*)$/\t\"\1\\n\"/' $1>>  $2
+
+echo ";">>  $2
+echo "#endif">>  $2

Applied, thanks.

Kristen

#3 lore raw
Quoted 10 lines · Kristen Carlson Accardi
Quoted 7 lines · On Fri, 30 Nov 2012 13:46:27 +0100 Thomas Waldecker…

From: Thomas Waldecker <thomas.waldecker(a)tqs.de>

Added the csstoh.sh shell script from Igor Zhbanov found here:
http://lists.01.org/pipermail/powertop/2012-July/000151.html
also patched the Makefile.am to use the csstoh.sh script. The compiled csstoh binary doesn't work for cross compiling, however Igors Patch never got applied upstream.

Why the one from 151.html and not the one at the end of the thread in
http://lists.01.org/pipermail/powertop/2012-July/000165.html

/MF

author
#4 lore raw

PATCH 1/1 csstoh shell-script for cross-compiling

Updated the shellscript with changes made by Igor posted in mailing list
https://lists.01.org/pipermail/powertop/2012-July/000165.html

---
 .gitignore      |  1 -
 src/Makefile.am |  3 +--
 src/csstoh.sh   | 21 ++++++++++-----------
 3 files changed, 11 insertions(+), 14 deletions(-)
.gitignore +0 -1
index 96ffdba..35d41c2 100644
@@ -39,7 +39,6 @@ po/*.gmo
 po/stamp-po
 src/powertop
 src/css.h
-src/csstoh
 src/Makefile.in
 src/.deps/
 src/Makefile
src/Makefile.am +1 -2
index a53d942..398b8a7 100644
@@ -46,6 +46,5 @@ AM_LDFLAGS = $(LIBS) $(NCURSES_LIBS) $(PCIUTILS_LIBS) $(LIBNL_LIBS) $(LIBZ_LIBS)
 BUILT_SOURCES = css.h
 CLEANFILES = css.h
 css.h: powertop.css
-	chmod +x ./csstoh.sh
-	./csstoh.sh "$(srcdir)"/powertop.css css.h
+	$(SHELL) ./csstoh.sh powertop.css css.h
 
src/csstoh.sh +10 -11
index 5918d12..9d4100b 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 #
 # This program file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by the
@@ -16,8 +16,7 @@
 # Boston, MA 02110-1301 USA
 # or just google for it.
 #
-# Written by Igor Zhbanov<i.zhbanov at samsung.com>
-
+# Written by Igor Zhbanov <i.zhbanov at samsung.com>
 
 if [ $# -lt 2 ]; then
 	echo "Usage: csstoh.sh cssfile header.h"
@@ -29,17 +28,17 @@ if [ ! -r $1 ]; then
 	exit 1
 fi
 
-if ! echo -n>$2; then
+if ! echo -n >$2; then
 	echo "Can't open file $2 for writing."
 	exit 1
 fi
 
-echo "#ifndef __INCLUDE_GUARD_CCS_H">>  $2
-echo "#define __INCLUDE_GUARD_CCS_H">>  $2
-echo>>  $2
-echo "const char css[] = ">>  $2
+echo "#ifndef __INCLUDE_GUARD_CCS_H" >> $2
+echo "#define __INCLUDE_GUARD_CCS_H" >> $2
+echo >> $2
+echo "const char css[] = " >> $2
 
-sed -r 's/^(.*)$/\t\"\1\\n\"/' $1>>  $2
+sed -r 's/^(.*)$/\t\"\1\\n\"/' $1 >> $2
 
-echo ";">>  $2
-echo "#endif">>  $2
+echo ";" >> $2
+echo "#endif" >> $2
Signature · 1 line
1.8.1
#5 lore raw

Re: [Powertop] [PATCH] csstoh shell-script for cross-compiling

Quoted 3 lines · Thomas Waldecker

Updated the shellscript with changes made by Igor posted in mailing list
https://lists.01.org/pipermail/powertop/2012-July/000165.html
---

Cc Igor

All right, first, my bad, I should admit that I overlooked this patch. Sorry Igor, and thanks to Thomas.

Second, Thomas, were you aware of the V2 patch by the time you submitted Igor's V1?

Quoted 1 line

From ethical point of view, I think only original author can change this line

-# Written by Igor Zhbanov<i.zhbanov at samsung.com> -
+# Written by Igor Zhbanov <i.zhbanov at samsung.com>

	-ss
Quoted 83 lines
 .gitignore      |  1 -
 src/Makefile.am |  3 +--
 src/csstoh.sh   | 21 ++++++++++-----------
 3 files changed, 11 insertions(+), 14 deletions(-)
.gitignore +0 -1
index 96ffdba..35d41c2 100644
@@ -39,7 +39,6 @@ po/*.gmo
 po/stamp-po
 src/powertop
 src/css.h
-src/csstoh
 src/Makefile.in
 src/.deps/
 src/Makefile
src/Makefile.am +1 -2
index a53d942..398b8a7 100644
@@ -46,6 +46,5 @@ AM_LDFLAGS = $(LIBS) $(NCURSES_LIBS) $(PCIUTILS_LIBS) $(LIBNL_LIBS) $(LIBZ_LIBS)
 BUILT_SOURCES = css.h
 CLEANFILES = css.h
 css.h: powertop.css
-	chmod +x ./csstoh.sh
-	./csstoh.sh "$(srcdir)"/powertop.css css.h
+	$(SHELL) ./csstoh.sh powertop.css css.h
 
src/csstoh.sh +10 -11
index 5918d12..9d4100b 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 #
 # This program file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by the
@@ -16,8 +16,7 @@
 # Boston, MA 02110-1301 USA
 # or just google for it.
 #
-# Written by Igor Zhbanov<i.zhbanov at samsung.com>
-
+# Written by Igor Zhbanov <i.zhbanov at samsung.com>
 
 if [ $# -lt 2 ]; then
 	echo "Usage: csstoh.sh cssfile header.h"
@@ -29,17 +28,17 @@ if [ ! -r $1 ]; then
 	exit 1
 fi
 
-if ! echo -n>$2; then
+if ! echo -n >$2; then
 	echo "Can't open file $2 for writing."
 	exit 1
 fi
 
-echo "#ifndef __INCLUDE_GUARD_CCS_H">>  $2
-echo "#define __INCLUDE_GUARD_CCS_H">>  $2
-echo>>  $2
-echo "const char css[] = ">>  $2
+echo "#ifndef __INCLUDE_GUARD_CCS_H" >> $2
+echo "#define __INCLUDE_GUARD_CCS_H" >> $2
+echo >> $2
+echo "const char css[] = " >> $2
 
-sed -r 's/^(.*)$/\t\"\1\\n\"/' $1>>  $2
+sed -r 's/^(.*)$/\t\"\1\\n\"/' $1 >> $2
 
-echo ";">>  $2
-echo "#endif">>  $2
+echo ";" >> $2
+echo "#endif" >> $2
Signature · 6 lines
1.8.1

_______________________________________________
PowerTop mailing list
PowerTop(a)lists.01.org
https://lists.01.org/mailman/listinfo/powertop
#6 lore raw

Re: [Powertop] [PATCH] csstoh shell-script for cross-compiling

Quoted 14 lines · On Sat, 2 Feb 2013 09:26:56 +0300 Sergey Senozhatsky…
Quoted 3 lines · Thomas Waldecker

Updated the shellscript with changes made by Igor posted in mailing list
https://lists.01.org/pipermail/powertop/2012-July/000165.html
---

Cc Igor

All right, first, my bad, I should admit that I overlooked this patch. Sorry Igor, and thanks to Thomas.

Second, Thomas, were you aware of the V2 patch by the time you submitted Igor's V1?

Quoted 9 lines

From ethical point of view, I think only original author can change this line

-# Written by Igor Zhbanov<i.zhbanov at samsung.com> -
+# Written by Igor Zhbanov <i.zhbanov at samsung.com>

	-ss

It's just a whitespace change. I see no issue.

#7 lore raw

Re: [Powertop] [PATCH] csstoh shell-script for cross-compiling

In reply to Thomas Waldecker
Quoted 2 lines · On Fri, 1 Feb 2013 21:37:09 +0100 Thomas Waldecker…

Updated the shellscript with changes made by Igor posted in mailing list
https://lists.01.org/pipermail/powertop/2012-July/000165.html

The patch no longer applies, because I took Sergey's patch removing csstoh. You'll have to redo it.

I don't have a problem with taking this patch if you say it works for you, with or without Igor's ack, as long as it's harmless to native compiling. I'm never going to test cross compiling though.

My suggestion to you is to just CC Igor on your revised patch - if he wants to nack it and resubmit his own he can, otherwise I'll take yours after some reasonable period of time.

Quoted 76 lines
---
 .gitignore      |  1 -
 src/Makefile.am |  3 +--
 src/csstoh.sh   | 21 ++++++++++-----------
 3 files changed, 11 insertions(+), 14 deletions(-)
.gitignore +0 -1
index 96ffdba..35d41c2 100644
@@ -39,7 +39,6 @@ po/*.gmo
 po/stamp-po
 src/powertop
 src/css.h
-src/csstoh
 src/Makefile.in
 src/.deps/
 src/Makefile
src/Makefile.am +1 -2
index a53d942..398b8a7 100644
@@ -46,6 +46,5 @@ AM_LDFLAGS = $(LIBS) $(NCURSES_LIBS) $(PCIUTILS_LIBS) $(LIBNL_LIBS) $(LIBZ_LIBS)
 BUILT_SOURCES = css.h
 CLEANFILES = css.h
 css.h: powertop.css
-	chmod +x ./csstoh.sh
-	./csstoh.sh "$(srcdir)"/powertop.css css.h
+	$(SHELL) ./csstoh.sh powertop.css css.h
 
src/csstoh.sh +10 -11
index 5918d12..9d4100b 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 #
 # This program file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by the
@@ -16,8 +16,7 @@
 # Boston, MA 02110-1301 USA
 # or just google for it.
 #
-# Written by Igor Zhbanov<i.zhbanov at samsung.com>
-
+# Written by Igor Zhbanov <i.zhbanov at samsung.com>
 
 if [ $# -lt 2 ]; then
 	echo "Usage: csstoh.sh cssfile header.h"
@@ -29,17 +28,17 @@ if [ ! -r $1 ]; then
 	exit 1
 fi
 
-if ! echo -n>$2; then
+if ! echo -n >$2; then
 	echo "Can't open file $2 for writing."
 	exit 1
 fi
 
-echo "#ifndef __INCLUDE_GUARD_CCS_H">>  $2
-echo "#define __INCLUDE_GUARD_CCS_H">>  $2
-echo>>  $2
-echo "const char css[] = ">>  $2
+echo "#ifndef __INCLUDE_GUARD_CCS_H" >> $2
+echo "#define __INCLUDE_GUARD_CCS_H" >> $2
+echo >> $2
+echo "const char css[] = " >> $2
 
-sed -r 's/^(.*)$/\t\"\1\\n\"/' $1>>  $2
+sed -r 's/^(.*)$/\t\"\1\\n\"/' $1 >> $2
 
-echo ";">>  $2
-echo "#endif">>  $2
+echo ";" >> $2
+echo "#endif" >> $2
author
#8 lore raw

PATCH 1/1 csstoh shell-script for cross-compiling

Updated the shellscript with changes made by Igor posted in mailing list
https://lists.01.org/pipermail/powertop/2012-July/000165.html

Signed-off-by Thomas Waldecker <thomas.waldecker(a)gmail.com>
---
 src/Makefile.am |  3 +--
 src/csstoh.sh   | 21 ++++++++++-----------
 2 files changed, 11 insertions(+), 13 deletions(-)
src/Makefile.am +1 -2
index a53d942..398b8a7 100644
@@ -46,6 +46,5 @@ AM_LDFLAGS = $(LIBS) $(NCURSES_LIBS) $(PCIUTILS_LIBS) $(LIBNL_LIBS) $(LIBZ_LIBS)
 BUILT_SOURCES = css.h
 CLEANFILES = css.h
 css.h: powertop.css
-	chmod +x ./csstoh.sh
-	./csstoh.sh "$(srcdir)"/powertop.css css.h
+	$(SHELL) ./csstoh.sh powertop.css css.h
 
src/csstoh.sh +10 -11
index 5918d12..9d4100b 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 #
 # This program file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by the
@@ -16,8 +16,7 @@
 # Boston, MA 02110-1301 USA
 # or just google for it.
 #
-# Written by Igor Zhbanov<i.zhbanov at samsung.com>
-
+# Written by Igor Zhbanov <i.zhbanov at samsung.com>
 
 if [ $# -lt 2 ]; then
 	echo "Usage: csstoh.sh cssfile header.h"
@@ -29,17 +28,17 @@ if [ ! -r $1 ]; then
 	exit 1
 fi
 
-if ! echo -n>$2; then
+if ! echo -n >$2; then
 	echo "Can't open file $2 for writing."
 	exit 1
 fi
 
-echo "#ifndef __INCLUDE_GUARD_CCS_H">>  $2
-echo "#define __INCLUDE_GUARD_CCS_H">>  $2
-echo>>  $2
-echo "const char css[] = ">>  $2
+echo "#ifndef __INCLUDE_GUARD_CCS_H" >> $2
+echo "#define __INCLUDE_GUARD_CCS_H" >> $2
+echo >> $2
+echo "const char css[] = " >> $2
 
-sed -r 's/^(.*)$/\t\"\1\\n\"/' $1>>  $2
+sed -r 's/^(.*)$/\t\"\1\\n\"/' $1 >> $2
 
-echo ";">>  $2
-echo "#endif">>  $2
+echo ";" >> $2
+echo "#endif" >> $2
Signature · 1 line
1.8.1
#9 lore raw

Re: [Powertop] [PATCH] csstoh shell-script for cross-compiling

Quoted 57 lines · Thomas Waldecker

Updated the shellscript with changes made by Igor posted in mailing list
https://lists.01.org/pipermail/powertop/2012-July/000165.html

Signed-off-by Thomas Waldecker <thomas.waldecker(a)gmail.com>
---
  src/Makefile.am |  3 +--
  src/csstoh.sh   | 21 ++++++++++-----------
  2 files changed, 11 insertions(+), 13 deletions(-)
src/Makefile.am +1 -2
index a53d942..398b8a7 100644
@@ -46,6 +46,5 @@ AM_LDFLAGS = $(LIBS) $(NCURSES_LIBS) $(PCIUTILS_LIBS) $(LIBNL_LIBS) $(LIBZ_LIBS)
  BUILT_SOURCES = css.h
  CLEANFILES = css.h
  css.h: powertop.css
-	chmod +x ./csstoh.sh
-	./csstoh.sh "$(srcdir)"/powertop.css css.h
+	$(SHELL) ./csstoh.sh powertop.css css.h
 
src/csstoh.sh +5 -8
index 5918d12..9d4100b 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
  #
  # This program file is free software; you can redistribute it and/or modify it
  # under the terms of the GNU General Public License as published by the
@@ -16,8 +16,7 @@
  # Boston, MA 02110-1301 USA
  # or just google for it.
  #
-# Written by Igor Zhbanov<i.zhbanov at samsung.com>
-
+# Written by Igor Zhbanov <i.zhbanov at samsung.com>
 
  if [ $# -lt 2 ]; then
  	echo "Usage: csstoh.sh cssfile header.h"
@@ -29,17 +28,17 @@ if [ ! -r $1 ]; then
  	exit 1
  fi
 
-if ! echo -n>$2; then
+if ! echo -n >$2; then
  	echo "Can't open file $2 for writing."
  	exit 1
  fi
 
-echo "#ifndef __INCLUDE_GUARD_CCS_H">>  $2
-echo "#define __INCLUDE_GUARD_CCS_H">>  $2
-echo>>  $2
-echo "const char css[] = ">>  $2
+echo "#ifndef __INCLUDE_GUARD_CCS_H" >> $2
+echo "#define __INCLUDE_GUARD_CCS_H" >> $2

src/csstoh.sh if [ ! -r $1 ]; then · line 44

Quoted 10 lines
src/csstoh.sh +5 -3
+echo >> $2
+echo "const char css[] = " >> $2
 
-sed -r 's/^(.*)$/\t\"\1\\n\"/' $1>>  $2
+sed -r 's/^(.*)$/\t\"\1\\n\"/' $1 >> $2
 
-echo ";">>  $2
-echo "#endif">>  $2
+echo ";" >> $2
+echo "#endif" >> $2

The space characters issue was because of bad mail-client. The spaces were always there. :-)
Last patch was sent by git, so it was transmitted exactly.

Also it the last version of the patch /bin/bash was changed to /bin/sh for better portability. So the (this) last version is better. :-) I use it for cross-compilation. My own version is the same except of my e-mail. I have "@" instead of "at" in it. The "at" word was created by bad mail client. But this is not important. :-)

Signature · 9 lines
Best regards,
Igor Zhbanov,
Sub-Project Leader,
phone: +7 (495) 797 25 00 ext 3981
e-mail: i.zhbanov(a)samsung.com

Mobile group, Moscow R&D center, Samsung Electronics
12 Dvintsev street, building 1
127018, Moscow, Russian Federation
#10 lore raw

Re: [Powertop] [PATCH] csstoh shell-script for cross-compiling

Quoted 72 lines · On Tue, 05 Feb 2013 13:50:34 +0400 Igor Zhbanov <i.zhbanov(a)samsung.com> wrote:
Quoted 57 lines · Thomas Waldecker

Updated the shellscript with changes made by Igor posted in mailing list
https://lists.01.org/pipermail/powertop/2012-July/000165.html

Signed-off-by Thomas Waldecker <thomas.waldecker(a)gmail.com>
---
  src/Makefile.am |  3 +--
  src/csstoh.sh   | 21 ++++++++++-----------
  2 files changed, 11 insertions(+), 13 deletions(-)
src/Makefile.am +1 -2
index a53d942..398b8a7 100644
@@ -46,6 +46,5 @@ AM_LDFLAGS = $(LIBS) $(NCURSES_LIBS) $(PCIUTILS_LIBS) $(LIBNL_LIBS) $(LIBZ_LIBS)
  BUILT_SOURCES = css.h
  CLEANFILES = css.h
  css.h: powertop.css
-	chmod +x ./csstoh.sh
-	./csstoh.sh "$(srcdir)"/powertop.css css.h
+	$(SHELL) ./csstoh.sh powertop.css css.h
 
src/csstoh.sh +5 -8
index 5918d12..9d4100b 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
  #
  # This program file is free software; you can redistribute it and/or modify it
  # under the terms of the GNU General Public License as published by the
@@ -16,8 +16,7 @@
  # Boston, MA 02110-1301 USA
  # or just google for it.
  #
-# Written by Igor Zhbanov<i.zhbanov at samsung.com>
-
+# Written by Igor Zhbanov <i.zhbanov at samsung.com>
 
  if [ $# -lt 2 ]; then
  	echo "Usage: csstoh.sh cssfile header.h"
@@ -29,17 +28,17 @@ if [ ! -r $1 ]; then
  	exit 1
  fi
 
-if ! echo -n>$2; then
+if ! echo -n >$2; then
  	echo "Can't open file $2 for writing."
  	exit 1
  fi
 
-echo "#ifndef __INCLUDE_GUARD_CCS_H">>  $2
-echo "#define __INCLUDE_GUARD_CCS_H">>  $2
-echo>>  $2
-echo "const char css[] = ">>  $2
+echo "#ifndef __INCLUDE_GUARD_CCS_H" >> $2
+echo "#define __INCLUDE_GUARD_CCS_H" >> $2

src/csstoh.sh if [ ! -r $1 ]; then · line 44

Quoted 10 lines
src/csstoh.sh +5 -3
+echo >> $2
+echo "const char css[] = " >> $2
 
-sed -r 's/^(.*)$/\t\"\1\\n\"/' $1>>  $2
+sed -r 's/^(.*)$/\t\"\1\\n\"/' $1 >> $2
 
-echo ";">>  $2
-echo "#endif">>  $2
+echo ";" >> $2
+echo "#endif" >> $2

The space characters issue was because of bad mail-client. The spaces were always there. :-)
Last patch was sent by git, so it was transmitted exactly.

Quoted 6 lines

Also it the last version of the patch /bin/bash was changed to /bin/sh for better portability. So the (this) last version is better. :-) I use it for cross-compilation. My own version is the same except of my e-mail. I have "@" instead of "at" in it. The "at" word was created by bad mail client. But this is not important. :-)

So would you like us to go ahead and apply this patch?

#11 lore raw

Re: [Powertop] [PATCH] csstoh shell-script for cross-compiling

Quoted 75 lines · Kristen Carlson Accardi
Quoted 72 lines · On Tue, 05 Feb 2013 13:50:34 +0400 Igor Zhbanov <i.zhbanov(a)samsung.com> wrote:
Quoted 57 lines · Thomas Waldecker

Updated the shellscript with changes made by Igor posted in mailing list
https://lists.01.org/pipermail/powertop/2012-July/000165.html

Signed-off-by Thomas Waldecker <thomas.waldecker(a)gmail.com>
---
   src/Makefile.am |  3 +--
   src/csstoh.sh   | 21 ++++++++++-----------
   2 files changed, 11 insertions(+), 13 deletions(-)
src/Makefile.am +1 -2
index a53d942..398b8a7 100644
@@ -46,6 +46,5 @@ AM_LDFLAGS = $(LIBS) $(NCURSES_LIBS) $(PCIUTILS_LIBS) $(LIBNL_LIBS) $(LIBZ_LIBS)
   BUILT_SOURCES = css.h
   CLEANFILES = css.h
   css.h: powertop.css
-	chmod +x ./csstoh.sh
-	./csstoh.sh "$(srcdir)"/powertop.css css.h
+	$(SHELL) ./csstoh.sh powertop.css css.h
 
src/csstoh.sh +5 -8
index 5918d12..9d4100b 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
   #
   # This program file is free software; you can redistribute it and/or modify it
   # under the terms of the GNU General Public License as published by the
@@ -16,8 +16,7 @@
   # Boston, MA 02110-1301 USA
   # or just google for it.
   #
-# Written by Igor Zhbanov<i.zhbanov at samsung.com>
-
+# Written by Igor Zhbanov <i.zhbanov at samsung.com>
 
   if [ $# -lt 2 ]; then
   	echo "Usage: csstoh.sh cssfile header.h"
@@ -29,17 +28,17 @@ if [ ! -r $1 ]; then
   	exit 1
   fi
 
-if ! echo -n>$2; then
+if ! echo -n >$2; then
   	echo "Can't open file $2 for writing."
   	exit 1
   fi
 
-echo "#ifndef __INCLUDE_GUARD_CCS_H">>  $2
-echo "#define __INCLUDE_GUARD_CCS_H">>  $2
-echo>>  $2
-echo "const char css[] = ">>  $2
+echo "#ifndef __INCLUDE_GUARD_CCS_H" >> $2
+echo "#define __INCLUDE_GUARD_CCS_H" >> $2

src/csstoh.sh if [ ! -r $1 ]; then · line 44

Quoted 10 lines
src/csstoh.sh +5 -3
+echo >> $2
+echo "const char css[] = " >> $2
 
-sed -r 's/^(.*)$/\t\"\1\\n\"/' $1>>  $2
+sed -r 's/^(.*)$/\t\"\1\\n\"/' $1 >> $2
 
-echo ";">>  $2
-echo "#endif">>  $2
+echo ";" >> $2
+echo "#endif" >> $2

The space characters issue was because of bad mail-client. The spaces were always there. :-)
Last patch was sent by git, so it was transmitted exactly.

Quoted 8 lines
Quoted 6 lines

Also it the last version of the patch /bin/bash was changed to /bin/sh for better portability. So the (this) last version is better. :-) I use it for cross-compilation. My own version is the same except of my e-mail. I have "@" instead of "at" in it. The "at" word was created by bad mail client. But this is not important. :-)

So would you like us to go ahead and apply this patch?

Yes. :-) With correct white-space characters, /bin/bash -> /bin/sh and added $(SHELL) to Makefile, this patch would be better than first version.

Signature · 9 lines
Best regards,
Igor Zhbanov,
Sub-Project Leader,
phone: +7 (495) 797 25 00 ext 3981
e-mail: i.zhbanov(a)samsung.com

Mobile group, Moscow R&D center, Samsung Electronics
12 Dvintsev street, building 1
127018, Moscow, Russian Federation