<?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>11301</bug_id>
          
          <creation_ts>2017-04-05 22:19:50 +0000</creation_ts>
          <short_desc>opkg download tries to use a relative path from the feed when saving the file locally</short_desc>
          <delta_ts>2020-07-15 14:15:29 +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>0.4.2</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Undecided</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Paul Spangler">paul.spangler</reporter>
          <assigned_to name="Alejandro del Castillo">alejandro.delcastillo</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>72115</commentid>
    <comment_count>0</comment_count>
      <attachid>3689</attachid>
    <who name="Paul Spangler">paul.spangler</who>
    <bug_when>2017-04-05 22:19:50 +0000</bug_when>
    <thetext>Created attachment 3689
Example reproduction feed

Downloading a package from a feed that uses a directory structure for its packages results in opkg attempting to use the same directory structure locally. For example, the attached Packages file contains a single package with the following attribute:

Filename: ../packages/empty_1.0.0-0_x64.ipk

opkg is able to install from this feed successfully, but when downloading the package with `opkg download empty` it attempts to save the file using the same relative path as the Filename attribute instead of the current directory.

Expectation (apt-get)
---------------------
$ apt-get -v
apt 1.2.19 (amd64)
Supported modules:
*Ver: Standard .deb
*Pkg:  Debian dpkg interface (Priority 30)
 Pkg:  Debian APT solver interface (Priority -1000)
 S.L: &apos;deb&apos; Debian binary tree
 S.L: &apos;deb-src&apos; Debian source tree
 Idx: Debian Source Index
 Idx: Debian Package Index
 Idx: Debian Translation Index
 Idx: Debian dpkg status file
 Idx: Debian deb file
 Idx: Debian dsc file
 Idx: Debian control file
 Idx: EDSP scenario file
$ apt-get download --allow-unauthenticated -o Acquire::ForceHash=md5sum empty
WARNING: The following packages cannot be authenticated!
  empty:none
Authentication warning overridden.
Get:1 &lt;server&gt;/empty-package/feed  empty 1.0.0-0 [586 B]
Fetched 586 B in 0s (14.1 kB/s)
$ ls *.ipk 
empty_1.0.0-0_none.ipk

Actual Result (opkg)
--------------------
# opkg -v
opkg version 0.3.4 (libsolv 0.6.24)
# opkg download empty
Collected errors:
 * file_copy: unable to open `./../packages/empty_1.0.0-0_x64.ipk&apos;: No such file or directory.
 * opkg_download_cmd: Failed to download empty.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87475</commentid>
    <comment_count>1</comment_count>
    <who name="Melanie">melanie</who>
    <bug_when>2020-06-14 02:27:55 +0000</bug_when>
    <thetext>Just want to mention here that this is still an issue with the latest version:

# opkg --version
opkg version 0.4.2

# opkg download kmscube
Downloading http://archive.raspbian.org/raspbian/pool/main/k/kmscube/kmscube_0.0.0~git20170617-2_armhf.deb.
Collected errors:
 * file_copy: unable to open `./pool/main/k/kmscube/kmscube_0.0.0~git20170617-2_armhf.deb&apos;: No such file or directory.
 * opkg_download_cmd: Failed to download kmscube.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87765</commentid>
    <comment_count>2</comment_count>
    <who name="Alejandro del Castillo">alejandro.delcastillo</who>
    <bug_when>2020-07-15 14:15:29 +0000</bug_when>
    <thetext>Fixed by Alex Stewart on e190d4bbc37d01a299cbb66d5d13f82e1dffbb3b</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>3689</attachid>
            <date>2017-04-05 22:19:50 +0000</date>
            <delta_ts>2017-04-05 22:19:50 +0000</delta_ts>
            <desc>Example reproduction feed</desc>
            <filename>feed.zip</filename>
            <type>application/x-zip-compressed</type>
            <size>1907</size>
            <attacher name="Paul Spangler">paul.spangler</attacher>
            
              <data encoding="base64">UEsDBBQAAAAAAKJ+hUoAAAAAAAAAAAAAAAATAAAAZW1wdHktcGFja2FnZS9mZWVkL1BLAwQUAAAA
CAAsgYVKbHOp0wIBAABUAQAAGwAAAGVtcHR5LXBhY2thZ2UvZmVlZC9QYWNrYWdlcy1PS27CMBDd
W/IdfAGCA0kAq6qEhCp1AUKKYItcZ9JOcRzLdtSmV+uiR+oVOqQsvPCb9/39/tkG84YJTBoCKPFZ
FZztIJqAPmHvlDi5hMlCI46hfyeayImA0Vs9HnRHkv0ojtpc9SssOHtCC26Cs2zu/+E4h86n8ZJn
MpMzeaGMDP2Vs2cXk7bkPavxiySSs/2urIdOiaKAdbVqpCwhbzemaptqBTkUrdksF8u8IqZGl+hB
UOKgb121FTfHMHTgUhQPj5zdiykxNaB/wD5gGpWgZNfo0HBW06hp6dZ7i2ayEnXfpg8dgM5TtXJN
kacI4YwRXywhI0TOzhDipL1v44yzP1BLAwQUAAAAAAAugYVK9KzB6R0BAAAdAQAAHgAAAGVtcHR5
LXBhY2thZ2UvZmVlZC9QYWNrYWdlcy5neh+LCAgCXeVYBABQYWNrYWdlcwAlT0tuwjAQ3VvyHXwB
QgIhQFRVQkKVugAhRbBFrjNppziONXbUplfrokfqFRiShRd+877/v387Mh8YwcSeoFTfRS7FHoIh
9BE7V6qzixgt1OpE3SfTVMYEDN7q4ahblhwGddLmpt9hIcULWnAjnCRzP8FhDq2PwzVL0iSdpVfO
SNDfpHh1IWrL3rMKf1iSSnHYr6q+LVWew6ZY12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