Patchwork [1/2] logrotate: obey our flags

login
register
mail settings
Submitter Fahad Usman
Date Aug. 25, 2014, 4:22 p.m.
Message ID <1408983725-45864-1-git-send-email-fahad_usman@mentor.com>
Download mbox | patch
Permalink /patch/78909/
State Accepted
Commit 682933a531b1efaab1b7948540f6efd9523deab7
Headers show

Comments

Fahad Usman - Aug. 25, 2014, 4:22 p.m.
Needed to quiet GNU_HASH warnings, amd some minor fixes.

Signed-off-by: Fahad Usman <fahad.usman@gmail.com>
Signed-off-by: Christopher Larson <kergoth@gmail.com>
---
 meta/recipes-extended/logrotate/logrotate_3.8.7.bb |   18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)
Christopher Larson - Aug. 25, 2014, 4:30 p.m.
On Mon, Aug 25, 2014 at 9:22 AM, Fahad Usman <fahad_usman@mentor.com> wrote:

> Needed to quiet GNU_HASH warnings, amd some minor fixes.


Typo, not amd :)
Khem Raj - Aug. 25, 2014, 5:19 p.m.
On 14-08-25 21:22:04, Fahad Usman wrote:
> Needed to quiet GNU_HASH warnings, amd some minor fixes.
> 
> Signed-off-by: Fahad Usman <fahad.usman@gmail.com>
> Signed-off-by: Christopher Larson <kergoth@gmail.com>
> ---
>  meta/recipes-extended/logrotate/logrotate_3.8.7.bb |   18 ++++++++++++++++--
>  1 file changed, 16 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/recipes-extended/logrotate/logrotate_3.8.7.bb b/meta/recipes-extended/logrotate/logrotate_3.8.7.bb
> index 3a6a228..42cd764 100644
> --- a/meta/recipes-extended/logrotate/logrotate_3.8.7.bb
> +++ b/meta/recipes-extended/logrotate/logrotate_3.8.7.bb
> @@ -16,7 +16,21 @@ SRC_URI = "https://fedorahosted.org/releases/l/o/logrotate/logrotate-${PV}.tar.g
>  SRC_URI[md5sum] = "99e08503ef24c3e2e3ff74cc5f3be213"
>  SRC_URI[sha256sum] = "f6ba691f40e30e640efa2752c1f9499a3f9738257660994de70a45fe00d12b64"
>  
> -EXTRA_OEMAKE = ""
> +# If RPM_OPT_FLAGS is unset, it adds -g itself rather than obeying our
> +# optimization variables, so use it rather than EXTRA_CFLAGS.
> +EXTRA_OEMAKE = "\
> +    LFS= \
> +    OS_NAME='${OS_NAME}' \
> +    \
> +    'CC=${CC}' \

hmmm CC may have spaces in it so you might need 'CC="${CC}"' or somesuch
Chris Larson - Aug. 25, 2014, 5:21 p.m.
On Mon, Aug 25, 2014 at 10:19 AM, Khem Raj <raj.khem@gmail.com> wrote:

> On 14-08-25 21:22:04, Fahad Usman wrote:
> > Needed to quiet GNU_HASH warnings, amd some minor fixes.
> >
> > Signed-off-by: Fahad Usman <fahad.usman@gmail.com>
> > Signed-off-by: Christopher Larson <kergoth@gmail.com>
> > ---
> >  meta/recipes-extended/logrotate/logrotate_3.8.7.bb |   18
> ++++++++++++++++--
> >  1 file changed, 16 insertions(+), 2 deletions(-)
> >
> > diff --git a/meta/recipes-extended/logrotate/logrotate_3.8.7.bb
> b/meta/recipes-extended/logrotate/logrotate_3.8.7.bb
> > index 3a6a228..42cd764 100644
> > --- a/meta/recipes-extended/logrotate/logrotate_3.8.7.bb
> > +++ b/meta/recipes-extended/logrotate/logrotate_3.8.7.bb
> > @@ -16,7 +16,21 @@ SRC_URI = "
> https://fedorahosted.org/releases/l/o/logrotate/logrotate-${PV}.tar.g
> >  SRC_URI[md5sum] = "99e08503ef24c3e2e3ff74cc5f3be213"
> >  SRC_URI[sha256sum] =
> "f6ba691f40e30e640efa2752c1f9499a3f9738257660994de70a45fe00d12b64"
> >
> > -EXTRA_OEMAKE = ""
> > +# If RPM_OPT_FLAGS is unset, it adds -g itself rather than obeying our
> > +# optimization variables, so use it rather than EXTRA_CFLAGS.
> > +EXTRA_OEMAKE = "\
> > +    LFS= \
> > +    OS_NAME='${OS_NAME}' \
> > +    \
> > +    'CC=${CC}' \
>
> hmmm CC may have spaces in it so you might need 'CC="${CC}"' or somesuch


Nope, the whole CC=${CC} argument is already quoted, note the single quotes
around it. Those quotes mean the entire CC=${CC} bit ends up in the
appropriate argument for make, so there's no need to quote the value alone.
Khem Raj - Aug. 25, 2014, 5:51 p.m.
On 14-08-25 10:21:31, Christopher Larson wrote:
> On Mon, Aug 25, 2014 at 10:19 AM, Khem Raj <raj.khem@gmail.com> wrote:
> 
> > On 14-08-25 21:22:04, Fahad Usman wrote:
> > > Needed to quiet GNU_HASH warnings, amd some minor fixes.
> > >
> > > Signed-off-by: Fahad Usman <fahad.usman@gmail.com>
> > > Signed-off-by: Christopher Larson <kergoth@gmail.com>
> > > ---
> > >  meta/recipes-extended/logrotate/logrotate_3.8.7.bb |   18
> > ++++++++++++++++--
> > >  1 file changed, 16 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/meta/recipes-extended/logrotate/logrotate_3.8.7.bb
> > b/meta/recipes-extended/logrotate/logrotate_3.8.7.bb
> > > index 3a6a228..42cd764 100644
> > > --- a/meta/recipes-extended/logrotate/logrotate_3.8.7.bb
> > > +++ b/meta/recipes-extended/logrotate/logrotate_3.8.7.bb
> > > @@ -16,7 +16,21 @@ SRC_URI = "
> > https://fedorahosted.org/releases/l/o/logrotate/logrotate-${PV}.tar.g
> > >  SRC_URI[md5sum] = "99e08503ef24c3e2e3ff74cc5f3be213"
> > >  SRC_URI[sha256sum] =
> > "f6ba691f40e30e640efa2752c1f9499a3f9738257660994de70a45fe00d12b64"
> > >
> > > -EXTRA_OEMAKE = ""
> > > +# If RPM_OPT_FLAGS is unset, it adds -g itself rather than obeying our
> > > +# optimization variables, so use it rather than EXTRA_CFLAGS.
> > > +EXTRA_OEMAKE = "\
> > > +    LFS= \
> > > +    OS_NAME='${OS_NAME}' \
> > > +    \
> > > +    'CC=${CC}' \
> >
> > hmmm CC may have spaces in it so you might need 'CC="${CC}"' or somesuch
> 
> 
> Nope, the whole CC=${CC} argument is already quoted, note the single quotes
> around it. Those quotes mean the entire CC=${CC} bit ends up in the
> appropriate argument for make, so there's no need to quote the value alone.

What happens inside makefile is what I am concerned
in case of python, IIRC it passed it but when CC was used it would
freak out since CC now was a multiword str but then those were not inside makefiles
if you have verified thats fine here then I am OK.
Fahad Usman - Aug. 26, 2014, 7:43 a.m.
On 08/25/2014 10:51 PM, Khem Raj wrote:
>>>> +    LFS= \
>>>> > > >+    OS_NAME='${OS_NAME}' \
>>>> > > >+    \
>>>> > > >+    'CC=${CC}' \
>>> > >
>>> > >hmmm CC may have spaces in it so you might need 'CC="${CC}"' or somesuch
>> >
>> >
>> >Nope, the whole CC=${CC} argument is already quoted, note the single quotes
>> >around it. Those quotes mean the entire CC=${CC} bit ends up in the
>> >appropriate argument for make, so there's no need to quote the value alone.
> What happens inside makefile is what I am concerned
> in case of python, IIRC it passed it but when CC was used it would
> freak out since CC now was a multiword str but then those were not inside makefiles
> if you have verified thats fine here then I am OK.
Just checked the CC do have spaces, and it works fine. I am re-sending 
the patch with the fixed typo.

Patch

diff --git a/meta/recipes-extended/logrotate/logrotate_3.8.7.bb b/meta/recipes-extended/logrotate/logrotate_3.8.7.bb
index 3a6a228..42cd764 100644
--- a/meta/recipes-extended/logrotate/logrotate_3.8.7.bb
+++ b/meta/recipes-extended/logrotate/logrotate_3.8.7.bb
@@ -16,7 +16,21 @@  SRC_URI = "https://fedorahosted.org/releases/l/o/logrotate/logrotate-${PV}.tar.g
 SRC_URI[md5sum] = "99e08503ef24c3e2e3ff74cc5f3be213"
 SRC_URI[sha256sum] = "f6ba691f40e30e640efa2752c1f9499a3f9738257660994de70a45fe00d12b64"
 
-EXTRA_OEMAKE = ""
+# If RPM_OPT_FLAGS is unset, it adds -g itself rather than obeying our
+# optimization variables, so use it rather than EXTRA_CFLAGS.
+EXTRA_OEMAKE = "\
+    LFS= \
+    OS_NAME='${OS_NAME}' \
+    \
+    'CC=${CC}' \
+    'RPM_OPT_FLAGS=${CFLAGS}' \
+    'EXTRA_LDFLAGS=${LDFLAGS}' \
+"
+
+# OS_NAME in the makefile defaults to `uname -s`. The behavior for
+# freebsd/netbsd is questionable, so leave it as Linux, which only sets
+# INSTALL=install and BASEDIR=/usr.
+OS_NAME = "Linux"
 
 do_compile_prepend() {
     # Make sure the recompile is OK
@@ -24,7 +38,7 @@  do_compile_prepend() {
 }
 
 do_install(){
-    oe_runmake install DESTDIR=${D} PREFIX=${D} MANDIR=${mandir}
+    oe_runmake install DESTDIR=${D} PREFIX=${D} MANDIR=${mandir} BINDIR=${bindir}
     mkdir -p ${D}${sysconfdir}/logrotate.d
     mkdir -p ${D}${sysconfdir}/cron.daily
     mkdir -p ${D}${localstatedir}/lib