Skip to content
Snippets Groups Projects
  1. Jan 15, 2025
  2. Dec 19, 2024
    • Newbyte's avatar
      pmb.helpers.http: Simplify retrieve_json() (MR 2490) · c8bd5abd
      Newbyte authored
      The parameters of this function were needlessly complicated. While I
      understand the intent of trying to replicate the API of retrieve()
      without duplicating the parameter list, in practice this feels like
      reducing duplication to a fault to me. This is due to that the third
      parameter, <allow_404>, doesn't make sense in the context of
      retrieve_json() as it would raise an exception[1] if retrieve() returns
      None (which is the effect of <allow_404> when a 404 occurs), thus merely
      changing the exception that gets raised to a less descriptive one
      instead of actually behaving like retrieve() would with that parameter
      set to True.
      
      With <allow_404> eliminated, there's just two parameters left, and I
      don't think duplicating those is a big deal. So make the function easier
      to read and annotate by getting rid of the args/kwargs logic.
      
       [1]: json.loads() raises an exception if its first argument is None
      c8bd5abd
  3. Nov 14, 2024
  4. Oct 27, 2024
    • Oliver Smith's avatar
      pmb.helpers.repo.download: proper error for 404 (MR 2462) · 7269d05b
      Oliver Smith authored
      Flush the progress bar displayed by the function before logging a
      warning message for 404 not found responses from the server. Without
      flushing, this message gets lost.
      
      In addition to the warning, display a NOTE and ERROR at the end to
      explain what went wrong:
      
        [20:16:50] Update package index for x86_64 (4 file(s))
        [20:16:51] WARNING: file not found: http://mirror.postmarketos.org/postmarketos_get_404_test/edge/main/x86_64/APKINDEX.tar.gz
        [20:16:51] NOTE: check the [mirrors] section in 'pmbootstrap config'
        [20:16:51] ERROR: getting APKINDEX from binary package mirror failed!
      
      Without handling this properly, pmbootstrap would fail slightly later
      with a much less useful error:
      
        [15:14:28] ERROR: expected str, bytes or os.PathLike object, not NoneType
      
      Fixes: pmbootstrap issue 2424
      7269d05b
  5. Jun 23, 2024
  6. May 14, 2024
  7. Jan 22, 2023
  8. Jan 02, 2022
  9. Jun 27, 2021
  10. Jun 06, 2021
  11. Jan 07, 2021
  12. May 09, 2020
  13. Feb 24, 2020
    • Oliver Smith's avatar
      Cosmetic: use SPDX license header (!1877) · f21c216a
      Oliver Smith authored and Alexey Minnekhanov's avatar Alexey Minnekhanov committed
      While at it, also remove unnecessary "#!/usr/bin/env python3" in files
      that only get imported, and adjust other empty/comment lines in the
      beginnings of the files for consistency.
      
      This makes files easier to read, and makes the pmbootstrap codebase more
      consistent with the build.postmarketos.org codebase.
      f21c216a
  14. Feb 15, 2020
  15. Jan 06, 2020
  16. Jan 02, 2019
  17. Dec 11, 2018
    • Oliver Smith's avatar
      Make APKINDEX downloads returning 404 non-fatal (!1726) · 5102d480
      Oliver Smith authored
      Do not fail when an APKINDEX can not be downloaded, print a WARNING
      instead. This matches, what apk does. Add a new allow_404 parameter to
      pmb.helpers.http.download(), and use it in pmb.helpers.repo.update()
      for downloading APKINDEX files. Cache the APKINDEX URLs that gave a 404
      for the session, so we do not attempt to download these again.
      
      This is needed for the new binary repository: the initial build is done
      without existing APKINDEX files, so we must not fail in that case.
      5102d480
    • Oliver Smith's avatar
      Cosmetic: pmb.helpers.http: describe parameters (!1726) · a874baa0
      Oliver Smith authored
      Describe all parameters of pmb.helpers.download().
      a874baa0
  18. Jan 04, 2018
  19. Nov 19, 2017
    • Oliver Smith's avatar
      Close #871: Enable binary repository (#887) · a7b881e4
      Oliver Smith authored
      * add my own build key
      * enable the repo in the config
      * update the README file
      * Adjust testcase, that validates the keys and enable it in testcases_fast.sh
      * Only save/load keys to/from the config file, which we ask for during
        'pmbootstrap init', so the binary repo gets used even if a config file
        already exists (this also removes a workaround, that deletes the work
        folder path from the config dictionary before writing it)
      * Download missing APKINDEX.tar.gz files with Python code, before
        attempting to build packages (so we know which ones aleady exist in
        the binary packages repository)
      * Consider APKINDEX files older than 4 hours as outdated and download
        them again (also in Python code)
      * Provide 'pmbootstrap update' to force-update the APKINDEX files
      * Travis: more logging output on failure
      * Only allow keys from config_keys to be used by "pmbootstrap config"
      a7b881e4
  20. Jun 06, 2017
  21. Jun 04, 2017
  22. May 26, 2017
Loading