From: Mark Hatle <mark.hatle@windriver.com>
To: <openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH 4/9] package_rpm: Add capability to directly query packageorigin
Date: Tue, 12 Jun 2012 13:46:18 -0500 [thread overview]
Message-ID: <4FD78E7A.2040006@windriver.com> (raw)
In-Reply-To: <CAOHjBZueyfYKnrq19a5J697ohfxriHRSarZBvbqfTFQYzoF48g@mail.gmail.com>
On 6/12/12 2:21 AM, Giuseppe Condorelli wrote:
> Hi Mark,
> this can be interesting for me. Please can you explain with an example what
> really this patch does?
The resolver database is seeded with all of the items from the packagefeed.
When you seed (install) a database, each entry gets a record of where the
package file exists on the disk. This is stored in the packageorigin field. It
is designed to be used by resolver systems.
Before you could only query the packageorigin field if you were using raw RPM
calls or using the --yaml export features. We wanted to be able to query the
file path from the resolver via the shell. This patch added that ability.
The packageorigin is likely not useful to anyone, unless you are using it in
conjunction w/ an associated package feed/resolver database.
--Mark
> Many thanks,
> Giuseppe
>
> 2012/6/11 Mark Hatle <mark.hatle@windriver.com <mailto:mark.hatle@windriver.com>>
>
> Add functionality to RPM to directly query the packageorigin (path) from
> the resolver database, instead of having to do this via an indirect method.
>
> This results in a minor performance improvement.
>
> Signed-off-by: Mark Hatle <mark.hatle@windriver.com
> <mailto:mark.hatle@windriver.com>>
> ---
> meta/classes/package_rpm.bbclass | 18 +++++++-------
> .../rpm/rpm/rpm-packageorigin.patch | 23 ++++++++++++++++++++
> meta/recipes-devtools/rpm/rpm_5.4.9.bb <http://rpm_5.4.9.bb> | 3 +-
> 3 files changed, 34 insertions(+), 10 deletions(-)
> create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-packageorigin.patch
>
> diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
> index 35928ab..097fa12 100644
> --- a/meta/classes/package_rpm.bbclass
> +++ b/meta/classes/package_rpm.bbclass
> @@ -130,12 +130,12 @@ resolve_package_rpm () {
> shift
> local pkg_name=""
> for solve in `cat ${conffile}`; do
> - pkg_name=$(${RPM} -D "_dbpath $solve" -D "__dbi_txn create nofsync" -q
> --yaml $@ | grep -i 'Packageorigin' | cut -d : -f 2)
> - if [ -n "$pkg_name" ]; then
> + pkg_name=$(${RPM} -D "_dbpath $solve" -D "__dbi_txn create nofsync" -q
> --qf "%{packageorigin}\n" "$@" | grep -v "is not installed" || true)
> + if [ -n "$pkg_name" -a "$pkg_name" != "(none)" ]; then
> + echo $pkg_name
> break;
> fi
> done
> - echo $pkg_name
> }
>
> # rpm common command and options
> @@ -401,9 +401,9 @@ package_install_internal_rpm () {
>
> # Now that we have a solution, pull out a list of what to install...
> echo "Manifest: ${target_rootfs}/install/install.manifest"
> - ${RPM} -D "_dbpath ${target_rootfs}/install" -qa --yaml \
> + ${RPM} -D "_dbpath ${target_rootfs}/install" -qa --qf "%{packageorigin}\n" \
> -D "__dbi_txn create nofsync private" \
> - | grep -i 'Packageorigin' | cut -d : -f 2 >
> ${target_rootfs}/install/install_solution.manifest
> + > ${target_rootfs}/install/install_solution.manifest
>
> touch ${target_rootfs}/install/install_multilib_solution.manifest
>
> @@ -421,9 +421,9 @@ package_install_internal_rpm () {
>
> # Now that we have a solution, pull out a list of what to install...
> echo "Manifest: ${target_rootfs}/install/install_multilib.manifest"
> - ${RPM} -D "_dbpath ${target_rootfs}/install" -qa --yaml \
> + ${RPM} -D "_dbpath ${target_rootfs}/install" -qa --qf "%{packageorigin}\n" \
> -D "__dbi_txn create nofsync private" \
> - | grep -i 'Packageorigin' | cut -d : -f 2 >
> ${target_rootfs}/install/install_multilib_solution.manifest
> + > ${target_rootfs}/install/install_multilib_solution.manifest
>
> fi
>
> @@ -478,9 +478,9 @@ EOF
> -U --justdb --noscripts --notriggers --noparentdirs --nolinktos --ignoresize \
> ${target_rootfs}/install/initial_install.manifest
>
> - ${RPM} -D "_dbpath ${target_rootfs}/initial" -qa --yaml \
> + ${RPM} -D "_dbpath ${target_rootfs}/initial" -qa --qf "%{packageorigin}\n" \
> -D "__dbi_txn create nofsync private" \
> - | grep -i 'Packageorigin' | cut -d : -f 2 >
> ${target_rootfs}/install/initial_solution.manifest
> + > ${target_rootfs}/install/initial_solution.manifest
>
> rpm_update_pkg ${target_rootfs}/install/initial_solution.manifest
>
> diff --git a/meta/recipes-devtools/rpm/rpm/rpm-packageorigin.patch
> b/meta/recipes-devtools/rpm/rpm/rpm-packageorigin.patch
> new file mode 100644
> index 0000000..3c6dad4
> --- /dev/null
> +++ b/meta/recipes-devtools/rpm/rpm/rpm-packageorigin.patch
> @@ -0,0 +1,23 @@
> +Add the ability to query the packageorigin
> +
> +Written by jbj at rpm5.org <http://rpm5.org>
> +
> +Signed-off-by: Mark Hatle <mark.hatle@windriver.com
> <mailto:mark.hatle@windriver.com>>
> +
> +Index: rpm-5.4.8/rpmdb/hdrfmt.c
> +===================================================================
> +--- rpm-5.4.8.orig/rpmdb/hdrfmt.c
> ++++ rpm-5.4.8/rpmdb/hdrfmt.c
> +@@ -2403,8 +2403,10 @@ static int pkgoriginTag(Header h, HE_t
> + int rc = 1;
> +
> + he->tag = RPMTAG_PACKAGEORIGIN;
> +- if (!headerGet(h, he, HEADERGET_NOEXTENSION)
> +- && (origin = headerGetOrigin(h)) != NULL)
> ++ /* XXX two sources for tag data: what search precedence? */
> ++ if (headerGet(h, he, HEADERGET_NOEXTENSION))
> ++ rc = 0;
> ++ else if ((origin = headerGetOrigin(h)) != NULL)
> + {
> + he->t = RPM_STRING_TYPE;
> + he->p.str = xstrdup(origin);
> diff --git a/meta/recipes-devtools/rpm/rpm_5.4.9.bb <http://rpm_5.4.9.bb>
> b/meta/recipes-devtools/rpm/rpm_5.4.9.bb <http://rpm_5.4.9.bb>
> index 2ca0f58..a38a684 100644
> --- a/meta/recipes-devtools/rpm/rpm_5.4.9.bb <http://rpm_5.4.9.bb>
> +++ b/meta/recipes-devtools/rpm/rpm_5.4.9.bb <http://rpm_5.4.9.bb>
> @@ -43,7 +43,7 @@ LICENSE = "LGPLv2.1"
> LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1"
>
> DEPENDS = "libpcre attr acl popt ossp-uuid file"
> -PR = "r41"
> +PR = "r42"
>
> # rpm2cpio is a shell script, which is part of the rpm src.rpm. It is needed
> # in order to extract the distribution SRPM into a format we can extract...
> @@ -70,6 +70,7 @@ SRC_URI =
> "http://www.rpm5.org/files/rpm/rpm-5.4/rpm-5.4.9-0.20120508.src.rpm;ex
> file://rpm-macros.patch \
> file://rpm-lua.patch \
> file://rpm-ossp-uuid.patch \
> + file://rpm-packageorigin.patch \
> "
>
> SRC_URI[md5sum] = "60d56ace884340c1b3fcac6a1d58e768"
> --
> 1.7.3.4
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> <mailto:Openembedded-core@lists.openembedded.org>
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>
>
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
next prev parent reply other threads:[~2012-06-12 18:56 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-11 18:18 [PATCH 0/9 v7] Uprev RPM to 5.4.9 Mark Hatle
2012-06-11 18:18 ` [PATCH 1/9] rpm: Upgrade RPM to 5.4.8 (db to 5.3.15) Mark Hatle
2012-06-11 18:18 ` [PATCH 2/9] rpm: Upgrade RPM to 5.4.9 Mark Hatle
2012-06-11 19:53 ` Khem Raj
2012-06-11 18:18 ` [PATCH 3/9] ossp-uuid: Add oss-uuid package and RPM 5.4.9 integration Mark Hatle
2012-06-11 18:18 ` [PATCH 4/9] package_rpm: Add capability to directly query packageorigin Mark Hatle
2012-06-12 7:21 ` Giuseppe Condorelli
2012-06-12 18:46 ` Mark Hatle [this message]
2012-06-13 8:03 ` Giuseppe Condorelli
2012-06-11 18:18 ` [PATCH 5/9] rpm: Bump PR numbers on componets that require RPM Mark Hatle
2012-06-11 18:18 ` [PATCH 6/9] rootfs_rpm.bbclass: Update database configuration file Mark Hatle
2012-06-11 18:18 ` [PATCH 7/9] createrepo: For compatibility w/ RPM 5.4.9 remove RPMVSF_NOSIGNATURES flag Mark Hatle
2012-06-11 18:18 ` [PATCH 8/9] package_rpm: Verify that the package manifests are not empty Mark Hatle
2012-06-11 19:56 ` Khem Raj
2012-06-11 18:19 ` [PATCH 9/9] rpm: Ensure pkgconfig deps don't stray from the package being built Mark Hatle
2012-06-11 18:36 ` [PATCH 0/9 v7] Uprev RPM to 5.4.9 Flanagan, Elizabeth
2012-06-12 10:11 ` Richard Purdie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FD78E7A.2040006@windriver.com \
--to=mark.hatle@windriver.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox