krobertson / deb-s3

Easily create and manage an APT repository on S3 -- NO LONGER MAINTAINED
MIT License
481 stars 148 forks source link

'deb-s3 delete' argument parsing issue? #40

Open Igneous opened 10 years ago

Igneous commented 10 years ago

Hi, I'm running into an issue with deb-s3's argument parsing for the delete operation. I'm not quite sure what's going on, haven't inserted a pry binding to try to dig around yet, but I wanted to at least bring this up. Here, I'm using delete with the syntax in your readme.

Just for reference, I check the version of golang-amqp from the Packages file in my s3 bucket.

┌[igneous☮localhost]-(~/chef/orc-agent-build)
└> curl -o- https://s3.amazonaws.com/famc-debian-packages/dists/stable/main/binary-amd64/Packages
Package: golang-amqp
Version: 1.0
License: unknown
Vendor: none
Architecture: amd64
Maintainer: Bucky Wolfe <bwolfe@franklinamerican.com>
Installed-Size: 9237
Depends: libc6 (>= 2.4), dpkg-dev
Section: net
Priority: extra
Homepage: https://github.com/streadway/amqp
Filename: pool/g/go/golang-amqp_1.0_amd64.deb
Size: 1175260
SHA1: e8cbaaa12524afac390db8f50de9715413f27904
SHA256: f44ea5f945d7b505975dfb807cbf384b6c210c1999f73e8b00eb86ead3bb9ffb
MD5sum: b48ff7a9620adcba0b824c1d41789e3e
Description: streadway's amqp library for go,

Package: orc-agent
Version: 0.1
License: unknown
Vendor: none
Architecture: amd64
Maintainer: Bucky Wolfe <bwolfe@franklinamerican.com>
Installed-Size: 4922
Depends: libc6 (>= 2.4), dpkg-dev
Section: net
Priority: extra
Homepage: https://github.com/Igneous/orc-agent
Filename: pool/o/or/orc-agent_0.1_amd64.deb
Size: 919738
SHA1: d71b45f3ce3836fc67e74b27ffc524467fde3419
SHA256: c5b39b6ee072067861a53f718e9398a3bf647456069140d96b53278075569979
MD5sum: 36b43f477572bd6582382f54e1b7bd0a
Description: amqp consumer, generic message handler for orchestration tasks

Trying to delete the golang-amqp package with deb-s3 delete.

┌[igneous☮localhost]-(~/chef/orc-agent-build)
└> deb-s3 delete --arch amd64 --bucket famc-debian-packages --versions 1.0 golang-amqp
ERROR: deb-s3 delete was called with no arguments
Usage: "deb-s3 delete PACKAGE".

Trying without the rbenv shim here, just in case it's doing something goofy.

┌[igneous☮localhost]-(~/chef/orc-agent-build)
└> ~/.rbenv/versions/2.0.0-p195/bin/deb-s3 delete --arch amd64 --bucket famc-debian-packages --versions 1.0 golang-amqp
ERROR: deb-s3 delete was called with no arguments
Usage: "deb-s3 delete PACKAGE".

Trying some other deb-s3 operations.

┌[igneous☮localhost]-(~/chef/orc-agent-build)
└> deb-s3 verify -b famc-debian-packages
>> Retrieving existing manifests
>> Checking for missing packages in: stable/main amd64
>> Checking for missing packages in: stable/main armel
>> Checking for missing packages in: stable/main i386
>> Checking for missing packages in: stable/main all

Successfully uploading a package.

┌[igneous☮localhost]-(~/chef/orc-agent-build)
└> deb-s3 upload -b famc-debian-packages orc-agent_0.1_amd64.deb
>> Retrieving existing manifests
>> Examining package file orc-agent_0.1_amd64.deb
>> Uploading packages and new manifests to S3
   -- Transferring pool/o/or/orc-agent_0.1_amd64.deb
   -- Transferring dists/stable/main/binary-amd64/Packages
   -- Transferring dists/stable/main/binary-amd64/Packages.gz
   -- Transferring dists/stable/Release
>> Update complete.

Trying to remove the same package.

┌[igneous☮localhost]-(~/chef/orc-agent-build)
└> deb-s3 delete --arch amd64 --bucket famc-debian-packages --versions 0.1 orc-agent
ERROR: deb-s3 delete was called with no arguments
Usage: "deb-s3 delete PACKAGE".
Igneous commented 10 years ago

Ah.. so it looks like --versions can't be the last argument.

┌[igneous☮localhost]-(~/chef/orc-agent-build)
└> deb-s3 delete --arch amd64 --bucket famc-debian-packages --versions 0.1 orc-agent
ERROR: deb-s3 delete was called with no arguments
Usage: "deb-s3 delete PACKAGE".
┌[igneous☮localhost]-(~/chef/orc-agent-build)
└> deb-s3 delete --arch amd64 --bucket famc-debian-packages --versions "0.1" orc-agent
ERROR: deb-s3 delete was called with no arguments
Usage: "deb-s3 delete PACKAGE".
┌[igneous☮localhost]-(~/chef/orc-agent-build)
└> deb-s3 delete --arch amd64 --versions 0.1 --bucket famc-debian-packages orc-agent
>> Versions to delete: 0.1
>> Retrieving existing manifests
   -- Deleting orc-agent version 0.1
>> Uploading new manifests to S3
   -- Transferring dists/stable/main/binary-amd64/Packages
   -- Transferring dists/stable/main/binary-amd64/Packages.gz
   -- Transferring dists/stable/Release
>> Update complete.