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.