Patchwork [4/9] package_rpm.bbclass: create method for createrepo cmd

login
register
mail settings
Submitter Saul Wold
Date May 22, 2011, 6:48 p.m.
Message ID <ba11e66609ecaad27a4c225ee1e21d60a330d8f9.1306089781.git.sgw@linux.intel.com>
Download mbox | patch
Permalink /patch/4601/
State New, archived
Headers show

Comments

Saul Wold - May 22, 2011, 6:48 p.m.
Signed-off-by: Saul Wold <sgw@linux.intel.com>
---
 meta/classes/package_rpm.bbclass |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
Joshua Lock - May 22, 2011, 9:21 p.m.
Can we have an explanation of why this change was made in the commit
message?

Thanks,
Joshua

On Sun, 2011-05-22 at 11:48 -0700, Saul Wold wrote:
> Signed-off-by: Saul Wold <sgw@linux.intel.com>
> ---
>  meta/classes/package_rpm.bbclass |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
> index 1d8c686..666eb54 100644
> --- a/meta/classes/package_rpm.bbclass
> +++ b/meta/classes/package_rpm.bbclass
> @@ -15,6 +15,10 @@ python package_rpm_install () {
>  	bb.fatal("package_rpm_install not implemented!")
>  }
>  
> +package_createrepo () {
> +	createrepo ${DEPLOY_DIR_RPM}
> +}
> +
>  RPMCONF_TARGET_BASE = "${DEPLOY_DIR_RPM}/solvedb"
>  RPMCONF_HOST_BASE = "${DEPLOY_DIR_RPM}/solvedb-sdk"
>  #
> @@ -816,6 +820,6 @@ python do_package_write_rpm () {
>  do_package_write_rpm[dirs] = "${PKGWRITEDIRRPM}"
>  addtask package_write_rpm before do_package_write after do_package
>  
> -PACKAGEINDEXES += "package_update_index_rpm; createrepo ${DEPLOY_DIR_RPM};"
> +PACKAGEINDEXES += "package_update_index_rpm; package_createrepo"
>  PACKAGEINDEXDEPS += "rpm-native:do_populate_sysroot"
>  PACKAGEINDEXDEPS += "createrepo-native:do_populate_sysroot"
Richard Purdie - May 23, 2011, 2:39 p.m.
A couple of comments:

Firstly the commit message says what you changed, not why...

On Sun, 2011-05-22 at 11:48 -0700, Saul Wold wrote:
> Signed-off-by: Saul Wold <sgw@linux.intel.com>
> ---
>  meta/classes/package_rpm.bbclass |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
> index 1d8c686..666eb54 100644
> --- a/meta/classes/package_rpm.bbclass
> +++ b/meta/classes/package_rpm.bbclass
> @@ -15,6 +15,10 @@ python package_rpm_install () {
>  	bb.fatal("package_rpm_install not implemented!")
>  }
>  
> +package_createrepo () {
> +	createrepo ${DEPLOY_DIR_RPM}
> +}
> +
>  RPMCONF_TARGET_BASE = "${DEPLOY_DIR_RPM}/solvedb"
>  RPMCONF_HOST_BASE = "${DEPLOY_DIR_RPM}/solvedb-sdk"
>  #
> @@ -816,6 +820,6 @@ python do_package_write_rpm () {
>  do_package_write_rpm[dirs] = "${PKGWRITEDIRRPM}"
>  addtask package_write_rpm before do_package_write after do_package
>  
> -PACKAGEINDEXES += "package_update_index_rpm; createrepo ${DEPLOY_DIR_RPM};"
> +PACKAGEINDEXES += "package_update_index_rpm; package_createrepo"

Secondly this should end in a ;. I'd just add the
package_update_index_rpm call to package_createrepo to be honest.
package_createrepo could also do with rpm in the name somewhere just to
we're reminded its rpm specific in other contexts.

Cheers,

Richard

Patch

diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 1d8c686..666eb54 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -15,6 +15,10 @@  python package_rpm_install () {
 	bb.fatal("package_rpm_install not implemented!")
 }
 
+package_createrepo () {
+	createrepo ${DEPLOY_DIR_RPM}
+}
+
 RPMCONF_TARGET_BASE = "${DEPLOY_DIR_RPM}/solvedb"
 RPMCONF_HOST_BASE = "${DEPLOY_DIR_RPM}/solvedb-sdk"
 #
@@ -816,6 +820,6 @@  python do_package_write_rpm () {
 do_package_write_rpm[dirs] = "${PKGWRITEDIRRPM}"
 addtask package_write_rpm before do_package_write after do_package
 
-PACKAGEINDEXES += "package_update_index_rpm; createrepo ${DEPLOY_DIR_RPM};"
+PACKAGEINDEXES += "package_update_index_rpm; package_createrepo"
 PACKAGEINDEXDEPS += "rpm-native:do_populate_sysroot"
 PACKAGEINDEXDEPS += "createrepo-native:do_populate_sysroot"