#!/bin/bash

set -o errexit
set -o nounset
set -o pipefail

SUFFIX="${ROOTFS_SUFFIX-}"

cp "receipt-s3/${STACK}_receipt${SUFFIX}"-* "rootfs/${STACK}/${STACK}_receipt"

pushd rootfs
    version=$(cat ../version/number)
    git add "${STACK}/${STACK}_receipt"

    set +e
      git diff --cached --exit-code
      no_changes=$?
    set -e

    if [ $no_changes -ne 0 ]
    then
      git commit -m "Commit receipt for $version"
    else
      echo "No new changes to rootfs or receipt"
    fi
popd

rsync -a rootfs/ new-rootfs-commit

#!/bin/bash

set -o errexit
set -o nounset
set -o pipefail

SUFFIX="${ROOTFS_SUFFIX-}"

if [ $STACK == 'cflinuxfs2' ]; then
    receipt_file="${STACK}_receipt"
    receipt_dest="${STACK}/${STACK}_receipt"
else
    receipt_file="receipt.${STACK}.x86_64"
    receipt_dest="receipt.${STACK}.x86_64"
fi

cp "receipt-s3/${receipt_file}"-* "rootfs/${receipt_dest}"

pushd rootfs
    version=$(cat ../version/number)
    git add "${receipt_dest}"

    set +e
      git diff --cached --exit-code
      no_changes=$?
    set -e

    if [ $no_changes -ne 0 ]
    then
      git commit -m "Commit receipt for $version"
    else
      echo "No new changes to rootfs or receipt"
    fi
popd

rsync -a rootfs/ new-rootfs-commit

Update the update-rootfs-receipt to commit cflinuxfs3 receipts
Update the update-rootfs-receipt to commit cflinuxfs3 receipts

[#157725021]

Signed-off-by: Danny Joyce <656eadb1608d5e3ea5db131e513d97abdf96b075@pivotal.io>
