Patchwork [2/2] package_deb: Use apt-ftparchive

login
register
mail settings
Submitter Ricardo Ribalda Delgado
Date March 13, 2014, 1:27 p.m.
Message ID <1394717224-15283-2-git-send-email-ricardo.ribalda@gmail.com>
Download mbox | patch
Permalink /patch/68593/
State New
Headers show

Comments

Ricardo Ribalda Delgado - March 13, 2014, 1:27 p.m.
Use apt-ftparchive to create a Release file compatible with SecureApt.

apt-ftparchive is not compatible with libpseudo. The calls to ftw()
returns the path in absolute format instead of relative. This produces
wrong Packages and Release files.

ie:
MD5Sum:
d20227a958f6870137ce0e41b7b84307             1453
/home/ricardo/curro/qtec/qt5022/build-qt5022-cesium/build/tmp/deploy/deb/all/Release

This is why it is called with PSEUDO_UNLOAD.

apt-ftparchive is also a more efficient replacement of dpkg-scanpackages:

root@neopili:~/curro/qtec/qt5022/build-qt5022-cesium/build/tmp/deploy/deb/bobcat
_64# time PSEUDO_UNLOAD=1 apt-ftparchive packages . >/tmp/kkk
real 0m26.873s
user 0m20.968s
sys 0m1.212s

root@neopili:~/curro/qtec/qt5022/build-qt5022-cesium/build/tmp/deploy/deb/bobcat
_64# time PSEUDO_UNLOAD=1 dpkg-scanpackages . >/tmp/kkk
dpkg-scanpackages: info: Wrote 6022 entries to output Packages file.
real 0m59.721s
user 0m16.668s
sys 0m11.164s

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
---
 meta/classes/package_deb.bbclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Richard Purdie - March 16, 2014, 11:01 p.m.
On Thu, 2014-03-13 at 14:27 +0100, Ricardo Ribalda Delgado wrote:
> Use apt-ftparchive to create a Release file compatible with SecureApt.
> 
> apt-ftparchive is not compatible with libpseudo. The calls to ftw()
> returns the path in absolute format instead of relative. This produces
> wrong Packages and Release files.
> 
> ie:
> MD5Sum:
> d20227a958f6870137ce0e41b7b84307             1453
> /home/ricardo/curro/qtec/qt5022/build-qt5022-cesium/build/tmp/deploy/deb/all/Release
> 
> This is why it is called with PSEUDO_UNLOAD.
> 
> apt-ftparchive is also a more efficient replacement of dpkg-scanpackages:
> 
> root@neopili:~/curro/qtec/qt5022/build-qt5022-cesium/build/tmp/deploy/deb/bobcat
> _64# time PSEUDO_UNLOAD=1 apt-ftparchive packages . >/tmp/kkk
> real 0m26.873s
> user 0m20.968s
> sys 0m1.212s
> 
> root@neopili:~/curro/qtec/qt5022/build-qt5022-cesium/build/tmp/deploy/deb/bobcat
> _64# time PSEUDO_UNLOAD=1 dpkg-scanpackages . >/tmp/kkk
> dpkg-scanpackages: info: Wrote 6022 entries to output Packages file.
> real 0m59.721s
> user 0m16.668s
> sys 0m11.164s
> 
> Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
> ---
>  meta/classes/package_deb.bbclass | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

This doesn't apply against master? What was this tested against?

Cheers,

Richard
Ricardo Ribalda Delgado - March 17, 2014, 7:59 a.m.
Hello Richard.

I have tested it with dora. I can rebase it.

Shall I rebase it over git://git.yoctoproject.org/poky or over
git://git.openembedded.org/openembedded-core

Thanks!

On Mon, Mar 17, 2014 at 12:01 AM, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> On Thu, 2014-03-13 at 14:27 +0100, Ricardo Ribalda Delgado wrote:
>> Use apt-ftparchive to create a Release file compatible with SecureApt.
>>
>> apt-ftparchive is not compatible with libpseudo. The calls to ftw()
>> returns the path in absolute format instead of relative. This produces
>> wrong Packages and Release files.
>>
>> ie:
>> MD5Sum:
>> d20227a958f6870137ce0e41b7b84307             1453
>> /home/ricardo/curro/qtec/qt5022/build-qt5022-cesium/build/tmp/deploy/deb/all/Release
>>
>> This is why it is called with PSEUDO_UNLOAD.
>>
>> apt-ftparchive is also a more efficient replacement of dpkg-scanpackages:
>>
>> root@neopili:~/curro/qtec/qt5022/build-qt5022-cesium/build/tmp/deploy/deb/bobcat
>> _64# time PSEUDO_UNLOAD=1 apt-ftparchive packages . >/tmp/kkk
>> real 0m26.873s
>> user 0m20.968s
>> sys 0m1.212s
>>
>> root@neopili:~/curro/qtec/qt5022/build-qt5022-cesium/build/tmp/deploy/deb/bobcat
>> _64# time PSEUDO_UNLOAD=1 dpkg-scanpackages . >/tmp/kkk
>> dpkg-scanpackages: info: Wrote 6022 entries to output Packages file.
>> real 0m59.721s
>> user 0m16.668s
>> sys 0m11.164s
>>
>> Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
>> ---
>>  meta/classes/package_deb.bbclass | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> This doesn't apply against master? What was this tested against?
>
> Cheers,
>
> Richard
>
Robert Yang - March 17, 2014, 8:30 a.m.
Hi Ricardo,

On 03/17/2014 03:59 PM, Ricardo Ribalda Delgado wrote:
> Hello Richard.
>
> I have tested it with dora. I can rebase it.
>

If it is for dora, then the Subject should in include [dora]

> Shall I rebase it over git://git.yoctoproject.org/poky or over
> git://git.openembedded.org/openembedded-core
>

I think that openembedded-core is preferred.

// Robert

> Thanks!
>
> On Mon, Mar 17, 2014 at 12:01 AM, Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
>> On Thu, 2014-03-13 at 14:27 +0100, Ricardo Ribalda Delgado wrote:
>>> Use apt-ftparchive to create a Release file compatible with SecureApt.
>>>
>>> apt-ftparchive is not compatible with libpseudo. The calls to ftw()
>>> returns the path in absolute format instead of relative. This produces
>>> wrong Packages and Release files.
>>>
>>> ie:
>>> MD5Sum:
>>> d20227a958f6870137ce0e41b7b84307             1453
>>> /home/ricardo/curro/qtec/qt5022/build-qt5022-cesium/build/tmp/deploy/deb/all/Release
>>>
>>> This is why it is called with PSEUDO_UNLOAD.
>>>
>>> apt-ftparchive is also a more efficient replacement of dpkg-scanpackages:
>>>
>>> root@neopili:~/curro/qtec/qt5022/build-qt5022-cesium/build/tmp/deploy/deb/bobcat
>>> _64# time PSEUDO_UNLOAD=1 apt-ftparchive packages . >/tmp/kkk
>>> real 0m26.873s
>>> user 0m20.968s
>>> sys 0m1.212s
>>>
>>> root@neopili:~/curro/qtec/qt5022/build-qt5022-cesium/build/tmp/deploy/deb/bobcat
>>> _64# time PSEUDO_UNLOAD=1 dpkg-scanpackages . >/tmp/kkk
>>> dpkg-scanpackages: info: Wrote 6022 entries to output Packages file.
>>> real 0m59.721s
>>> user 0m16.668s
>>> sys 0m11.164s
>>>
>>> Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
>>> ---
>>>   meta/classes/package_deb.bbclass | 4 +++-
>>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> This doesn't apply against master? What was this tested against?
>>
>> Cheers,
>>
>> Richard
>>
>
>
>
Ricardo Ribalda Delgado - March 17, 2014, 12:28 p.m.
Hello Robert.

I have just resend the patch. Is there any document describing this
conventions?


Thanks!

On Mon, Mar 17, 2014 at 9:30 AM, Robert Yang <liezhi.yang@windriver.com> wrote:
>
> Hi Ricardo,
>
>
> On 03/17/2014 03:59 PM, Ricardo Ribalda Delgado wrote:
>>
>> Hello Richard.
>>
>> I have tested it with dora. I can rebase it.
>>
>
> If it is for dora, then the Subject should in include [dora]
>
>
>> Shall I rebase it over git://git.yoctoproject.org/poky or over
>> git://git.openembedded.org/openembedded-core
>>
>
> I think that openembedded-core is preferred.
>
> // Robert
>
>
>> Thanks!
>>
>> On Mon, Mar 17, 2014 at 12:01 AM, Richard Purdie
>> <richard.purdie@linuxfoundation.org> wrote:
>>>
>>> On Thu, 2014-03-13 at 14:27 +0100, Ricardo Ribalda Delgado wrote:
>>>>
>>>> Use apt-ftparchive to create a Release file compatible with SecureApt.
>>>>
>>>> apt-ftparchive is not compatible with libpseudo. The calls to ftw()
>>>> returns the path in absolute format instead of relative. This produces
>>>> wrong Packages and Release files.
>>>>
>>>> ie:
>>>> MD5Sum:
>>>> d20227a958f6870137ce0e41b7b84307             1453
>>>>
>>>> /home/ricardo/curro/qtec/qt5022/build-qt5022-cesium/build/tmp/deploy/deb/all/Release
>>>>
>>>> This is why it is called with PSEUDO_UNLOAD.
>>>>
>>>> apt-ftparchive is also a more efficient replacement of
>>>> dpkg-scanpackages:
>>>>
>>>>
>>>> root@neopili:~/curro/qtec/qt5022/build-qt5022-cesium/build/tmp/deploy/deb/bobcat
>>>> _64# time PSEUDO_UNLOAD=1 apt-ftparchive packages . >/tmp/kkk
>>>> real 0m26.873s
>>>> user 0m20.968s
>>>> sys 0m1.212s
>>>>
>>>>
>>>> root@neopili:~/curro/qtec/qt5022/build-qt5022-cesium/build/tmp/deploy/deb/bobcat
>>>> _64# time PSEUDO_UNLOAD=1 dpkg-scanpackages . >/tmp/kkk
>>>> dpkg-scanpackages: info: Wrote 6022 entries to output Packages file.
>>>> real 0m59.721s
>>>> user 0m16.668s
>>>> sys 0m11.164s
>>>>
>>>> Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
>>>> ---
>>>>   meta/classes/package_deb.bbclass | 4 +++-
>>>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>>
>>>
>>> This doesn't apply against master? What was this tested against?
>>>
>>> Cheers,
>>>
>>> Richard
>>>
>>
>>
>>
>

Patch

diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass
index b391e5c..2ac1aed 100644
--- a/meta/classes/package_deb.bbclass
+++ b/meta/classes/package_deb.bbclass
@@ -37,8 +37,10 @@  package_update_index_deb () {
 			continue;
 		fi
 		cd ${DEPLOY_DIR_DEB}/$arch
-		dpkg-scanpackages . | gzip > Packages.gz
+		PSEUDO_UNLOAD=1 apt-ftparchive packages . > Packages
+		gzip Packages -c > Packages.gz
 		echo "Label: $arch" > Release
+		PSEUDO_UNLOAD=1 apt-ftparchive release . >> Release
 		found=1
 	done
 	if [ "$found" != "1" ]; then