freight-team / freight

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

Change freight-cache and init to use bash #10

Closed domcleal closed 8 years ago

domcleal commented 8 years ago

Permits use of bash arrays in the multiple GPG support.

Fixes #8


The oddity with the semicolons in the case statement is that without them, bash seems to create subshells preventing the variables from taking effect.

Caught by the tests in #9 :smile:

mmoll commented 8 years ago

On the one hand I'm not a big fan of using bash, especially as Debian switched to dash, but I'd say get this in now to fix things and let the freight package depend on bash and see what can be done to make it POSIX compatible again later, if that's worth the effort.

BTW, I'll be playing around with https://github.com/koalaman/shellcheck in the near future and will open a PR to add it to the travis test so such issues can get detected beforehand.

domcleal commented 8 years ago

Changing it back later might be difficult as I used arrays in the config file for the list of GPG key IDs. It'd be better for me to rewrite it in a POSIX style with a string of key uids so config files are POSIX from the start.

If consensus is that POSIX is preferred, I'll open a PR with that change instead.

mmoll commented 8 years ago

Then I'd say :+1: to this, unless @mattock objects.

mmoll commented 8 years ago

bin/freight-add also needs similar changes for more tests to pass on my local machine (with dash as /bin/sh) and even bin/freight needs the /bin/bash header

mattock commented 8 years ago

I'd prefer POSIX-compliant scripts, unless that makes things very complicated.

domcleal commented 8 years ago

Fine by me, I'll open a new PR shortly with a POSIX-compatible syntax.