Merge branch 'org.openembedded.dev' of git://git.openembedded.net/openembedded into...
[vuplus_openembedded] / classes / packaged-staging.bbclass
index d6272b8..bd7b9ea 100644 (file)
@@ -109,17 +109,17 @@ def pstage_cleanpackage(pkgname, d):
        pstage_set_pkgmanager(d)
        list_cmd = bb.data.getVar("PSTAGE_LIST_CMD", d, True)
 
-       bb.note("Checking if staging package installed")
+       bb.debug(2, "Checking if staging package installed")
        lf = bb.utils.lockfile(bb.data.expand("${STAGING_DIR}/staging.lock", d))
        ret = os.system("PATH=\"%s\" %s | grep %s" % (path, list_cmd, pkgname))
        if ret == 0:
-               bb.note("Yes. Uninstalling package from staging...")
+               bb.debug(1, "Uninstalling package from staging...")
                removecmd = bb.data.getVar("PSTAGE_REMOVE_CMD", d, 1)
                ret = os.system("PATH=\"%s\" %s %s" % (path, removecmd, pkgname))
                if ret != 0:
                        bb.note("Failure removing staging package")
        else:
-               bb.note("No. Manually removing any installed files")
+               bb.debug(1, "Manually removing any installed files from staging...")
                pstage_manualclean("staging", "STAGING_DIR", d)
                pstage_manualclean("cross", "CROSS_DIR", d)
                pstage_manualclean("deploy", "DEPLOY_DIR", d)
@@ -135,7 +135,7 @@ do_clean_prepend() {
        pstage_cleanpackage(removepkg, d)
 
        stagepkg = bb.data.expand("${PSTAGE_PKG}", d)
-       bb.note("Removing staging package %s" % stagepkg)
+       bb.note("Removing staging package %s" % base_path_out(stagepkg, d))
        os.system('rm -rf ' + stagepkg)
 }
 
@@ -361,6 +361,8 @@ python do_package_stage () {
             ipkpath = bb.data.getVar('DEPLOY_DIR_IPK', d, True).replace(tmpdir, stagepath)
         if bb.data.inherits_class('package_deb', d):
             debpath = bb.data.getVar('DEPLOY_DIR_DEB', d, True).replace(tmpdir, stagepath)
+        if bb.data.inherits_class('package_rpm', d):
+            rpmpath = bb.data.getVar('DEPLOY_DIR_RPM', d, True).replace(tmpdir, stagepath)
 
         for pkg in packages:
             pkgname = bb.data.getVar('PKG_%s' % pkg, d, 1)
@@ -393,6 +395,18 @@ python do_package_stage () {
                     bb.mkdirhier(destpath)
                     bb.copyfile(srcfile, destpath + srcname)
 
+            if bb.data.inherits_class('package_rpm', d):
+               version = bb.data.getVar('PV', d, 1)
+               version = version.replace('-', '+')
+               bb.data.setVar('RPMPV', version, d)
+                srcname = bb.data.expand(pkgname + "-${RPMPV}-" + pr + ".${TARGET_ARCH}.rpm", d)
+                srcfile = bb.data.expand("${DEPLOY_DIR_RPM}/" + arch + "/" + srcname, d)
+                if os.path.exists(srcfile):
+                    destpath = rpmpath + "/" + arch + "/" 
+                    bb.mkdirhier(destpath)
+                    bb.copyfile(srcfile, destpath + srcname)
+
+
     #
     # Handle stamps/ files
     #