Patchwork [1/5] file: avoid to handle special character

login
register
mail settings
Submitter Yue Tao
Date Nov. 27, 2013, 7:55 a.m.
Message ID <1385538944-8585-1-git-send-email-Yue.Tao@windriver.com>
Download mbox | patch
Permalink /patch/62451/
State New
Headers show

Comments

Yue Tao - Nov. 27, 2013, 7:55 a.m.
From: Li Wang <li.wang@windriver.com>

avoid to handle special character '@' in filename and directory.

Signed-off-by: Li Wang <li.wang@windriver.com>
---
 .../file/file/avoid_handle_special_character.patch |   36 ++++++++++++++++++++
 meta/recipes-devtools/file/file_5.15.bb            |    1 +
 2 files changed, 37 insertions(+), 0 deletions(-)
 create mode 100644 meta/recipes-devtools/file/file/avoid_handle_special_character.patch
Richard Purdie - Nov. 27, 2013, 12:02 p.m.
On Wed, 2013-11-27 at 15:55 +0800, Yue Tao wrote:
> From: Li Wang <li.wang@windriver.com>
> 
> avoid to handle special character '@' in filename and directory.
> 
> Signed-off-by: Li Wang <li.wang@windriver.com>
> ---
>  .../file/file/avoid_handle_special_character.patch |   36 ++++++++++++++++++++
>  meta/recipes-devtools/file/file_5.15.bb            |    1 +
>  2 files changed, 37 insertions(+), 0 deletions(-)
>  create mode 100644 meta/recipes-devtools/file/file/avoid_handle_special_character.patch

No patch header and do we support "@" in directory names for builds?
Doesn't this break '#' instead?

Cheers,

Richard

> diff --git a/meta/recipes-devtools/file/file/avoid_handle_special_character.patch b/meta/recipes-devtools/file/file/avoid_handle_special_character.patch
> new file mode 100644
> index 0000000..4be4ad0
> --- /dev/null
> +++ b/meta/recipes-devtools/file/file/avoid_handle_special_character.patch
> @@ -0,0 +1,36 @@
> +--- a/doc/Makefile.am
> ++++ b/doc/Makefile.am
> +@@ -12,21 +12,21 @@
> + 
> + file.1:	Makefile file.man
> + 	@rm -f $@
> +-	sed -e s@__CSECTION__@1@g \
> +-	    -e s@__FSECTION__@${fsect}@g \
> +-	    -e s@__VERSION__@${VERSION}@g \
> +-	    -e s@__MAGIC__@${MAGIC}@g $(srcdir)/file.man > $@
> ++	sed -e s#__CSECTION__#1#g \
> ++	    -e s#__FSECTION__#${fsect}#g \
> ++	    -e s#__VERSION__#${VERSION}#g \
> ++	    -e s#__MAGIC__#${MAGIC}#g $(srcdir)/file.man > $@
> + 
> + magic.${fsect}: Makefile magic.man
> + 	@rm -f $@
> +-	sed -e s@__CSECTION__@1@g \
> +-	    -e s@__FSECTION__@${fsect}@g \
> +-	    -e s@__VERSION__@${VERSION}@g \
> +-	    -e s@__MAGIC__@${MAGIC}@g $(srcdir)/magic.man > $@
> ++	sed -e s#__CSECTION__#1#g \
> ++	    -e s#__FSECTION__#${fsect}#g \
> ++	    -e s#__VERSION__#${VERSION}#g \
> ++	    -e s#__MAGIC__#${MAGIC}#g $(srcdir)/magic.man > $@
> + 
> + libmagic.3: Makefile libmagic.man
> + 	@rm -f $@
> +-	sed -e s@__CSECTION__@1@g \
> +-	    -e s@__FSECTION__@${fsect}@g \
> +-	    -e s@__VERSION__@${VERSION}@g \
> +-	    -e s@__MAGIC__@${MAGIC}@g $(srcdir)/libmagic.man > $@
> ++	sed -e s#__CSECTION__#1#g \
> ++	    -e s#__FSECTION__#${fsect}#g \
> ++	    -e s#__VERSION__#${VERSION}#g \
> ++	    -e s#__MAGIC__#${MAGIC}#g $(srcdir)/libmagic.man > $@
> diff --git a/meta/recipes-devtools/file/file_5.15.bb b/meta/recipes-devtools/file/file_5.15.bb
> index aecbbe5..0697838 100644
> --- a/meta/recipes-devtools/file/file_5.15.bb
> +++ b/meta/recipes-devtools/file/file_5.15.bb
> @@ -12,6 +12,7 @@ DEPENDS = "zlib file-native"
>  DEPENDS_class-native = "zlib-native"
>  
>  SRC_URI = "ftp://ftp.astron.com/pub/file/file-${PV}.tar.gz \
> +           file://avoid_handle_special_character.patch \
>             file://dump \
>             file://filesystems"
>
Ross Burton - Nov. 27, 2013, 12:40 p.m.
On 27 November 2013 07:55, Yue Tao <Yue.Tao@windriver.com> wrote:
> avoid to handle special character '@' in filename and directory.

Please explain the problem more accurately.  From looking I presume
the situation here is that the sed breaks when building file-native
and the build directory contains @, as ${MAGIC} is $pkgdatadir/magic.

Clearly we need a well-defined character that isn't supported in build
paths, but I'm also not convinced that # is it.

Ross

Patch

diff --git a/meta/recipes-devtools/file/file/avoid_handle_special_character.patch b/meta/recipes-devtools/file/file/avoid_handle_special_character.patch
new file mode 100644
index 0000000..4be4ad0
--- /dev/null
+++ b/meta/recipes-devtools/file/file/avoid_handle_special_character.patch
@@ -0,0 +1,36 @@ 
+--- a/doc/Makefile.am
++++ b/doc/Makefile.am
+@@ -12,21 +12,21 @@
+ 
+ file.1:	Makefile file.man
+ 	@rm -f $@
+-	sed -e s@__CSECTION__@1@g \
+-	    -e s@__FSECTION__@${fsect}@g \
+-	    -e s@__VERSION__@${VERSION}@g \
+-	    -e s@__MAGIC__@${MAGIC}@g $(srcdir)/file.man > $@
++	sed -e s#__CSECTION__#1#g \
++	    -e s#__FSECTION__#${fsect}#g \
++	    -e s#__VERSION__#${VERSION}#g \
++	    -e s#__MAGIC__#${MAGIC}#g $(srcdir)/file.man > $@
+ 
+ magic.${fsect}: Makefile magic.man
+ 	@rm -f $@
+-	sed -e s@__CSECTION__@1@g \
+-	    -e s@__FSECTION__@${fsect}@g \
+-	    -e s@__VERSION__@${VERSION}@g \
+-	    -e s@__MAGIC__@${MAGIC}@g $(srcdir)/magic.man > $@
++	sed -e s#__CSECTION__#1#g \
++	    -e s#__FSECTION__#${fsect}#g \
++	    -e s#__VERSION__#${VERSION}#g \
++	    -e s#__MAGIC__#${MAGIC}#g $(srcdir)/magic.man > $@
+ 
+ libmagic.3: Makefile libmagic.man
+ 	@rm -f $@
+-	sed -e s@__CSECTION__@1@g \
+-	    -e s@__FSECTION__@${fsect}@g \
+-	    -e s@__VERSION__@${VERSION}@g \
+-	    -e s@__MAGIC__@${MAGIC}@g $(srcdir)/libmagic.man > $@
++	sed -e s#__CSECTION__#1#g \
++	    -e s#__FSECTION__#${fsect}#g \
++	    -e s#__VERSION__#${VERSION}#g \
++	    -e s#__MAGIC__#${MAGIC}#g $(srcdir)/libmagic.man > $@
diff --git a/meta/recipes-devtools/file/file_5.15.bb b/meta/recipes-devtools/file/file_5.15.bb
index aecbbe5..0697838 100644
--- a/meta/recipes-devtools/file/file_5.15.bb
+++ b/meta/recipes-devtools/file/file_5.15.bb
@@ -12,6 +12,7 @@  DEPENDS = "zlib file-native"
 DEPENDS_class-native = "zlib-native"
 
 SRC_URI = "ftp://ftp.astron.com/pub/file/file-${PV}.tar.gz \
+           file://avoid_handle_special_character.patch \
            file://dump \
            file://filesystems"