dskvr / opkg

Automatically exported from code.google.com/p/opkg
0 stars 0 forks source link

-force-reinstall for crucial package makes opkg unusable and install step fails #71

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1a. opkg install -force-reinstall libc6
1b. opkg install -force-reinstall opkg
1c. opkg install -force-reinstall libopkg0
.. maybe more

What is the expected output? What do you see instead?

Files from old package are kept long enough to perform "install" step.

What version of the product are you using? On what operating system?

Opkg newer than r538

I agree that r538 makes opkg code easier to read and it really fixed Issue #51, 
but this kind of behavior is quite dangerous for users not knowing which 
pacakges are mandatory to keep opkg working. I'm not 100% sure, but IIRC this 
worked ok before r538 (probably only reason why was -force-reinstall handled as 
special case).

Original issue reported on code.google.com by Martin.J...@gmail.com on 17 Dec 2010 at 8:23

GoogleCodeExporter commented 8 years ago
Issue 66 has been merged into this issue.

Original comment by paul.betafive on 18 Sep 2013 at 1:10

GoogleCodeExporter commented 8 years ago
Forcing a reinstall shouldn't brick the system. I know this was reported a 
while ago, do you know if this is still an issue? I'll add it to my todo list 
to look into.

Original comment by paul.betafive on 18 Sep 2013 at 1:12

GoogleCodeExporter commented 8 years ago

Original comment by paul.betafive on 18 Sep 2013 at 1:14

GoogleCodeExporter commented 8 years ago
I have a potential idea for solving this. When reinstalling with 
"--force-reinstall", we could add a suffix to the version of the package to be 
installed, such as ";__r1" for the first reinstall, ";__r2" for the second, 
etc. This suffix should be safe from clashes with the ending of any sensible 
version string.

So if we run "opkg install --force-reinstall a" and a is installed at version 
1.0, we would read the package control fields for a using pkg_init_from_file(), 
modify the version string to append or increment the reinstall suffix and then 
insert it into the pkg hash table using hash_insert_pkg(). This would 
effectively be a modified flow of opkg_prepare_url_for_install().

With this behaviour the version strings wouldn't actually match and so the 
reinstall would be seen as an upgrade. The trick would simply be to hide the 
reinstall suffix whenever a version string is printed for the user.

Original comment by paul.betafive on 10 Feb 2014 at 9:19

GoogleCodeExporter commented 8 years ago
I've taken a different approach to that listed in the previous comment but this 
is now fixed and confirmed with test cases in both the opkg-0.2.x and master 
branches.

Original comment by paul.betafive on 1 Mar 2014 at 3:10

GoogleCodeExporter commented 8 years ago
Thank you Paul!

Original comment by Martin.J...@gmail.com on 1 Mar 2014 at 3:43