Bug 8345 - [internalsolv] Install package(s) only after download of all needed packages. (old issue #116)
Summary: [internalsolv] Install package(s) only after download of all needed packages....
Status: ACCEPTED
Alias: None
Product: opkg
Classification: Yocto Project Subprojects
Component: opkg (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Undecided enhancement
Target Milestone: ---
Assignee: Alex Stewart
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2015-09-20 22:56 UTC by Alejandro del Castillo
Modified: 2021-07-08 15:29 UTC (History)
0 users

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alejandro del Castillo 2015-09-20 22:56:13 UTC
The behavior of install and upgrade process should be the same as in apt and yum: 
when you execute install or upgrade all dependencies are downloaded first and then if all needed packages are downloaded install/upgrade process proceeds.
Otherwise upgrade/install process could be interrupted if packages responsible for network managing will be upgraded.

Originally reported by KirGeNe, Dec 30, 2013
-----------------------------------------------------------------------------
#1 paul.betafive (Jan 1, 2014)
Annoyingly, the API function "opkg_install_package()" and the command-line handler "opkg_install_cmd()" do things completely differently. It looks like opkg_install_package does what you suggest. When I merge this code into a single handler for both entry points I'll make sure it does download everything first.

#2 peteru711 (Oct 15, 2014)
Is that the best idea for memory constrained embedded systems? With a large upgrade set, you could potentially need to download more packages than you can store temporarily.

In the case of networking interfering with the upgrade process, I have a solution. It comes in two parts. The first part is a patch to opkg to address  issue 104 . This patch will cause opkg to call prerm and postrm scripts with the "upgrade" argument. The second part is a change to OpenEmbedded update-rc.d.bbclass, which provides the prerm/postrm and preinst/postinst scripts. These scripts will take heed of the "upgrade" argument and restart the service only at the postinst stage when you are doing an upgrade. See http://lists.openembedded.org/pipermail/openembedded-core/2014-October/097983.html

The second part is specific to the distribution and the init system in use.

#3 paul.betafive (Oct 15, 2014)
My comment was from a few months back and doesn't quite reflect my recent thinking: after considering this more, it needs to be an option for opkg as different embedded systems may want to do things differently. We need to have an option to download each package as it is required and an option to download all required packages upfront before installation begins. The exact way this works can be decided after v0.3.0 is released.

#4 evensonbryan (Oct 16, 2014)
This is the behavior I want for my system; if all upgrades don't download successfully, then don't do an upgrade.  The workaround for me at this point has been to do "opkg upgrade --download-only" and verify that everything downloaded without error.  Could the fix be as simple as adding a command line options such as "--download-all" that essentially performs "opkg upgrade --download-only" first, verifies all downloads completed successfully and the performing "opkg upgrade" if all files downloaded successfully?
Comment 1 Alejandro del Castillo 2016-12-09 18:26:51 UTC
Fixed for libsolv on commit e9ca82bf9c06ea9956b317cca373ccbe8d353255