#!/bin/sh

# generate-flat-tree.sh
#
# Creates a tarball containing all directories (including other repositories
# like Blink and V8) of a given chromium+xwalk tree, similar to
# tools/export_tarball in the Chromium tree (which could also be used, but it's
# slower and always calls xz(1)).
#
# For more usage information, please see
# https://github.com/otcshare/crosswalk/wiki/Build-Crosswalk#building-an-rpm-package-for-tizen

if [ -z "${XWALK_PREFIX}" ]; then
    echo "You need to set XWALK_PREFIX to the top-level directory of your source tree (the one that contains src/)."
    exit 1
fi

# Ignore directories outside src/.
if [ "${GCLIENT_DEP_PATH#src}" = "${GCLIENT_DEP_PATH}" ]; then
    exit
fi

cd ${XWALK_PREFIX}
echo "Adding ${GCLIENT_DEP_PATH}..."

tar --update --file ${XWALK_PREFIX}/flat-xwalk-tree.tar \
    --exclude-vcs --exclude=native_client --exclude=LayoutTests \
    --verbose \
    ${GCLIENT_DEP_PATH}

#!/bin/sh

# generate-flat-tree.sh
#
# Creates a tarball containing all directories (including other repositories
# like Blink and V8) of a given chromium+xwalk tree, similar to
# tools/export_tarball in the Chromium tree (which could also be used, but it's
# slower and always calls xz(1)).
#
# For more usage information, please see
# https://github.com/otcshare/crosswalk/wiki/Build-Crosswalk#building-an-rpm-package-for-tizen

if [ -z "${XWALK_PREFIX}" ]; then
    echo "You need to set XWALK_PREFIX to the top-level directory of your source tree (the one that contains src/)."
    exit 1
fi

# Ignore directories outside src/.
if [ "${GCLIENT_DEP_PATH#src}" = "${GCLIENT_DEP_PATH}" ]; then
    exit
fi

cd ${XWALK_PREFIX}
echo "Adding ${GCLIENT_DEP_PATH}..."

tar --append --file ${XWALK_PREFIX}/flat-xwalk-tree.tar \
    --exclude-vcs --exclude=native_client --exclude=LayoutTests \
    --verbose \
    ${GCLIENT_DEP_PATH}

--- 
+++ 
@@ -23,7 +23,7 @@
 cd ${XWALK_PREFIX}
 echo "Adding ${GCLIENT_DEP_PATH}..."
 
-tar --append --file ${XWALK_PREFIX}/flat-xwalk-tree.tar \
+tar --update --file ${XWALK_PREFIX}/flat-xwalk-tree.tar \
     --exclude-vcs --exclude=native_client --exclude=LayoutTests \
     --verbose \
     ${GCLIENT_DEP_PATH}
packaging: Fix adding the same files to the flat-tree archive

If we pass --update instead of --append to tar we only append to the archive
files that are newer than those already in the archive. This has the potencial
to make the archive generation faster in the incremental development case and
could also save some disk space.
