test/relocate.sh
author J. Ali Harlow <ali@juiblex.co.uk>
Tue Apr 24 19:27:29 2018 +0100 (2018-04-24)
changeset 496 203fa998c6df
parent 456 bae5adee8c8c
permissions -rwxr-xr-x
Support expat v2.2
     1 #!/bin/sh
     2 set -x
     3 if [ $# -gt 0 ]; then
     4     razor="$1"
     5 else
     6     razor=../src/razor
     7 fi
     8 check_file()
     9 {
    10     $razor list-files | grep -F -x "$1" > /dev/null
    11     if [ $? -ne 0 ]; then
    12 	echo $1: Not in database >&2
    13 	exit 1
    14     fi
    15     if [ ! -e "$tmpdir$1" ]; then 
    16 	echo $1: Not in filesystem >&2
    17 	exit 1
    18     fi
    19 }
    20 tmpdir=`mktemp -dt` || exit 1
    21 export RAZOR_ROOT="file:$tmpdir"
    22 $razor init || exit 1
    23 export YUM_URL="file:`pwd`/base"
    24 $razor import-yum || exit 1
    25 $razor install zap || exit 1
    26 $razor install --relocate /usr=/opt --relocate /etc=/opt/etc zsh || exit 1
    27 check_file /etc/zsh.conf
    28 check_file /usr/bin/zap
    29 check_file /opt/bin/zip
    30 check_file /opt/bin/zsh
    31 rm -rf "$tmpdir"