aptly
aptly copied to clipboard
'aptly repo add -force-replace' removes all versions of a package
When a repo contains more than one version of the same package, e.g.
$ aptly repo show --with-packages myrepo
Name: myrepo
Comment:
Default Distribution:
Default Component: main
Number of packages: 4
Packages:
my-base-pkg_0.5.0_all
my-base-pkg_0.5.1_all
my-base-pkg_0.5.2_all
my-base-pkg_0.5.3_all
the command aptly repo add has the effect of deleting all the versions if used with the option -force-replace (even if there is no actual conflict because the added package is actually the same). For instance
$ aptly repo add myrepo my-base-pkg_0.5.3_all.deb
Loading packages...
[+] my-base-pkg_0.5.3_all added
executes happily, but
$ aptly repo add -force-replace myrepo my-base-pkg_0.5.3_all.deb
Loading packages...
[-] my-base-pkg_0.5.3_all removed due to conflict with package being added
[-] my-base-pkg_0.5.2_all removed due to conflict with package being added
[-] my-base-pkg_0.5.1_all removed due to conflict with package being added
[-] my-base-pkg_0.5.0_all removed due to conflict with package being added
[+] my-base-pkg_0.5.3_all added
deletes everything.
@bcandrea may I use your fix?
Of course, just created a PR.
Thanks a lot for the fix!