Commit Graph

354 Commits

Author SHA1 Message Date
André Roth 27c15680e8 Merge pull request #1445 from silkeh/fix-db-references
Remove corrupt package references in `db recover`
2025-05-01 10:27:42 +02:00
Silke Hofstra d8a4a28259 Remove corrupt package references in db recover
When aptly crashes it is possible to get a corrupt database with a dangling key reference.
This results in an error with 'key not found', eg:

    ERROR: unable to load package Pall example-package 1.2.3 778cf6f877bf6e2d: key not found

This change makes `db recover` fix this situation by removing the dangling references.
2025-04-30 12:21:34 +02:00
André Roth f7057a9517 go1.24: fix lint, unit and system tests
- development env: base on debian trixie with go1.24
- lint: run with default config
- fix lint errors
- fix unit tests
- fix system test
2025-04-26 13:29:50 +02:00
André Roth e028db585f fix man page 2024-12-21 22:32:50 +01:00
André Roth c6bb5f76f7 cmd filter: add comment and cleanup 2024-12-21 11:37:15 +01:00
Gordian Schoenherr 9691b0f518 Refactor query reading from file, update docs
Add support for @file syntax in more places.
2024-12-19 15:02:10 +09:00
Christof Warlich 005114839a Generalize to read filter from file or stdin. 2024-12-13 11:24:54 +09:00
Christof Warlich a5d322252a Allow reading package query for -filter option from a file. 2024-12-13 11:24:47 +09:00
André Roth 93650efddb Merge pull request #1404 from schoenherrg/fix/with-sources-ignored
Fix `-with-sources` not fetching differently named source packages
2024-12-11 13:01:30 +01:00
André Roth 4e566b4692 fix tests and lint 2024-12-11 12:02:52 +01:00
André Roth 0e0189f0eb use yaml config file 2024-12-11 12:02:52 +01:00
André Roth 83f7c869f0 doc: improve cmd usage arguments 2024-12-11 10:40:44 +01:00
Gordian Schoenherr 3b785e4165 Refactor Filter options into a struct
It was already a lot of options for one method and I am going to add
another one in the next commit.
2024-12-09 13:17:41 +09:00
André Roth 320307f504 graph: do not remove tempfile when opening in viewer 2024-12-04 17:30:27 +01:00
Mauro Regli 1357d246d8 rename addon files to skel files 2024-11-17 14:09:37 +01:00
Mauro Regli c75c2c7594 pass down addonpath from api and cmd context 2024-11-17 14:09:37 +01:00
André Roth 147955c682 Merge pull request #1390 from iofq/master
Make HTTP server wait for tasks before shutdown
2024-11-10 15:38:47 +01:00
iofq 840b76228a add shutdown context unit test 2024-11-09 15:34:35 -06:00
iofq 8436001d5b Make HTTP server wait for tasks before shutdown 2024-11-08 14:06:23 -06:00
André Roth eafec74c29 allow to exclude provided packages from list.Search 2024-11-04 17:02:54 +01:00
André Roth 0ceff44421 improve log 2024-11-01 20:01:45 +01:00
André Roth f79423a4ee update swagger documentation 2024-11-01 17:48:03 +01:00
Christoph Fiehe c9309c926c Command to replace the whole staged source list added.
Signed-off-by: Christoph Fiehe <c.fiehe@eurodata.de>
2024-11-01 17:48:03 +01:00
Christoph Fiehe 21013a8317 Command descriptions fixed.
Signed-off-by: Christoph Fiehe <c.fiehe@eurodata.de>
2024-11-01 17:48:03 +01:00
Christoph Fiehe f8f28e9554 Fixing tests and fix cleanup.
Signed-off-by: Christoph Fiehe <c.fiehe@eurodata.de>
2024-10-22 16:58:15 +02:00
Christoph Fiehe ac5ecf946d Cleanup improved and code redundant code removed.
Signed-off-by: Christoph Fiehe <c.fiehe@eurodata.de>
2024-10-22 16:58:15 +02:00
Christoph Fiehe d87d8bac92 Fix test cases.
Signed-off-by: Christoph Fiehe <c.fiehe@eurodata.de>
2024-10-22 16:58:15 +02:00
Christoph Fiehe 3057aed571 Test cases added.
Signed-off-by: Christoph Fiehe <c.fiehe@eurodata.de>
2024-10-22 16:58:15 +02:00
Christoph Fiehe 14c29ff912 Fixing tests.
Signed-off-by: Christoph Fiehe <c.fiehe@eurodata.de>
2024-10-22 16:58:15 +02:00
Christoph Fiehe bd64232eb6 Allow management of components
This commit allows to add, remove and update components of published repositories without the need to recreate them.

Signed-off-by: Christoph Fiehe <c.fiehe@eurodata.de>
2024-10-22 16:58:15 +02:00
André Roth 861260198a publish: persist multidist flag 2024-10-08 22:28:12 +02:00
Christoph Fiehe 4195ad90bc Allow to add a new component to a published repo
This commit modifies the behavior of the publish switch method in the way, that also new components can be added to an already published repository. It is no longer necessary to drop and recreate the whole publish.

Signed-off-by: Christoph Fiehe <c.fiehe@eurodata.de>
2024-09-24 15:43:27 +02:00
André Roth 52faf78324 use /usr/local/etc/aptly.conf config file
fixes #1108
2024-09-24 10:14:39 +02:00
André Roth 32a3943821 support ~ in rootDir as home directory 2024-09-24 10:14:39 +02:00
André Roth a93ccd4100 fix tests 2024-07-03 18:08:58 +02:00
André Roth c1f7e5fe96 handle GpgDisableVerify and ignore-signatures consistently
and be less verbose
2024-07-03 18:08:58 +02:00
André Roth d16110068c allow not signed mirrors without InRelease file 2024-07-03 18:08:58 +02:00
André Roth 1a3cfea348 replace io/ioutil
fixes golangci-lint errors
2024-06-17 11:51:18 +02:00
Ryan Gonzalez 810df17009 Clean up temporary files when mirroring
Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
2024-06-17 11:51:18 +02:00
Ryan Gonzalez 19255debb9 Reduce required usage of LocalPackagePool
Several sections of the code *required* a LocalPackagePool, but they
could still perform their operations with a standard PackagePool.

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
2024-06-17 11:51:18 +02:00
Noa Resare b4cd86aa14 Introduce option multi-dist to the publish commands
This change makes it possible to publish multiple distributions
with packages named the same but with different content by changing
structure of the generated pool hierarchy. The option not enabled
by default as this changes the structure of the output which could
break the expectations of other tools.
2024-06-15 11:27:26 +02:00
Ryan Gonzalez 8d09c202db Skip loading reflists when listing published repos
The output doesn't actually depend on the reflists, and loading them for
every published repo starts to take substantial time and memory.

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
2024-04-24 17:35:44 +02:00
André Roth e61a4dd53c fix golangci-lint errors 2024-02-06 20:49:35 +01:00
Ryan Gonzalez 11deb9425b Shut down cleanly when 'api serve' is interrupted
This will properly close the db and, more particularly, flush out any
profile files being written. Otherwise, they can end up empty or
truncated.

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
2023-10-24 15:35:41 +02:00
Mauro Regli ae61706a34 Fix: Implement golangci-lint suggestions 2023-09-21 11:25:18 +02:00
Markus Muellner 352f4e8772 update golangci-lint and replace deprecated calls to io/ioutil 2022-12-12 10:21:39 +01:00
Steven Stone a59cad6f20 Enable the ability to pass in a custom codename
While testing out Aptly, the `apt-get` client complains with the following error, since the `codename` was switched from the InRelease files that are baked out by Aptly:

```
E: Repository 'http://debianrepo.example.com/bionic testing InRelease' changed its 'Codename' value from '' to 'testing'
```
2022-08-29 15:54:29 +02:00
Sjoerd Simons f61514edaf Allow disabling bzip2 compression for index files
Using bzip2 generates smaller index files (roughly 20% smaller Packages
files) but it comes with a big performance penalty.  When publishing a
debian mirror snapshot (amd64, arm64, armhf, source) without contents
skipping bzip speeds things up around 1.8 times.

```
$ hyperfine -w 1 -L skip-bz2 true,false  -m 3 -p "aptly -config aptly.conf publish drop bullseye || true" "aptly -config aptly.conf  publish snapshot  --skip-bz2={skip-bz2} --skip-contents --skip-signing bullseye"
Benchmark 1: aptly -config aptly.conf  publish snapshot  --skip-bz2=true --skip-contents --skip-signing bullseye
  Time (mean ± σ):     35.567 s ±  0.307 s    [User: 39.366 s, System: 10.075 s]
  Range (min … max):   35.311 s … 35.907 s    3 runs

Benchmark 2: aptly -config aptly.conf  publish snapshot  --skip-bz2=false --skip-contents --skip-signing bullseye
  Time (mean ± σ):     64.740 s ±  0.135 s    [User: 68.565 s, System: 10.129 s]
  Range (min … max):   64.596 s … 64.862 s    3 runs

Summary
  'aptly -config aptly.conf  publish snapshot  --skip-bz2=true --skip-contents --skip-signing bullseye' ran
    1.82 ± 0.02 times faster than 'aptly -config aptly.conf  publish snapshot  --skip-bz2=false --skip-contents --skip-signing bullseye'
```

Allow skipping bz2 creation for setups where faster publishing is more
important then Package file size.

Signed-off-by: Sjoerd Simons <sjoerd@collabora.com>
2022-06-22 11:25:45 +02:00
Samuel Mutel 4c04e77489 enh: Give info when unable to load list of repos 2022-04-25 12:58:06 +02:00
Lorenzo Bolla 1361bf20dd Revive skipped tests 2022-02-08 11:18:50 +01:00