Skip to contentSkip to conversation

tcpdump: fix mix of tabs and spaces in do_configure()

PATCH In review Michael Smith 5 participants 10 messages May 28, 2009 – Jun 7, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 tcpdump: fix mix of tabs and spaces in do_configure()

I randomly picked tabs.

---
 recipes/tcpdump/tcpdump_3.9.7.bb |    4 ++--
 recipes/tcpdump/tcpdump_4.0.0.bb |    6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)
recipes/tcpdump/tcpdump_3.9.7.bb +2 -2
index ba9710d..962663f 100644
@@ -15,6 +15,6 @@ EXTRA_OECONF = "--without-crypto"
 do_configure() {
 	gnu-configize
 	oe_runconf
-        sed -i 's:/usr/lib:${STAGING_LIBDIR}:' ./Makefile
-        sed -i 's:/usr/include:${STAGING_INCDIR}:' ./Makefile
+	sed -i 's:/usr/lib:${STAGING_LIBDIR}:' ./Makefile
+	sed -i 's:/usr/include:${STAGING_INCDIR}:' ./Makefile
 }
recipes/tcpdump/tcpdump_4.0.0.bb +3 -3
index 537cb36..c807fb1 100644
@@ -18,8 +18,8 @@ EXTRA_OECONF = "--without-crypto"
 
 do_configure() {
 	gnu-configize
-    autoconf
+	autoconf
 	oe_runconf
-        sed -i 's:/usr/lib:${STAGING_LIBDIR}:' ./Makefile
-        sed -i 's:/usr/include:${STAGING_INCDIR}:' ./Makefile
+	sed -i 's:/usr/lib:${STAGING_LIBDIR}:' ./Makefile
+	sed -i 's:/usr/include:${STAGING_INCDIR}:' ./Makefile
 }
Signature · 1 line
1.5.6.5
#1 lore raw

PATCH 2/2 tcpdump 4.0.0-r2: remove extra ${sbindir}/tcpdump.4.0.0

---
 recipes/tcpdump/tcpdump_4.0.0.bb |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
recipes/tcpdump/tcpdump_4.0.0.bb +6 -1
index c807fb1..a9e8a0d 100644
@@ -4,7 +4,7 @@ LICENSE = "BSD"
 SECTION = "console/network"
 PRIORITY = "optional"
 DEPENDS = "libpcap"
-PR = "r1"
+PR = "r2"
 
 SRC_URI = "http://www.tcpdump.org/release/tcpdump-${PV}.tar.gz \
            file://tcpdump_configure_no_-O2.patch;patch=1 \
@@ -23,3 +23,8 @@ do_configure() {
 	sed -i 's:/usr/lib:${STAGING_LIBDIR}:' ./Makefile
 	sed -i 's:/usr/include:${STAGING_INCDIR}:' ./Makefile
 }
+
+do_install_append() {
+	# tcpdump 4.0.0 installs a copy to /usr/sbin/tcpdump.4.0.0
+	rm -f ${D}${sbindir}/tcpdump.${PV}
+}
Signature · 1 line
1.5.6.5
#2 lore raw
In reply to Michael Smith
Quoted 3 lines · Michael Smith

I randomly picked tabs.

I'm not sure this kind of cleanup requires patch review...

Quoted 42 lines
---
 recipes/tcpdump/tcpdump_3.9.7.bb |    4 ++--
 recipes/tcpdump/tcpdump_4.0.0.bb |    6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)
recipes/tcpdump/tcpdump_3.9.7.bb +2 -2
index ba9710d..962663f 100644
@@ -15,6 +15,6 @@ EXTRA_OECONF = "--without-crypto"
 do_configure() {
 	gnu-configize
 	oe_runconf
-        sed -i 's:/usr/lib:${STAGING_LIBDIR}:' ./Makefile
-        sed -i 's:/usr/include:${STAGING_INCDIR}:' ./Makefile
+	sed -i 's:/usr/lib:${STAGING_LIBDIR}:' ./Makefile
+	sed -i 's:/usr/include:${STAGING_INCDIR}:' ./Makefile
 }
recipes/tcpdump/tcpdump_4.0.0.bb +3 -3
index 537cb36..c807fb1 100644
@@ -18,8 +18,8 @@ EXTRA_OECONF = "--without-crypto"
 
 do_configure() {
 	gnu-configize
-    autoconf
+	autoconf
 	oe_runconf
-        sed -i 's:/usr/lib:${STAGING_LIBDIR}:' ./Makefile
-        sed -i 's:/usr/include:${STAGING_INCDIR}:' ./Makefile
+	sed -i 's:/usr/lib:${STAGING_LIBDIR}:' ./Makefile
+	sed -i 's:/usr/include:${STAGING_INCDIR}:' ./Makefile
 }
Signature · 7 lines
1.5.6.5


_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
#3 lore raw
Quoted 6 lines · Denys Dmytriyenko
Quoted 3 lines · Michael Smith

I randomly picked tabs.

I'm not sure this kind of cleanup requires patch review...

It doesn't look like Michael has commit access. I did try applying it, and git-am said there was a mix of tabs and spaces.

Do we prefer tabs or spaces in bb files?

Philip

Quoted 49 lines
Quoted 43 lines
---
 recipes/tcpdump/tcpdump_3.9.7.bb |    4 ++--
 recipes/tcpdump/tcpdump_4.0.0.bb |    6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)
recipes/tcpdump/tcpdump_3.9.7.bb +2 -2
index ba9710d..962663f 100644
@@ -15,6 +15,6 @@ EXTRA_OECONF = "--without-crypto"
 do_configure() {
 	gnu-configize
 	oe_runconf
-        sed -i 's:/usr/lib:${STAGING_LIBDIR}:' ./Makefile
-        sed -i 's:/usr/include:${STAGING_INCDIR}:' ./Makefile
+	sed -i 's:/usr/lib:${STAGING_LIBDIR}:' ./Makefile
+	sed -i 's:/usr/include:${STAGING_INCDIR}:' ./Makefile
 }
recipes/tcpdump/tcpdump_4.0.0.bb +3 -3
index 537cb36..c807fb1 100644
@@ -18,8 +18,8 @@ EXTRA_OECONF = "--without-crypto"
 
 do_configure() {
 	gnu-configize
-    autoconf
+	autoconf
 	oe_runconf
-        sed -i 's:/usr/lib:${STAGING_LIBDIR}:' ./Makefile
-        sed -i 's:/usr/include:${STAGING_INCDIR}:' ./Makefile
+	sed -i 's:/usr/lib:${STAGING_LIBDIR}:' ./Makefile
+	sed -i 's:/usr/include:${STAGING_INCDIR}:' ./Makefile
 }
Signature · 7 lines
1.5.6.5


_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

#4 lore raw
Quoted 1 line · Philip Balister

It doesn't look like Michael has commit access. I did try applying it, and git-am said there was a mix of tabs and spaces.

Yes, the SRC_URI lines were lined up with spaces. It looked nice enough that I didn't fix it; but there was a line in the do_configure() script that was actually 4 spaces off from the rest, and the OCD in me couldn't take it. :)

Path of least resistance seems to be tabs, if that's the default for most editors. The Wiki just says to avoid mixing them in the same file.

Mike

#5 lore raw
Quoted 6 lines · Michael Smith <msmith <at> cbnco.com> writes:
Quoted 2 lines · Philip Balister

It doesn't look like Michael has commit access. I did try applying it, and git-am said there was a mix of tabs and spaces.

Yes, the SRC_URI lines were lined up with spaces. It looked nice enough that I didn't fix it;

Hi Philip,

How can I get git am to warn about the mixing? I tried git am --whitespace=error-all on the mbox file from patchwork, but it doesn't seem to find a mix; actually, in the patch files there are no added lines with spaces, only removed lines and a context line.

Mike

#6 lore raw
Quoted 9 lines · Michael Smith
Quoted 6 lines · Michael Smith<msmith<at> cbnco.com> writes:
Quoted 2 lines · Philip Balister

It doesn't look like Michael has commit access. I did try applying it, and git-am said there was a mix of tabs and spaces.

Yes, the SRC_URI lines were lined up with spaces. It looked nice enough that I didn't fix it;

Quoted 6 lines

Hi Philip,

How can I get git am to warn about the mixing? I tried git am --whitespace=error-all on the mbox file from patchwork, but it doesn't seem to find a mix; actually, in the patch files there are no added lines with spaces, only removed lines and a context line.

Ignore git-am "errors" about whitespace. If I add a patch to a recipe and do git format-patch in that commit (so you get a patch in a patch) git-am will scream bloody murder for something that has no actual whitespace errors. I suspect that the only time you can trust git output is when your name is Linus and work on kernel code.

regards,

Koen

#7 lore raw

Hello Koen,

Quoted 5 lines · Koen Kooi

Ignore git-am "errors" about whitespace. If I add a patch to a recipe and do git format-patch in that commit (so you get a patch in a patch) git-am will scream bloody murder for something that has no actual whitespace errors. I suspect that the only time you can trust git output is when your name is Linus and work on kernel code.

Well, not 100% true.

Basically when you're adding patch files this is really possible to have warnings that cannot be solved, mostly because the patch itself also has context of the code on it. However, in case those warnings come from your bb files, classes, conf, ini or whatever, it would be nice to be checked and fixed before pushing it.

Signature · 3 lines
Otavio Salvador                  O.S. Systems
E-mail: [email protected]  http://www.ossystems.com.br
Mobile: +55 53 9981-7854         http://projetos.ossystems.com.br
#8 lore raw

PATCH 1/1 tcpdump: fix mix of tabs and spaces

In reply to Philip Balister

---

Resend. Got rid of all space indents in the file, so this time hopefully git am won't complain :)

 recipes/tcpdump/tcpdump_3.9.7.bb |   10 ++++++----
 recipes/tcpdump/tcpdump_4.0.0.bb |   16 +++++++++-------
 2 files changed, 15 insertions(+), 11 deletions(-)
recipes/tcpdump/tcpdump_3.9.7.bb +6 -4
index ba9710d..163d74f 100644
@@ -5,8 +5,10 @@ SECTION = "console/network"
 PRIORITY = "optional"
 DEPENDS = "libpcap"
 
-SRC_URI = "http://www.tcpdump.org/release/tcpdump-${PV}.tar.gz \
-           file://tcpdump_configure_no_-O2.patch;patch=1"
+SRC_URI = " \
+	http://www.tcpdump.org/release/tcpdump-${PV}.tar.gz \
+	file://tcpdump_configure_no_-O2.patch;patch=1 \
+"
 
 inherit autotools
 
@@ -15,6 +17,6 @@ EXTRA_OECONF = "--without-crypto"
 do_configure() {
 	gnu-configize
 	oe_runconf
-        sed -i 's:/usr/lib:${STAGING_LIBDIR}:' ./Makefile
-        sed -i 's:/usr/include:${STAGING_INCDIR}:' ./Makefile
+	sed -i 's:/usr/lib:${STAGING_LIBDIR}:' ./Makefile
+	sed -i 's:/usr/include:${STAGING_INCDIR}:' ./Makefile
 }
recipes/tcpdump/tcpdump_4.0.0.bb +9 -7
index 537cb36..7f99220 100644
@@ -6,10 +6,12 @@ PRIORITY = "optional"
 DEPENDS = "libpcap"
 PR = "r1"
 
-SRC_URI = "http://www.tcpdump.org/release/tcpdump-${PV}.tar.gz \
-           file://tcpdump_configure_no_-O2.patch;patch=1 \
-           file://no-ipv6-tcpdump4.patch;patch=1 \
-           file://0001-minimal-IEEE802.15.4-allowed.patch;patch=1"
+SRC_URI = " \
+	http://www.tcpdump.org/release/tcpdump-${PV}.tar.gz \
+	file://tcpdump_configure_no_-O2.patch;patch=1 \
+	file://no-ipv6-tcpdump4.patch;patch=1 \
+	file://0001-minimal-IEEE802.15.4-allowed.patch;patch=1 \
+"
 
 inherit autotools
 # ac_cv_linux_vers=${ac_cv_linux_vers=2}
@@ -18,8 +20,8 @@ EXTRA_OECONF = "--without-crypto"
 
 do_configure() {
 	gnu-configize
-    autoconf
+	autoconf
 	oe_runconf
-        sed -i 's:/usr/lib:${STAGING_LIBDIR}:' ./Makefile
-        sed -i 's:/usr/include:${STAGING_INCDIR}:' ./Makefile
+	sed -i 's:/usr/lib:${STAGING_LIBDIR}:' ./Makefile
+	sed -i 's:/usr/include:${STAGING_INCDIR}:' ./Makefile
 }
Signature · 1 line
1.6.3
#9 lore raw

PATCH 1/1 tcpdump 4.0.0-r2: remove extra ${sbindir}/tcpdump.4.0.0

---
 recipes/tcpdump/tcpdump_4.0.0.bb |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
recipes/tcpdump/tcpdump_4.0.0.bb +6 -1
index 7f99220..f36cc0a 100644
@@ -4,7 +4,7 @@ LICENSE = "BSD"
 SECTION = "console/network"
 PRIORITY = "optional"
 DEPENDS = "libpcap"
-PR = "r1"
+PR = "r2"
 
 SRC_URI = " \
 	http://www.tcpdump.org/release/tcpdump-${PV}.tar.gz \
@@ -25,3 +25,8 @@ do_configure() {
 	sed -i 's:/usr/lib:${STAGING_LIBDIR}:' ./Makefile
 	sed -i 's:/usr/include:${STAGING_INCDIR}:' ./Makefile
 }
+
+do_install_append() {
+	# tcpdump 4.0.0 installs a copy to /usr/sbin/tcpdump.4.0.0
+	rm -f ${D}${sbindir}/tcpdump.${PV}
+}
Signature · 1 line
1.6.3