Skip to contentSkip to conversation

PKGPV/PKGPR of the PKG fame

RFC In review Paul Sokolovsky 2 participants 4 messages Feb 15, 2008

lore
Share & tools
lore
#0 lore raw

RFC 1/1 PKGPV/PKGPR of the PKG fame

Hello,

We now have ability to arbitrarily rename a package as built by package manager using PKG_<name> construct. Natural and consistent extension to that would be to allow to rename other parts of full package name - version and release.

This is useful for building meta-recipes, which package something from external source without need to know version beforehand.

============================================================

package_ipk.bbclass +11 -2
@@ -166,10 +166,19 @@ python do_package_ipk () {
 
 		bb.data.setVar('ROOT', '', localdata)
 		bb.data.setVar('ROOT_%s' % pkg, root, localdata)
+
 		pkgname = bb.data.getVar('PKG_%s' % pkg, localdata, 1)
 		if not pkgname:
 			pkgname = pkg
 		bb.data.setVar('PKG', pkgname, localdata)
+		pv = bb.data.getVar('PKGPV_%s' % pkg, localdata, 1)
+		if not pv:
+		    pv = bb.data.getVar('PV', localdata, 1)
+		bb.data.setVar('PKGPV', pv, localdata)
+		pv = bb.data.getVar('PKGPR_%s' % pkg, localdata, 1)
+		if not pv:
+		    pv = bb.data.getVar('PR', localdata, 1)
+		bb.data.setVar('PKGPR', pv, localdata)
 
 		overrides = bb.data.getVar('OVERRIDES', localdata)
 		if not overrides:
@@ -207,9 +216,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\n", ['PE', 'PKGPV', 'PKGPR']])
 		else:
-			fields.append(["Version: %s-%s\n", ['PV', 'PR']])
+			fields.append(["Version: %s-%s\n", ['PKGPV', 'PKGPR']])
 		fields.append(["Description: %s\n", ['DESCRIPTION']])
 		fields.append(["Section: %s\n", ['SECTION']])
 		fields.append(["Priority: %s\n", ['PRIORITY']])
Signature · 2 lines
Best regards,
 Paul                          mailto:[email protected]
#1 lore raw

Hi,
this is the best thing since sliced bread for those poor souls building compatible packages for existing non-OE made distributions.

+1 from me.

Regards
Robert

Quoted 47 lines · Paul Sokolovsky

Hello,

We now have ability to arbitrarily rename a package as built by package manager using PKG_<name> construct. Natural and consistent extension to that would be to allow to rename other parts of full package name - version and release.

This is useful for building meta-recipes, which package something from external source without need to know version beforehand.

============================================================

package_ipk.bbclass +11 -2
@@ -166,10 +166,19 @@ python do_package_ipk () {
 
 		bb.data.setVar('ROOT', '', localdata)
 		bb.data.setVar('ROOT_%s' % pkg, root, localdata)
+
 		pkgname = bb.data.getVar('PKG_%s' % pkg, localdata, 1)
 		if not pkgname:
 			pkgname = pkg
 		bb.data.setVar('PKG', pkgname, localdata)
+		pv = bb.data.getVar('PKGPV_%s' % pkg, localdata, 1)
+		if not pv:
+		    pv = bb.data.getVar('PV', localdata, 1)
+		bb.data.setVar('PKGPV', pv, localdata)
+		pv = bb.data.getVar('PKGPR_%s' % pkg, localdata, 1)
+		if not pv:
+		    pv = bb.data.getVar('PR', localdata, 1)
+		bb.data.setVar('PKGPR', pv, localdata)
 
 		overrides = bb.data.getVar('OVERRIDES', localdata)
 		if not overrides:
@@ -207,9 +216,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\n", ['PE', 'PKGPV', 'PKGPR']])
 		else:
-			fields.append(["Version: %s-%s\n", ['PV', 'PR']])
+			fields.append(["Version: %s-%s\n", ['PKGPV', 'PKGPR']])
 		fields.append(["Description: %s\n", ['DESCRIPTION']])
 		fields.append(["Section: %s\n", ['SECTION']])
 		fields.append(["Priority: %s\n", ['PRIORITY']])
#2 lore raw
In reply to Paul Sokolovsky

Hi,
while I like the general idea the proposed implemented is not so nice IMHO because
- it works only for ipk packaging (should be agnostic)
- for dependency resolution the original version values are used

IMHO this stuff should be done in packaging.bbclass instead.

Regards
Robert

Quoted 47 lines · Paul Sokolovsky

Hello,

We now have ability to arbitrarily rename a package as built by package manager using PKG_<name> construct. Natural and consistent extension to that would be to allow to rename other parts of full package name - version and release.

This is useful for building meta-recipes, which package something from external source without need to know version beforehand.

============================================================

package_ipk.bbclass +11 -2
@@ -166,10 +166,19 @@ python do_package_ipk () {
 
 		bb.data.setVar('ROOT', '', localdata)
 		bb.data.setVar('ROOT_%s' % pkg, root, localdata)
+
 		pkgname = bb.data.getVar('PKG_%s' % pkg, localdata, 1)
 		if not pkgname:
 			pkgname = pkg
 		bb.data.setVar('PKG', pkgname, localdata)
+		pv = bb.data.getVar('PKGPV_%s' % pkg, localdata, 1)
+		if not pv:
+		    pv = bb.data.getVar('PV', localdata, 1)
+		bb.data.setVar('PKGPV', pv, localdata)
+		pv = bb.data.getVar('PKGPR_%s' % pkg, localdata, 1)
+		if not pv:
+		    pv = bb.data.getVar('PR', localdata, 1)
+		bb.data.setVar('PKGPR', pv, localdata)
 
 		overrides = bb.data.getVar('OVERRIDES', localdata)
 		if not overrides:
@@ -207,9 +216,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\n", ['PE', 'PKGPV', 'PKGPR']])
 		else:
-			fields.append(["Version: %s-%s\n", ['PV', 'PR']])
+			fields.append(["Version: %s-%s\n", ['PKGPV', 'PKGPR']])
 		fields.append(["Description: %s\n", ['DESCRIPTION']])
 		fields.append(["Section: %s\n", ['SECTION']])
 		fields.append(["Priority: %s\n", ['PRIORITY']])
#3 lore raw

Hello,

Quoted 4 lines · On Fri, 15 Feb 2008 18:07:39 +0100 Robert Schuster <[email protected]> wrote:

Hi,
while I like the general idea the proposed implemented is not so nice IMHO because
- it works only for ipk packaging (should be agnostic)

That's just a sample of implementation. As it is now, it seems that each format-specific package class needs to handle it on its own.

Quoted 2 lines

- for dependency resolution the original version values are
used

If you mean version under which this package will be dependent upon, then for sure yes, I didn't even consider that area. My usecase is to create "proxy" packages which would already fit into existing dependency chains - just exactly need to set PV to match external expectations.

Quoted 6 lines

IMHO this stuff should be done in packaging.bbclass instead.

Regards
Robert

[]

Signature · 2 lines
Best regards,
 Paul                          mailto:[email protected]