Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] package_rpm.bbclass : escape "%" in files and directories name
@ 2013-10-29 16:09 Sébastien Mennetrier
  2013-10-29 16:16 ` Paul Eggleton
  0 siblings, 1 reply; 4+ messages in thread
From: Sébastien Mennetrier @ 2013-10-29 16:09 UTC (permalink / raw)
  To: openembedded-core

Fixes [YOCTO #5397]

The rpm process replace all the "%name" in the spec file by the name of
the package. So, if the package is composed of some files or directories
named "%name...", the rpm package process failed.

Replace all "%" present in files or directories names by "[%]"

Signed-off-by: Sébastien Mennetrier <s.mennetrier@innotis.org>
---
 meta/classes/package_rpm.bbclass | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 36bad09..6c73e37 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -662,10 +662,13 @@ python write_specfile () {
     def walk_files(walkpath, target, conffiles):
         for rootpath, dirs, files in os.walk(walkpath):
             path = rootpath.replace(walkpath, "")
+            path = path.replace("%", "[%]")
             for dir in dirs:
+                dir = dir.replace("%", "[%]")
                 # All packages own the directories their files are in...
                 target.append('%dir "' + path + '/' + dir + '"')
             for file in files:
+                file = file.replace("%", "[%]")
                 if conffiles.count(path + '/' + file):
                     target.append('%config "' + path + '/' + file + '"')
                 else:
-- 
1.8.1.2



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

* Re: [PATCH] package_rpm.bbclass : escape "%" in files and directories name
  2013-10-29 16:09 [PATCH] package_rpm.bbclass : escape "%" in files and directories name Sébastien Mennetrier
@ 2013-10-29 16:16 ` Paul Eggleton
  2013-10-29 16:37   ` Sebastien MENNETRIER
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Eggleton @ 2013-10-29 16:16 UTC (permalink / raw)
  To: Sébastien Mennetrier; +Cc: openembedded-core

Hi Sébastien,

On Tuesday 29 October 2013 17:09:09 Sébastien Mennetrier wrote:
> Fixes [YOCTO #5397]
> 
> The rpm process replace all the "%name" in the spec file by the name of
> the package. So, if the package is composed of some files or directories
> named "%name...", the rpm package process failed.
> 
> Replace all "%" present in files or directories names by "[%]"
> 
> Signed-off-by: Sébastien Mennetrier <s.mennetrier@innotis.org>
> ---
>  meta/classes/package_rpm.bbclass | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/meta/classes/package_rpm.bbclass
> b/meta/classes/package_rpm.bbclass index 36bad09..6c73e37 100644
> --- a/meta/classes/package_rpm.bbclass
> +++ b/meta/classes/package_rpm.bbclass
> @@ -662,10 +662,13 @@ python write_specfile () {
>      def walk_files(walkpath, target, conffiles):
>          for rootpath, dirs, files in os.walk(walkpath):
>              path = rootpath.replace(walkpath, "")
> +            path = path.replace("%", "[%]")
>              for dir in dirs:
> +                dir = dir.replace("%", "[%]")
>                  # All packages own the directories their files are in...
>                  target.append('%dir "' + path + '/' + dir + '"')
>              for file in files:
> +                file = file.replace("%", "[%]")
>                  if conffiles.count(path + '/' + file):
>                      target.append('%config "' + path + '/' + file + '"')
>                  else:

Are you sure this is correct? The documentation I have been able to dig up via 
google seems to suggest that %% is the correct way to escape a % sign in a 
spec file.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre


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

* Re: [PATCH] package_rpm.bbclass : escape "%" in files and directories name
  2013-10-29 16:16 ` Paul Eggleton
@ 2013-10-29 16:37   ` Sebastien MENNETRIER
  0 siblings, 0 replies; 4+ messages in thread
From: Sebastien MENNETRIER @ 2013-10-29 16:37 UTC (permalink / raw)
  To: Paul Eggleton; +Cc: openembedded-core

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

I'm not a specialist with rpm but I saw this documentation and I tried with
"%%" and with "\%" and it did not work.

I don't know if it's the best way but it work for me ;)

Regards,
Seb



2013/10/29 Paul Eggleton <paul.eggleton@linux.intel.com>

> Hi Sébastien,
>
> On Tuesday 29 October 2013 17:09:09 Sébastien Mennetrier wrote:
> > Fixes [YOCTO #5397]
> >
> > The rpm process replace all the "%name" in the spec file by the name of
> > the package. So, if the package is composed of some files or directories
> > named "%name...", the rpm package process failed.
> >
> > Replace all "%" present in files or directories names by "[%]"
> >
> > Signed-off-by: Sébastien Mennetrier <s.mennetrier@innotis.org>
> > ---
> >  meta/classes/package_rpm.bbclass | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/meta/classes/package_rpm.bbclass
> > b/meta/classes/package_rpm.bbclass index 36bad09..6c73e37 100644
> > --- a/meta/classes/package_rpm.bbclass
> > +++ b/meta/classes/package_rpm.bbclass
> > @@ -662,10 +662,13 @@ python write_specfile () {
> >      def walk_files(walkpath, target, conffiles):
> >          for rootpath, dirs, files in os.walk(walkpath):
> >              path = rootpath.replace(walkpath, "")
> > +            path = path.replace("%", "[%]")
> >              for dir in dirs:
> > +                dir = dir.replace("%", "[%]")
> >                  # All packages own the directories their files are in...
> >                  target.append('%dir "' + path + '/' + dir + '"')
> >              for file in files:
> > +                file = file.replace("%", "[%]")
> >                  if conffiles.count(path + '/' + file):
> >                      target.append('%config "' + path + '/' + file + '"')
> >                  else:
>
> Are you sure this is correct? The documentation I have been able to dig up
> via
> google seems to suggest that %% is the correct way to escape a % sign in a
> spec file.
>
> Cheers,
> Paul
>
> --
>
> Paul Eggleton
> Intel Open Source Technology Centre
>

[-- Attachment #2: Type: text/html, Size: 2996 bytes --]

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

* [PATCH] package_rpm.bbclass : escape "%" in files and directories name
@ 2015-05-20 14:48 Michaël Burtin
  0 siblings, 0 replies; 4+ messages in thread
From: Michaël Burtin @ 2015-05-20 14:48 UTC (permalink / raw)
  To: openembedded-core; +Cc: Sébastien Mennetrier, Michaël Burtin

From: Sébastien Mennetrier <smennetrier@voxtok.com>

The rpm process replace all the "%name" in the spec file by the name of
the package. So, if the package is composed of some files or directories
named "%name...", the rpm package process failed.

Replace all "%" present in files or directories names by "%%%%%%%%" to
correctly escape "%".

Signed-off-by: Sébastien Mennetrier <smennetrier@voxtok.com>
Signed-off-by: Michaël Burtin <mburtin@voxtok.com>
---
 meta/classes/package_rpm.bbclass | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index e305e8b..3e8ae3d 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -196,6 +196,7 @@ python write_specfile () {
             path = rootpath.replace(walkpath, "")
             if path.endswith("DEBIAN") or path.endswith("CONTROL"):
                 continue
+            path = path.replace("%", "%%%%%%%%")
 
             # Treat all symlinks to directories as normal files.
             # os.walk() lists them as directories.
@@ -214,6 +215,7 @@ python write_specfile () {
                 for dir in dirs:
                     if dir == "CONTROL" or dir == "DEBIAN":
                         continue
+                    dir = dir.replace("%", "%%%%%%%%")
                     # All packages own the directories their files are in...
                     target.append('%dir "' + path + '/' + dir + '"')
             else:
@@ -227,6 +229,7 @@ python write_specfile () {
             for file in files:
                 if file == "CONTROL" or file == "DEBIAN":
                     continue
+                file = file.replace("%", "%%%%%%%%")
                 if conffiles.count(path + '/' + file):
                     target.append('%config "' + path + '/' + file + '"')
                 else:
-- 
2.1.4



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

end of thread, other threads:[~2015-05-20 14:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-29 16:09 [PATCH] package_rpm.bbclass : escape "%" in files and directories name Sébastien Mennetrier
2013-10-29 16:16 ` Paul Eggleton
2013-10-29 16:37   ` Sebastien MENNETRIER
  -- strict thread matches above, loose matches on Subject: below --
2015-05-20 14:48 Michaël Burtin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox