aptly icon indicating copy to clipboard operation
aptly copied to clipboard

'aptly repo add -force-replace' removes all versions of a package

Open bcandrea opened this issue 11 years ago • 3 comments

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 avatar Jan 30 '15 16:01 bcandrea

@bcandrea may I use your fix?

smira avatar Jan 30 '15 16:01 smira

Of course, just created a PR.

bcandrea avatar Jan 30 '15 16:01 bcandrea

Thanks a lot for the fix!

smira avatar Jan 30 '15 16:01 smira