getsolus / ypkg

Modern, declarative, structured build format
https://getsol.us
GNU General Public License v3.0
22 stars 11 forks source link

Allow for renaming of simple source files #29

Closed JacekJagosz closed 2 years ago

JacekJagosz commented 2 years ago

This commit allows for renaming of source files by adding #putNewNameHere.tar.gz at the end of the source URL. This is useful when multiple of your sources have the same filename, like rocm I am packaging. There is a complimentary solbuild patch for the same functionality.

JacekJagosz commented 2 years ago

Edit: Turns out solbuild wasn't building with this patched ypkg This patch works for executing ypkg by itself, but in solbuild it can't find files that were fetched and renamed in Solbuild. So this check is failing for some reason: https://github.com/getsolus/ypkg/blob/master/ypkg2/main.py#L244

 ✚  Configuring container networking
 ✚  Exposing source to container /var/cache/solbuild/unstable-x86_64/rocm-opencl/union/home/build/YPKG/sources/test1.tar.gz
 ✚  Exposing ccache to build /var/cache/solbuild/unstable-x86_64/rocm-opencl/union/home/build/.ccache
 ✚  Exposing sccache to build /var/cache/solbuild/unstable-x86_64/rocm-opencl/union/home/build/.cache/sccache
 ✚  Copying host asset /etc/resolv.conf
 ✚  Copying host asset /etc/eopkg/eopkg.conf
 ⮞  Now starting build of package
[Info] Building rocm-opencl-5.1.0
[Source] Fetching: https://github.com/ROCm-Developer-Tools/ROCclr/archive/refs/tags/rocm-5.1.0.tar.gz#test1.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: github.com
[Source] Failed to fetch https://github.com/ROCm-Developer-Tools/ROCclr/archive/refs/tags/rocm-5.1.0.tar.gz#test1.tar.gz
Error follows: Command 'curl -o "/home/build/YPKG/sources/rocm-5.1.0.tar.gz#test1.tar.gz" --url "https://github.com/ROCm-Developer-Tools/ROCclr/archive/refs/tags/rocm-5.1.0.tar.gz#test1.tar.gz" --location' returned non-zero exit status 6
[Source] Cannot continue without sources
JacekJagosz commented 2 years ago

Verified it now works, so ready to be merged ;)

joebonrichie commented 2 years ago

Looks okay to me, my only concern was that if '#' in uri seemed quite broad. AFAIK # is reserved for URI fragment support and otherwise gets encoded to %23 so it should be fine.