Reduce code duplication in build scripts
There seems to be a lot of duplication in the bash scripts, in partciular in fenics.conf. For example multiple functions pull_ffc, pull_fiat etc. This could be a simple for loop over packages to a common pull function.
Comments (5)
-
-
@jackhale And I was marvelling at your Bash skills, when it was Larry all along!
@minrk Has a improved Bash scripts at https://bitbucket.org/fenics-project/docker/pull-requests/4, but for maintainability I'm all for eventually switching to Python scripts (my teeth grind whenever I have to write bash script).
-
reporter Python is fine but Bash isn't that bad. It forces us to keep the scripts simple. With Python, there's chance we'll hack away and make something that is harder to maintain.
-
For the simple shell-command scripting that is needed here, I personally prefer bash (or ruby for more complex logic), but I can take a stab at Python if that would be more maintainable based on maintainers' expertise. If it is going to add more complex options, etc. it certainly makes sense to switch away from bash.
-
- changed status to resolved
Everyone seems happy with the current simple bash implementation, fixed.
- Log in to comment
Agreed, Larry wrote the bash script as an initial prototype, but it's not really up to the job if we're going to make this main way to develop FEniCS.
I think the original idea of having it all split up was to make it easy to modify quickly, i.e. I want to pull ffc at commit x, modify the line, ready to build.
A better system would be to allow the specification of commits, branches and git repos in a JSON payload that I can keep in my shared folder on the host and feed in to the build script. Also, I would prefer to have the script written in Python3 rather than bash.