summaryrefslogtreecommitdiffstats
path: root/qt-ostree
diff options
context:
space:
mode:
authorGatis Paeglis <gatis.paeglis@qt.io>2016-07-08 15:15:52 +0200
committerGatis Paeglis <gatis.paeglis@qt.io>2016-07-18 12:30:33 +0000
commit89faaff3366ef52fe257f09b6ca1b1f894fa5364 (patch)
tree20a53c8469714ec6ad14c91ef7f55fb0724903e9 /qt-ostree
parentaccdc775894bc0b6cbbdde9b49f17ac65d02fac5 (diff)
Abort when sysroot has unchanged
Change-Id: Id80c9df0fa8d4d9fef8944672f6879a7f6651d4f Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Diffstat (limited to 'qt-ostree')
-rwxr-xr-xqt-ostree/qt-ostree18
1 files changed, 16 insertions, 2 deletions
diff --git a/qt-ostree/qt-ostree b/qt-ostree/qt-ostree
index 1d2a7dd..b1c4069 100755
--- a/qt-ostree/qt-ostree
+++ b/qt-ostree/qt-ostree
@@ -623,7 +623,9 @@ commit_generated_tree()
{
# Commit the generated tree into OSTree repository.
mkdir -p ${OSTREE_REPO}
+ FIRST_COMMIT=false
if [ ! -d ${OSTREE_REPO}/objects ] ; then
+ FIRST_COMMIT=true
qt_ostree_info "Initializing new OSTree repository in ${OSTREE_REPO}"
"${OSTREE}" --repo=${OSTREE_REPO} init --mode=archive-z2
fi
@@ -637,9 +639,21 @@ commit_generated_tree()
fi
cd ${GENERATED_TREE}
+ if [ $FIRST_COMMIT = false ] ; then
+ prev_rev=$("${OSTREE}" --repo=${OSTREE_REPO} rev-parse ${OSTREE_BRANCH})
+ fi
qt_ostree_info "Committing the generated tree into a repository at ${OSTREE_REPO} ..."
- "${OSTREE}" --repo=${OSTREE_REPO} commit -b ${OSTREE_BRANCH} -s "${OSTREE_COMMIT_SUBJECT}" ${GPG_ARGS} \
- --owner-uid=0 --owner-gid=0
+ "${OSTREE}" --repo=${OSTREE_REPO} commit \
+ -b ${OSTREE_BRANCH} -s "${OSTREE_COMMIT_SUBJECT}" \
+ --skip-if-unchanged \
+ ${GPG_ARGS} \
+ --owner-uid=0 --owner-gid=0
+ new_rev=$("${OSTREE}" --repo=${OSTREE_REPO} rev-parse ${OSTREE_BRANCH})
+ if [[ $FIRST_COMMIT = false && ${prev_rev} = ${new_rev} ]] ; then
+ qt_ostree_info "There are no new changes in the sysroot. A new update won't be generated."
+ qt_ostree_exit 0
+ fi
+
qt_ostree_info "Checking the repository for consistency ..."
"${OSTREE}" --repo=${OSTREE_REPO} fsck
}