freight-team / freight

A modern take on the Debian archive.
Other
107 stars 37 forks source link

freight-add: raising an error when adding an already existing file #37

Closed ppoilbarbe closed 8 years ago

ppoilbarbe commented 8 years ago

We have automatic tools to add and check repository managed by freight. It would be nice to create (if wanted) an error (exit code not 0) when adding a file in repository (freight-add) which has already been added.

We already do this by checking the file and if it does not exist send an error to the asking user, but it is not atomic like the ln command in freight-add command.

Attached is a patch which can do this:

freight-error-add.patch

ppoilbarbe commented 8 years ago

This was an old version of the patch if _FREIGHT_ADDERROR is set empty in script it cannot be controlled outside the command.

freight-error-add.patch

domcleal commented 8 years ago

Could you open a pull request with the suggested patch please? it's hard to review from an attachment. https://help.github.com/articles/proposing-changes-to-a-project-with-pull-requests/ has more info.

ppoilbarbe commented 8 years ago

Ok. I'll see how to do this.