OPKG - Enhancement to the "downgrade" functionality - Issue #112

457 views
Skip to first unread message

Paolo Cipriani

unread,
Nov 12, 2013, 5:38:02 PM11/12/13
to opkg-...@googlegroups.com
Below is described a ideal methodology of downgrade.

Suppose, to make things easier, that we are working with only one package, for example "testpackage_0.0.1_arm.opk",  installed in the system (opkg install testpackage_0.0.1_arm.opk).

After some time, a newer version of that package (testpackage_0.0.2_arm.opk) is available
 in the repository. It is downloaded into the cache with the command opkg upgrade --download-only
and then installed with the command "opkg upgrade"
.

After the upgrade, another update
(testpackage_0.0.3_arm.opk)
is available in the repository and it is installed in the system as for the previous package.

Now we have the version 0.0.3 of the package testpackage installed in the system.

Suppose now that we discover a bug in the software installed by testpackage_0.0.3_arm.opk and we need to rollback to the previous version: it would be very useful if the command opkg install testpackage --force-downgrade offered this function, installing the previous package, that is testpackage_0.0.2_arm.opk.

At this time we have in the local opkg cache three packages:
  • testpackage_0.0.1_arm.opk
  • testpackage_0.0.2_arm.opk
  • testpackage_0.0.3_arm.opk
When opkg downgrades to 0.0.2 version it should also tag the testpackage_0.0.3_arm.opk package "faulty": this is needed in order to ignore that version of the package in case of opkg upgrade command is executed, avoiding the re-installation of the bug-affected package.

When the bug-free version of the package testpackage_0.0.3_arm.opk is available in the repository (opkg can discover it because of a different MD5 respect to tho one in cache, the datetime is more recent, or both...or similar strategies) it can be downloaded and installed... so the faulty version disappears.

I think this functionality can be very useful to the ones that want to use opkg to automate software upgrade/downgrade on embedded systems, putting opkg one step ahead respect to  other package managers.

Best regards,
Paolo

Paul Barker

unread,
Nov 20, 2013, 4:54:36 AM11/20/13
to opkg-devel
Thanks Paolo,

This was filed as bug 112 on the issue tracker but I asked it to be
posted here incase anyone else wants to comment and join in
discussion.

My thought is that it would be putting too much policy into opkg
itself and we should instead be providing features which let this sort
of behaviour be scripted around opkg. Other users may have different
ideas of how they want their systems to operate.

I think adding a method to revert to the previously installed version
of a package would be helpful. Maybe "opkg install x --revert" or
"opkg revert x". The previously installed version may have a higher or
lower version number, the idea would be to undo the latest upgrade or
downgrade to package 'x'.

I know we can currently 'hold' a package so no updates are installed
but I do like the idea of being able to tag a given version as
'faulty' so that it isn't installed but subsequent updates are.

These enhancements aren't really current priorities to me but I'd be
happy to accept patches if anyone else wants to look at them.

Many thanks,

--
Paul Barker

Email: pa...@paulbarker.me.uk
http://www.paulbarker.me.uk
Reply all
Reply to author
Forward
0 new messages