#2425 closed enhancement (fixed)
Implement dotted activity versions to sugar 0.92
Reported by: | godiard | Owned by: | erikos |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Sugar | Version: | Unspecified |
Severity: | Unspecified | Keywords: | |
Cc: | godiard | Distribution/OS: | Unspecified |
Bug Status: | New |
Description
When we are supporting old releases, we need to update activities but without changing the version number, because there are activities released with the next numbers.
For example, in sugar 0.84 we are using Browse 108, the last version of Browse is 112. We need to create a new activity, but can't be 109, because exists, and we don't want to inhibit future updates.
Another use case is we can need create a modified activity to a unique group, by example a deployment, then we can create the activity Browse 108.1-peru
Attachments (7)
Change History (17)
Changed 13 years ago by godiard
Changed 13 years ago by godiard
Changed 13 years ago by godiard
Changed 13 years ago by godiard
comment:1 Changed 13 years ago by godiard
comment:2 Changed 13 years ago by godiard
This ticket is related to http://dev.laptop.org/ticket/10379 where is implemented the change in Sugar 0.84
comment:3 Changed 13 years ago by sascha_silbe
- Resolution set to duplicate
- Status changed from new to closed
This is a dupe of #1701. It's hard to decide which one to close as both have files attached. I'm closing this one as #1701 has some discussion and is (much) older.
I'll add you to CC on #1701 and mention that you have files attached here. Please post any follow-up (including new or updated attachments) on #1701 and not this one.
comment:4 Changed 13 years ago by erikos
- Resolution duplicate deleted
- Status changed from closed to reopened
comment:5 Changed 13 years ago by erikos
- Keywords r! added
While reviewing I did edit the file and corrected the things I were not happy with. I have attached a new file for the NormalizedVersion. The following things I have changed:
I used the documentation format as described PEP-257 (PEP-8 says to use PEP-257).
I removed 'error_on_huge_major_num' as a class argument because it was not used.
I do check if the parsed activity version is a string. So we raise our error and do not trigger the one from the regular expression.
I reorganized the parsing of the string. I hope this helps in terms of clearer variable naming, method naming and general readability.
I removed 'pad_zeros_length' from '_parse_numdots' because from our calls it would never happen.
'_parts_to_str' does not have to be a @classmethod, and actually, I moved that one liner in the 'str' method as I think it is quite clear.
I made 'parts' public so we can use it in the comparisons. I have seen that you did use 'get_parts' but I think a public method does suggest that as a caller you would be interested in that, which I do not think is true here.
--- General Note ---:
Please use pylint and pep8, in sugar-jhbuild can be done as:
pep8 sugar-jhbuild/source/sugar-toolkit/src/sugar/bundle/bundleversion.py
pylint sugar-jhbuild/source/sugar-toolkit/src/sugar/bundle/bundleversion.py
pep8 is a Fedora package: http://koji.fedoraproject.org/koji/packageinfo?packageID=9499
I cleaned up the code for both.
I think that is pretty much it. Please let me know if the changes are for the better if you have comments other ideas etc.
comment:6 Changed 13 years ago by erikos
- Cc godiard added
Changed 13 years ago by erikos
toolkit: add class NormalizedVersion to parse and compare the new activity versions, change the bundlebuilder and activitybundle to use the new scheme
comment:7 Changed 13 years ago by erikos
- Keywords r? added; r! removed
- Owner changed from tomeu to erikos
- Status changed from reopened to assigned
comment:8 Changed 13 years ago by godiard
The changes are ok.
Reviewed-by: "Gonzalo Odiard" <godiard@…>
comment:9 Changed 13 years ago by erikos
- Keywords r? removed
- Resolution set to fixed
- Status changed from assigned to closed
Has been reviewed on the mailing list, pushed to master as:
Toolkit:
http://git.sugarlabs.org/sugar-toolkit/mainline/commit/c7a80a1e56e4f52e280b0b1d87643899726f6c36
Shell (activity list and bundleregistry):
http://git.sugarlabs.org/sugar/mainline/commit/49232e552248e48063970ca67455462d11220468
Activity updater:
http://git.sugarlabs.org/sugar/mainline/commit/468fe070e0a60e9690e89a0649919509c310974e
I have updated the feature page, too:
http://wiki.sugarlabs.org/go/Features/Dotted_Activity_Versions
The patches 0001-Add-class-to-parse-and-compare-the-bundles-version-n.patch and 0002-Changes-to-use-a-string-insted-of-a-int-in-the-activ.patch apply over sugar-toolkit.
The patch 0001-Changes-to-use-a-activity-version-with-a-dotted-sche.patch apply over sugar.
|TestCase|
You can download with Browse the file http://bugs.sugarlabs.org/attachment/ticket/2425/Calculate-34.1.xo and start from Journal. It must install the activity. In the List View from the Home, you must see the version 34.1
The changes in the updater will be added next.