1. 29 Apr, 2021 1 commit
  2. 28 Apr, 2021 1 commit
    • Jakub Ružička's avatar
      build-dep: support templates, srcpkgs, archives · 278069e2
      Jakub Ružička authored
      A comprehensive refactor of build-dep and related pkgstyle functionality
      to install or list (-l/--list) build deps from templates as well as
      from source packages.
      
      The new default approach of parsing build deps from templates has
      following advantages:
      
      * works directly on project source without archive/srcpkg build
      * requires less tools to work
      * is faster
      
      Alternatively, -s/--srcpkg makes apkg parse build deps from source
      package which is slower but more robust in some cases.
      
      Build deps can also be extracted from archive containing proper distro/
      files with -a/--archive option in both template and --srcpkg mode.
      
      -u/--upstream option uses upstream archive (get-archive) to get build
      deps for maximum convenience.
      
      Fixes: #34
      278069e2
  3. 26 Apr, 2021 1 commit
  4. 23 Apr, 2021 2 commits
  5. 22 Apr, 2021 2 commits
  6. 14 Apr, 2021 4 commits
  7. 13 Apr, 2021 1 commit
  8. 06 Apr, 2021 2 commits
  9. 23 Mar, 2021 3 commits
  10. 22 Mar, 2021 2 commits
    • Jakub Ružička's avatar
      refactor: get rid of compat.py35path · 878ef8f6
      Jakub Ružička authored
      shutil and os modules in python 3.5 doesn't accept pathlib.Path (yet).
      
      compat.py35path() wrapper was used to mark code which requires extra
      str() conversion on Python <= 3.5.
      
      Introduce new apkg.util.shutil35 wrapper module for selected shutil and
      os functions in order to address this without polluting code with
      redundant py35path/str conversions.
      
      apkg.compat was removed in favor of new shutil35 which can be easily
      removed in the future once Python 3.5 support is dropped.
      
      Fixes: #36
      878ef8f6
    • Jakub Ružička's avatar
      refactor: os.makedirs -> Path.mkdir · b6dd5863
      Jakub Ružička authored
      get rid of py35path and "import os" in the process.
      b6dd5863
  11. 18 Mar, 2021 1 commit
    • Jakub Ružička's avatar
      refactor: unified input files handling · 1065779e
      Jakub Ružička authored
      All commands's CLI was refactored to use new consistent handling of
      input files which allows selecting multiple input files as opposed to
      single archive/srcpkg:
      
      input files as arguments:
      
          apkg srcpkg -a foo.1.2.tgz foo.1.2.tgz.asc
      
      input files listed in file(s) including stdin which allows piping:
      
          apkg make-archive | apkg srcpkg -aF - | apkg build -sF -
      
      Fixes: #30
      Fixes: #31
      1065779e
  12. 10 Mar, 2021 4 commits
    • Jakub Ružička's avatar
      pkgstyle.rpm: support openSUSE · ff742744
      Jakub Ružička authored
      * support openSUSE's zypper package manager
      * provide manual parsing of BuildRequires from .src.rpm
        because SUSE doesn't have builddep command (╯°□°)╯︵ ┻━┻
      ff742744
    • Jakub Ružička's avatar
      build: use isolated build by default · 636a88fc
      Jakub Ružička authored
      It's dangerous for new users to use direct build by default as it
      modifies host system and requires build deps to be installed
      system-wide. This is useful especially in VMs and containers (CI).
      
      Isolated build is safer so make it a default with -H/--host-build
      option to enable direct host build replacing --isolated option.
      
      Adjust arch pkgstyle to work with new default CI invocation even though
      build deps installation and direct host build aren't supported on arch:
      
          apkg build -Hi
      
      apkg will print warnings for -H/--host-build (not supported on arch in
      general) and -i/--install-deps (not needed on arch) but it's going to
      work regardless.
      
          apkg build-dep
      
      on arch will result in DistroNotSupported error (exit code 44) as it
      should.
      
      Fixes: #27
      636a88fc
    • Jakub Ružička's avatar
      build-dep: add builddep alias · a07b28aa
      Jakub Ružička authored
      apkg is using dash-separated-command-names for the sake of readability
      but both dnf and apt have builddep command without the dash.
      
      Add builddep alias for build-dep so that everyone's happy :)
      
      Related: #29
      a07b28aa
    • Jakub Ružička's avatar
      cli: handle invalid command · 10f85f92
      Jakub Ružička authored
      print nice warning instead of showing stack trace when invalid apkg
      command was supplied.
      
      Fixes: #29
      10f85f92
  13. 09 Mar, 2021 2 commits
    • Jakub Ružička's avatar
      refactor: address prospector warnings · 7db52591
      Jakub Ružička authored
      prospector aims at running multiple quality of code tools with
      reasonable defaults.
      
      I went through all 50 prospector warnings (those disabled in apkg
      pylint/flake config are still shown by prospector) and reduced their
      number to 21.
      
      Remaining warnings are mostly about complexity, too many locals, etc.
      7db52591
    • Jakub Ružička's avatar
      refactor: use lazy log formatting everywhere · 90f1a05e
      Jakub Ružička authored
      advantages:
      
      * no pylint warnings
      * consistent invocation across codebase
      * slightly faster as formatting is done on-demand
      90f1a05e
  14. 08 Mar, 2021 7 commits
  15. 24 Feb, 2021 1 commit
    • Jakub Ružička's avatar
      refactor: new -O/--result-dir option · 656b20e4
      Jakub Ružička authored
      Following apkg commands got support for -O/--result-dir option to
      override directory where apkg puts resulting files:
      
      * get-archive
      * make-archive
      * srcpkg
      * build
      
      When result is cached elsewhere, it's automatically copied to
      --result-dir.
      
      This change required refactoring across apkg commands:
      
      * all commands and scripts now return list of all output files
      * all output files are cached
      * make commands and their options consistent with each other and --help
      * new apkg.lib.common module to contain common/shared code
      
      Related: #9
      656b20e4
  16. 19 Feb, 2021 1 commit
    • Jakub Ružička's avatar
      srcpkg: new --render-template option · c4a651d4
      Jakub Ružička authored
      --render-template makes srcpkg render source package template only
      without building anything using distro-specific tools.
      
      This can be used to for example to render individual distro/pkg/*
      templates for manual processing without depending on target distro.
      
      For example
      
          apkg srcpkg --render-template --distro arch
      
      will render current distro/pkg/arch template into
      pkg/build/srcpkgs/arch/$NVR and print path to resulting dir.
      
      Related: #9
      c4a651d4
  17. 18 Feb, 2021 2 commits
    • Jakub Ružička's avatar
      implement upstream workflow · 7f82b3af
      Jakub Ružička authored
      apkg srcpkg/build now use distro/ input files from tarball when
      -u/--upstream is specified.
      
      This allows building of (source) packages from an archive containing
      distro/ dir without the need for any local project files:
      
          apkg build --upstream --archive banana-1.2.3.tar.gz
      
      Once upstream tarballs include apkg distro/ files, building latest
      upstream package from within a project repo should be as easy as:
      
          apkg build -u
      
      Fixes: #14
      7f82b3af
    • Jakub Ružička's avatar
      upstream version auto-detection · d202f74d
      Jakub Ružička authored
      This patch implements upstream version detection using two methods:
      
      1) from HTML listing if upstream.archive_url is set (default)
      2) using custom upstream.version_script if set
      
      Optional htmllistparse module is required in order for 1) to work.
      
      get-archive was updated to use the new version detection.
      
      This patch also includes related quality of life changes:
      
      * upstream-related config options moved to new [upstream] section
      * apkg config is now exposed using Project.config_get() which allows
        convenient access from code and templates, i.e.:
        project.config_get('upstream.archive_url')
      * Project class has new upstream-related methods
      * docs updated to reflect new features and config changes
      d202f74d
  18. 03 Feb, 2021 1 commit
    • Jakub Ružička's avatar
      new apkg documentation · 765c8619
      Jakub Ružička authored
        d8888b.  .d88b.   .o88b. .d8888.
        88  `8D .8P  Y8. d8P  Y8 88'  YP
        88   88 88    88 8P      `8bo.
        88   88 88    88 8b        `Y8b.
        88  .8D `8b  d8' Y8b  d8 db   8D
        Y8888D'  `Y88P'   `Y88P' `8888Y'
      765c8619
  19. 28 Jan, 2021 2 commits
    • Jakub Ružička's avatar
      log: improve printing of command outputs · 652a4a55
      Jakub Ružička authored
      Don't redirect stdout/stderr (direct run() mode) by default
      for important commands for building (source) packages.
      
      This means normal output is shown in terminal when packaging commands
      are run as if user ran them manually.
      
      Output can be supressed with --brief or --quiet.
      
      Note that direct mode is never used for make_archive_script because
      its output must be redirected in order to be parsed.
      652a4a55
    • Jakub Ružička's avatar
      cache: automagically cache and reuse output files · 6a11c37f
      Jakub Ružička authored
      Following commands got support for automating cache and reuse of
      produced output files:
      
      * make-archive
      * get-archive
      * srcpkg
      * build
      
      Cache uses checksum of current project state as a key and also stores
      and validates cached files' checksums. Currently the project checksum is
      obtained using git magicks so the cache is only enabled for projects
      using git.
      
      Cache lives in pkg/.cache.json and it's updated automatically when
      a new archive/srcpkg/package is created or when invalid cache entry is
      requested.
      
      Caching can be disabled using new --no-cache option.
      
      Cache can be cleared by removing pkg/.cache.json file.
      
      Self test on make-archive is included.
      6a11c37f