[OE-core] [PATCH 0/1]package_rpm.bbclass: remove xx.spec before doing rpmbuild xx.src.rpm

Paul Eggleton paul.eggleton at linux.intel.com
Mon Jul 15 09:47:21 UTC 2013


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 at 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



More information about the Openembedded-core mailing list