contrib/dockerrpm
author Pierre-Yves David <pierre-yves.david@fb.com>
Tue, 13 May 2014 17:28:19 -0700
changeset 21577 c62c5ce750ee
parent 21561 f1bcc33a5c52
child 21642 76a347bcdb33
permissions -rwxr-xr-x
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/"