Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should freight-add exit non-zero in case package is already present? #59

Open
antaflos opened this issue Sep 24, 2014 · 2 comments
Open

Comments

@antaflos
Copy link
Contributor

Running freight-add on a package that already exists in the library exits with an informative (error?) message but with exit code 0:

$ freight-add foobar_0.9.0_amd64.deb apt/precise
# [freight] apt/precise already has foobar_0.90.0_amd64.deb
$ echo $?
0

Shouldn't it exit with 1 or another non-zero value so that one doesn't have to rely on parsing the message in order to find out what freight-add actually did?

I understand that the end result of running freight-add is always that a package is present in the library (i.e. /var/lib/freight) but when scripting a package deployment process it'd be nice to be able to easily fail when the script tries to add a package that already exists.

@rcrowley
Copy link
Owner

rcrowley commented Oct 5, 2014

I'll think on it. I didn't realize that was an erroneous condition.

You can work around it by looking in $VARLIB/$MANAGER/$DIST for the file you're trying to add.

@bronson
Copy link

bronson commented May 5, 2015

Freight's current behavior is what I would expect... My build scripts don't check to see if packages already exist before trying to add them. It's not an erroneous condition in my case.

@antaflos curious, why do you want dupes to be a fatal error?

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

No branches or pull requests

3 participants