summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
Diffstat (limited to 'classes')
-rw-r--r--classes/package.bbclass6
-rw-r--r--classes/package_deb.bbclass6
-rw-r--r--classes/package_ipk.bbclass6
-rw-r--r--classes/package_rpm.bbclass8
-rw-r--r--classes/package_tar.bbclass4
5 files changed, 18 insertions, 12 deletions
diff --git a/classes/package.bbclass b/classes/package.bbclass
index a12bfb0a21..5daa7065ce 100644
--- a/classes/package.bbclass
+++ b/classes/package.bbclass
@@ -4,6 +4,12 @@
PKGDEST = "${WORKDIR}/install"
+def build_package_revision(d):
+ file_pr = bb.data.getVar('PR', d, True)
+ distro_pr = bb.data.getVar('DISTRO_PR', d, True) or ""
+ return "%s%s" % (file_pr, distro_pr)
+
+
def legitimize_package_name(s):
"""
Make sure package names are legitimate strings
diff --git a/classes/package_deb.bbclass b/classes/package_deb.bbclass
index e59d194aeb..64d8d4ed5d 100644
--- a/classes/package_deb.bbclass
+++ b/classes/package_deb.bbclass
@@ -131,7 +131,7 @@ python do_package_deb () {
pass
if not g and bb.data.getVar('ALLOW_EMPTY', localdata) != "1":
from bb import note
- note("Not creating empty archive for %s-%s-%s" % (pkg, bb.data.getVar('PV', localdata, 1), bb.data.getVar('PR', localdata, 1)))
+ note("Not creating empty archive for %s-%s-%s" % (pkg, bb.data.getVar('PV', localdata, 1), build_package_revision(localdata)))
bb.utils.unlockfile(lf)
continue
@@ -149,9 +149,9 @@ python do_package_deb () {
fields = []
pe = bb.data.getVar('PE', d, 1)
if pe and int(pe) > 0:
- fields.append(["Version: %s:%s-%s\n", ['PE', 'PV', 'PR']])
+ fields.append(["Version: %s:%s-%s%s\n", ['PE', 'PV', 'PR', 'DISTRO_PR']])
else:
- fields.append(["Version: %s-%s\n", ['PV', 'PR']])
+ fields.append(["Version: %s-%s%s\n", ['PV', 'PR', 'DISTRO_PR']])
fields.append(["Description: %s\n", ['DESCRIPTION']])
fields.append(["Section: %s\n", ['SECTION']])
fields.append(["Priority: %s\n", ['PRIORITY']])
diff --git a/classes/package_ipk.bbclass b/classes/package_ipk.bbclass
index f05b7449cf..438d4a15da 100644
--- a/classes/package_ipk.bbclass
+++ b/classes/package_ipk.bbclass
@@ -178,7 +178,7 @@ python do_package_ipk () {
pass
if not g and bb.data.getVar('ALLOW_EMPTY', localdata) != "1":
from bb import note
- note("Not creating empty archive for %s-%s-%s" % (pkg, bb.data.getVar('PV', localdata, 1), bb.data.getVar('PR', localdata, 1)))
+ note("Not creating empty archive for %s-%s-%s" % (pkg, bb.data.getVar('PV', localdata, 1), build_package_revision(localdata)))
bb.utils.unlockfile(lf)
continue
@@ -193,9 +193,9 @@ python do_package_ipk () {
fields = []
pe = bb.data.getVar('PE', d, 1)
if pe and int(pe) > 0:
- fields.append(["Version: %s:%s-%s\n", ['PE', 'PV', 'PR']])
+ fields.append(["Version: %s:%s-%s%s\n", ['PE', 'PV', 'PR', 'DISTRO_PR']])
else:
- fields.append(["Version: %s-%s\n", ['PV', 'PR']])
+ fields.append(["Version: %s-%s%s\n", ['PV', 'PR', 'DISTRO_PR']])
fields.append(["Description: %s\n", ['DESCRIPTION']])
fields.append(["Section: %s\n", ['SECTION']])
fields.append(["Priority: %s\n", ['PRIORITY']])
diff --git a/classes/package_rpm.bbclass b/classes/package_rpm.bbclass
index 6713f8fcad..e10ad90ffc 100644
--- a/classes/package_rpm.bbclass
+++ b/classes/package_rpm.bbclass
@@ -10,7 +10,6 @@ python write_specfile() {
out_vartranslate = {
"PKG": "Name",
"PV": "Version",
- "PR": "Release",
"DESCRIPTION": "%description",
"ROOT": "BuildRoot",
"LICENSE": "License",
@@ -41,7 +40,7 @@ python write_specfile() {
pass
if not files:
from bb import note
- note("Not creating empty archive for %s-%s-%s" % (bb.data.getVar('PKG',d, 1), bb.data.getVar('PV', d, 1), bb.data.getVar('PR', d, 1)))
+ note("Not creating empty archive for %s-%s-%s" % (bb.data.getVar('PKG',d, 1), bb.data.getVar('PV', d, 1), build_package_revision(d)))
return
# output .spec using this metadata store
@@ -58,6 +57,7 @@ python write_specfile() {
if out_vartranslate[var][0] == "%":
continue
fd.write("%s\t: %s\n" % (out_vartranslate[var], bb.data.getVar(var, d)))
+ fd.write("Release\t: %s\n" % build_package_revision(d))
fd.write("Summary\t: .\n")
for var in out_vartranslate.keys():
@@ -79,8 +79,8 @@ python write_specfile() {
bb.build.exec_func('BUILDSPEC', d)
# move the rpm into the pkgoutdir
- rpm = bb.data.expand('${RPMBUILDPATH}/RPMS/${TARGET_ARCH}/${PKG}-${PV}-${PR}.${TARGET_ARCH}.rpm', d)
- outrpm = bb.data.expand('${DEPLOY_DIR_RPM}/${PKG}-${PV}-${PR}.${TARGET_ARCH}.rpm', d)
+ rpm = bb.data.expand('${RPMBUILDPATH}/RPMS/${TARGET_ARCH}/${PKG}-${PV}-${PR}${DISTRO_PR}.${TARGET_ARCH}.rpm', d)
+ outrpm = bb.data.expand('${DEPLOY_DIR_RPM}/${PKG}-${PV}-${PR}${DISTRO_PR}.${TARGET_ARCH}.rpm', d)
bb.movefile(rpm, outrpm)
}
diff --git a/classes/package_tar.bbclass b/classes/package_tar.bbclass
index 876cec6cfe..9ce0c98b8b 100644
--- a/classes/package_tar.bbclass
+++ b/classes/package_tar.bbclass
@@ -5,7 +5,7 @@ IMAGE_PKGTYPE ?= "tar"
python package_tar_fn () {
import os
from bb import data
- fn = os.path.join(bb.data.getVar('DEPLOY_DIR_TAR', d), "%s-%s-%s.tar.gz" % (bb.data.getVar('PKG', d), bb.data.getVar('PV', d), bb.data.getVar('PR', d)))
+ fn = os.path.join(bb.data.getVar('DEPLOY_DIR_TAR', d), "%s-%s-%s.tar.gz" % (bb.data.getVar('PKG', d), bb.data.getVar('PV', d), build_package_revision(d)))
fn = bb.data.expand(fn, d)
bb.data.setVar('PKGFN', fn, d)
}
@@ -86,7 +86,7 @@ python do_package_tar () {
os.chdir(root)
from glob import glob
if not glob('*'):
- bb.note("Not creating empty archive for %s-%s-%s" % (pkg, bb.data.getVar('PV', localdata, 1), bb.data.getVar('PR', localdata, 1)))
+ bb.note("Not creating empty archive for %s-%s-%s" % (pkg, bb.data.getVar('PV', localdata, 1), build_package_revision(localdata)))
continue
ret = os.system("tar -czf %s %s" % (tarfn, '.'))
if ret != 0: