Skip to content
This repository has been archived by the owner on Jul 10, 2022. It is now read-only.

Upload with preserve-versions not behaving as expected at preserving older version of a package #23

Closed
maliksalman opened this issue Nov 13, 2013 · 8 comments

Comments

@maliksalman
Copy link

I am trying to create private repo in S3. So starting with just basic stuff and trying to add two debs in an empty S3 bucket. Both of the debs have the same package name but different versions.

I first issue this command ...

deb-s3 upload sample-deb-app_20131113-165611-864050148_amd64.deb --preserve-versions --arch=amd64 --access-key-id=MYKEY --prefix=smalik --secret-access-key=MYSECRET --codename=precise --component=main --visibility=private --bucket=my-s3-repo

This creates the appropriate structure in my bucket ... and using apt-get and https://github.com/krobertson/apt-s3, I can even access that repo and install that package. Then I run this next command ...

deb-s3 upload sample-deb-app_20131113-165709-087212215_amd64.deb --preserve-versions --arch=amd64 --access-key-id=MYKEY --prefix=smalik --secret-access-key=MYSECRET --codename=precise --component=main --visibility=private --bucket=my-s3-repo

This ends up over writing the single package entry in Packages file that it generates. The old deb file is still present in S3 but just no entry for it in Packages file. I was expecting that the preserve-versions flag would allow me to keep the old version.

The listing in S3 look like this after the 2nd call ...

Object  1,227   Wed Nov 13 13:29:54 EST 2013    smalik/dists/precise/Release
Object  540     Wed Nov 13 13:29:54 EST 2013    smalik/dists/precise/main/binary-amd64/Packages
Object  387     Wed Nov 13 13:29:54 EST 2013    smalik/dists/precise/main/binary-amd64/Packages.gz
Object  0       Wed Nov 13 12:48:49 EST 2013    smalik/dists/precise/main/binary-i386/Packages
Object  20      Wed Nov 13 12:48:49 EST 2013    smalik/dists/precise/main/binary-i386/Packages.gz
Object  854     Wed Nov 13 12:48:49 EST 2013    smalik/pool/115/sa/sample-deb-app_20131113-165611-864050148_amd64.deb
Object  854     Wed Nov 13 13:29:54 EST 2013    smalik/pool/115/sa/sample-deb-app_20131113-165709-087212215_amd64.deb

The DEBIAN/control file in the first package was ...

Package: sample-deb-app
Version: 20131113-165611-864050148
Maintainer: smalik
Architecture: amd64
Section: main
Priority: optional
Depends: varnish
Description: Sample Debian Service Package

In the second package it was ...

Package: sample-deb-app
Version: 20131113-165709-087212215
Maintainer: smalik
Architecture: amd64
Section: main
Priority: optional
Depends: varnish
Description: Sample Debian Service Package

Any insight/help would be appreciated

@yannh
Copy link
Contributor

yannh commented Feb 3, 2014

👍
Not working here either, pretty much same use case :(

@dejo1307
Copy link

dejo1307 commented Feb 3, 2014

I thought the same, and wanted to fix this, but code is actually working fine. We have versioning like 1.2.3-1234 and hit this same issue but in 1.2.3-1234 first part (1.2.3) IS version and second part (1234) is considered as iteration number. So we decided to change our nomenclature to be more Debian specific (you can change it to 1.2.3+1234 for example) and that should work with current code:

https://www.debian.org/doc/manuals/maint-guide/first.en.html#namever

So this previous line should look like:

@packages.delete_if { |p| p.name == pkg.name && "#{p.version}-#{p.iteration}" == "#{pkg.version}-#{pkg.iteration}" }

...but this is not OK regarding Debian naming convention.

@maliksalman
Copy link
Author

So, in summary, I am running into this issue because the version numbers I am assigning to my 2 example packages above don't look different to the code?

@yannh
Copy link
Contributor

yannh commented Feb 4, 2014

Hello @maliksalman , indeed it seems you are having the same issue as we do, we believe the issue is because of the dashes in the version numbers. We are going to fix it by changing our versionning scheme. You might want to look at https://www.debian.org/doc/manuals/maint-guide/first.en.html#namever :

"You should choose the upstream version to consist only of alphanumerics (0-9A-Za-z), plus (+), tildes (~), and periods (.). It must start with a digit (0-9)."

@zeridon
Copy link

zeridon commented Apr 29, 2014

Another report on this.

We are using Oracle Java and making packages based on make-java-package (make-jpkg)

this generates the following deb-names:
oracle-j2sdk1.7_1.7.0+update40_amd64.deb
oracle-j2sdk1.7_1.7.0+update51_amd64.deb

Which are prety much quite nicely ingested by any repo system we have used, but unfortunately deb-s3 leaves only the later one uploaded.

@krobertson
Copy link
Owner

@zeridon are you using the latest 0.6.1 release? It includes #32 which addresses some issues with version handling with the preserve-version option. I believe it addressed the problem in this issue, but hadn't reviewed open issues before cutting the release.

@zeridon
Copy link

zeridon commented Apr 29, 2014

Hi Ken,

i've installed it via gem but will check tomorrow from the release and report back.

@zeridon
Copy link

zeridon commented Apr 30, 2014

Thanks 0.6.1 works, but maybe it should be a bit more visible that there is preserve-versions flag.

I.e. in the readme note that this gem mimics reprepro behaviour by default (keeps single version) or make the -p option visible in the default help and not only in upload

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants