* [PATCH 0/1]package_rpm.bbclass: remove xx.spec before doing rpmbuild xx.src.rpm
@ 2013-07-09 8:27 Bian Naimeng
2013-07-10 2:56 ` Bian Naimeng
0 siblings, 1 reply; 7+ messages in thread
From: Bian Naimeng @ 2013-07-09 8:27 UTC (permalink / raw)
To: openembedded-core
If the spec file already exist, and has not been stored into pseudo's files.db,
it maybe cause rpmbuild src.rpm fail, so remove it before doing rpmbuild src.rpm.
Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
---
meta/classes/package_rpm.bbclass | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index c654cdb..217ddcb 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -1069,8 +1069,13 @@ python do_package_rpm () {
return
# Construct the spec file...
+ # If the spec file already exist, and has not been stored into
+ # pseudo's files.db, it maybe cause rpmbuild src.rpm fail,
+ # so remove it before doing rpmbuild src.rpm.
srcname = strip_multilib(d.getVar('PN', True), d)
outspecfile = workdir + "/" + srcname + ".spec"
+ if os.path.isfile(outspecfile):
+ os.remove(outspecfile)
d.setVar('OUTSPECFILE', outspecfile)
bb.build.exec_func('write_specfile', d)
--
1.7.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 0/1]package_rpm.bbclass: remove xx.spec before doing rpmbuild xx.src.rpm
2013-07-09 8:27 [PATCH 0/1]package_rpm.bbclass: remove xx.spec before doing rpmbuild xx.src.rpm Bian Naimeng
@ 2013-07-10 2:56 ` Bian Naimeng
2013-07-11 10:54 ` Burton, Ross
0 siblings, 1 reply; 7+ messages in thread
From: Bian Naimeng @ 2013-07-10 2:56 UTC (permalink / raw)
To: openembedded-core
Hi all
Sorry, it looks like i should post this patch to poky. please ignore this
Thanks
Bian
said the following on 2013-7-9 16:27:, Bian Naimeng wrote:
> If the spec file already exist, and has not been stored into pseudo's files.db,
> it maybe cause rpmbuild src.rpm fail, so remove it before doing rpmbuild src.rpm.
>
> Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
>
> ---
> meta/classes/package_rpm.bbclass | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
> index c654cdb..217ddcb 100644
> --- a/meta/classes/package_rpm.bbclass
> +++ b/meta/classes/package_rpm.bbclass
> @@ -1069,8 +1069,13 @@ python do_package_rpm () {
> return
>
> # Construct the spec file...
> + # If the spec file already exist, and has not been stored into
> + # pseudo's files.db, it maybe cause rpmbuild src.rpm fail,
> + # so remove it before doing rpmbuild src.rpm.
> srcname = strip_multilib(d.getVar('PN', True), d)
> outspecfile = workdir + "/" + srcname + ".spec"
> + if os.path.isfile(outspecfile):
> + os.remove(outspecfile)
> d.setVar('OUTSPECFILE', outspecfile)
> bb.build.exec_func('write_specfile', d)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/1]package_rpm.bbclass: remove xx.spec before doing rpmbuild xx.src.rpm
2013-07-10 2:56 ` Bian Naimeng
@ 2013-07-11 10:54 ` Burton, Ross
2013-07-12 2:04 ` Bian Naimeng
0 siblings, 1 reply; 7+ messages in thread
From: Burton, Ross @ 2013-07-11 10:54 UTC (permalink / raw)
To: Bian Naimeng; +Cc: openembedded-core
On 10 July 2013 03:56, Bian Naimeng <biannm@cn.fujitsu.com> wrote:
> Sorry, it looks like i should post this patch to poky. please ignore this
You were right the first time, meta/ is oe-core. :)
Ross
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/1]package_rpm.bbclass: remove xx.spec before doing rpmbuild xx.src.rpm
2013-07-11 10:54 ` Burton, Ross
@ 2013-07-12 2:04 ` Bian Naimeng
2013-07-12 17:07 ` Paul Eggleton
0 siblings, 1 reply; 7+ messages in thread
From: Bian Naimeng @ 2013-07-12 2:04 UTC (permalink / raw)
To: Burton, Ross; +Cc: openembedded-core
said the following on 2013-7-11 18:54:, Burton, Ross wrote:
> On 10 July 2013 03:56, Bian Naimeng <biannm@cn.fujitsu.com> wrote:
>> Sorry, it looks like i should post this patch to poky. please ignore this
>
> You were right the first time, meta/ is oe-core. :)
>
Thanks for your reminding.
In this case, the following error will be caught.
| error: Bad owner/group: .../tmp/work/i586-poky-linux/.../xxx.spec
| Building target platforms: i586-poky-linux
|
|
| RPM build errors:
| Bad owner/group: .../tmp/work/i586-poky-linux/.../xxx.spec
The following bb file can cause this error.
# cat xxx.bb
SRC_URI="..../xxx.src.rpm"
do_unpack2 () {
cd ${WORKDIR}
tar zxvf xxx.tar.gz
}
addtask do_unpack2 after do_unpack before do_configure
Of course, we can walk around it by append "extract=xxx.tar.gz" to SRC_URI,
but it's not good way when the xxx.src.rpm containing lots of necessary files.
Thanks
Bian
> Ross
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/1]package_rpm.bbclass: remove xx.spec before doing rpmbuild xx.src.rpm
2013-07-12 2:04 ` Bian Naimeng
@ 2013-07-12 17:07 ` Paul Eggleton
2013-07-15 2:08 ` Bian Naimeng
0 siblings, 1 reply; 7+ messages in thread
From: Paul Eggleton @ 2013-07-12 17:07 UTC (permalink / raw)
To: Bian Naimeng; +Cc: openembedded-core
Hi Bian,
On Friday 12 July 2013 10:04:56 Bian Naimeng wrote:
> said the following on 2013-7-11 18:54:, Burton, Ross wrote:
> > On 10 July 2013 03:56, Bian Naimeng <biannm@cn.fujitsu.com> wrote:
> >> Sorry, it looks like i should post this patch to poky. please ignore this
> >
> > You were right the first time, meta/ is oe-core. :)
>
> Thanks for your reminding.
>
> In this case, the following error will be caught.
>
> | error: Bad owner/group: .../tmp/work/i586-poky-linux/.../xxx.spec
> | Building target platforms: i586-poky-linux
> |
> | RPM build errors:
> | Bad owner/group: .../tmp/work/i586-poky-linux/.../xxx.spec
>
> The following bb file can cause this error.
> # cat xxx.bb
> SRC_URI="..../xxx.src.rpm"
>
> do_unpack2 () {
> cd ${WORKDIR}
> tar zxvf xxx.tar.gz
> }
> addtask do_unpack2 after do_unpack before do_configure
>
> Of course, we can walk around it by append "extract=xxx.tar.gz" to SRC_URI,
> but it's not good way when the xxx.src.rpm containing lots of necessary
> files.
Wouldn't using subdir=xyz in the SRC_URI entry put the contents of the rpm
into a subdirectory and thus avoid this problem?
Cheers,
Paul
--
Paul Eggleton
Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/1]package_rpm.bbclass: remove xx.spec before doing rpmbuild xx.src.rpm
2013-07-12 17:07 ` Paul Eggleton
@ 2013-07-15 2:08 ` Bian Naimeng
2013-07-15 9:47 ` Paul Eggleton
0 siblings, 1 reply; 7+ messages in thread
From: Bian Naimeng @ 2013-07-15 2:08 UTC (permalink / raw)
To: Paul Eggleton; +Cc: openembedded-core
Hi Paul,
said the following on 2013-7-13 1:07:, Paul Eggleton wrote:
> Hi Bian,
>
> On Friday 12 July 2013 10:04:56 Bian Naimeng wrote:
>> said the following on 2013-7-11 18:54:, Burton, Ross wrote:
>>> On 10 July 2013 03:56, Bian Naimeng <biannm@cn.fujitsu.com> wrote:
>>>> Sorry, it looks like i should post this patch to poky. please ignore this
>>>
>>> You were right the first time, meta/ is oe-core. :)
>>
>> Thanks for your reminding.
>>
>> In this case, the following error will be caught.
>>
>> | error: Bad owner/group: .../tmp/work/i586-poky-linux/.../xxx.spec
>> | Building target platforms: i586-poky-linux
>> |
>> | RPM build errors:
>> | Bad owner/group: .../tmp/work/i586-poky-linux/.../xxx.spec
>>
>> The following bb file can cause this error.
>> # cat xxx.bb
>> SRC_URI="..../xxx.src.rpm"
>>
>> do_unpack2 () {
>> cd ${WORKDIR}
>> tar zxvf xxx.tar.gz
>> }
>> addtask do_unpack2 after do_unpack before do_configure
>>
>> Of course, we can walk around it by append "extract=xxx.tar.gz" to SRC_URI,
>> but it's not good way when the xxx.src.rpm containing lots of necessary
>> files.
>
> Wouldn't using subdir=xyz in the SRC_URI entry put the contents of the rpm
> into a subdirectory and thus avoid this problem?
>
Thanks for your suggestion.
Yes, it's can avoid this problem.
But, why we don't remove the xxx.spec file before doing rpmbuild xx.src.rpm if it's existed.
The old xxx.spec is unuseful.
In my opinion, it can make the bb file easier and clean than using subdir=xyz in the SRC_URI
Thanks,
Bian
> Cheers,
> Paul
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/1]package_rpm.bbclass: remove xx.spec before doing rpmbuild xx.src.rpm
2013-07-15 2:08 ` Bian Naimeng
@ 2013-07-15 9:47 ` Paul Eggleton
0 siblings, 0 replies; 7+ messages in thread
From: Paul Eggleton @ 2013-07-15 9:47 UTC (permalink / raw)
To: Bian Naimeng; +Cc: openembedded-core
On Monday 15 July 2013 10:08:30 Bian Naimeng wrote:
> Hi Paul,
>
> said the following on 2013-7-13 1:07:, Paul Eggleton wrote:
> > Hi Bian,
> >
> > On Friday 12 July 2013 10:04:56 Bian Naimeng wrote:
> >> said the following on 2013-7-11 18:54:, Burton, Ross wrote:
> >>> On 10 July 2013 03:56, Bian Naimeng <biannm@cn.fujitsu.com> wrote:
> >>>> Sorry, it looks like i should post this patch to poky. please ignore
> >>>> this
> >>>
> >>> You were right the first time, meta/ is oe-core. :)
> >>
> >> Thanks for your reminding.
> >>
> >> In this case, the following error will be caught.
> >>
> >> | error: Bad owner/group: .../tmp/work/i586-poky-linux/.../xxx.spec
> >> | Building target platforms: i586-poky-linux
> >> |
> >> | RPM build errors:
> >> | Bad owner/group: .../tmp/work/i586-poky-linux/.../xxx.spec
> >>
> >> The following bb file can cause this error.
> >> # cat xxx.bb
> >>
> >> SRC_URI="..../xxx.src.rpm"
> >>
> >> do_unpack2 () {
> >>
> >> cd ${WORKDIR}
> >> tar zxvf xxx.tar.gz
> >>
> >> }
> >> addtask do_unpack2 after do_unpack before do_configure
> >>
> >> Of course, we can walk around it by append "extract=xxx.tar.gz" to
> >> SRC_URI, but it's not good way when the xxx.src.rpm containing lots of
> >> necessary files.
> >
> > Wouldn't using subdir=xyz in the SRC_URI entry put the contents of the rpm
> > into a subdirectory and thus avoid this problem?
>
> Thanks for your suggestion.
> Yes, it's can avoid this problem.
>
> But, why we don't remove the xxx.spec file before doing rpmbuild xx.src.rpm
> if it's existed. The old xxx.spec is unuseful.
It's a tricky situation. I just think there's a limit to the lengths we should
go to to prevent extraction of an archive that doesn't contain a subdirectory
and may therefore extract files that clash with files the build system wants to
write. In any case, this patch has now been merged.
> In my opinion, it can make the bb file easier and clean than using
> subdir=xyz in the SRC_URI
The subdir parameter is trivial to add, and my advice is that subdir should
always be used when the archive doesn't contain a reasonable subdirectory and
then you won't hit subtle problems like this one.
Cheers,
Paul
--
Paul Eggleton
Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-07-15 9:47 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-09 8:27 [PATCH 0/1]package_rpm.bbclass: remove xx.spec before doing rpmbuild xx.src.rpm Bian Naimeng
2013-07-10 2:56 ` Bian Naimeng
2013-07-11 10:54 ` Burton, Ross
2013-07-12 2:04 ` Bian Naimeng
2013-07-12 17:07 ` Paul Eggleton
2013-07-15 2:08 ` Bian Naimeng
2013-07-15 9:47 ` Paul Eggleton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox