<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>8345</bug_id>
          
          <creation_ts>2015-09-20 22:56:13 +0000</creation_ts>
          <short_desc>[internalsolv] Install package(s) only after download of all needed packages. (old issue #116)</short_desc>
          <delta_ts>2021-07-08 15:29:11 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>6</classification_id>
          <classification>Yocto Project Subprojects</classification>
          <product>opkg</product>
          <component>opkg</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>ACCEPTED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Undecided</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alejandro del Castillo">alejandro.delcastillo</reporter>
          <assigned_to name="Alex Stewart">alex.stewart</assigned_to>
          
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>54323</commentid>
    <comment_count>0</comment_count>
    <who name="Alejandro del Castillo">alejandro.delcastillo</who>
    <bug_when>2015-09-20 22:56:13 +0000</bug_when>
    <thetext>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 &quot;opkg_install_package()&quot; and the command-line handler &quot;opkg_install_cmd()&quot; 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&apos;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 &quot;upgrade&quot; 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 &quot;upgrade&quot; 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&apos;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&apos;t download successfully, then don&apos;t do an upgrade.  The workaround for me at this point has been to do &quot;opkg upgrade --download-only&quot; and verify that everything downloaded without error.  Could the fix be as simple as adding a command line options such as &quot;--download-all&quot; that essentially performs &quot;opkg upgrade --download-only&quot; first, verifies all downloads completed successfully and the performing &quot;opkg upgrade&quot; if all files downloaded successfully?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68998</commentid>
    <comment_count>1</comment_count>
    <who name="Alejandro del Castillo">alejandro.delcastillo</who>
    <bug_when>2016-12-09 18:26:51 +0000</bug_when>
    <thetext>Fixed for libsolv on commit e9ca82bf9c06ea9956b317cca373ccbe8d353255</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>