revert: group related data in tuple in the dispatch table
The dispatch table used to be:
- action if in target manifest
- action if not in target manifest
- make backup if in target manifest
- make backup if not in target manifest
We turn this into two (action, make backup) tuples.
This helps both readability of the dispatch table and handling of each case.
This also prepares a refactoring where the different actions we performs, whether
"file is in target manifest" or not, are determined before reaching this loop.
#!/bin/bash
BUILDDIR=$(dirname $0)
ROOTDIR=$(cd $BUILDDIR/..; pwd)
if which docker >> /dev/null ; then
DOCKER=docker
elif which docker.io >> /dev/null ; then
DOCKER=docker.io
fi
$DOCKER build --tag "hg-dockerrpm-$1" - < $BUILDDIR/docker/$1
$DOCKER run --rm -v $ROOTDIR:/hg "hg-dockerrpm-$1" bash -c \
"cp -a hg hg-build; cd hg-build; make clean local $1; cp packages/$1/* /hg/packages/$1/"