summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2016-01-21 15:39:20 +0100
committerAlexander Larsson <alexl@redhat.com>2016-01-21 15:39:20 +0100
commit3d94f0069e3a25aa6b43abead1d0706718986119 (patch)
treeaf30fefc0a9742acea5827012d51a23d7ee9d639
parentabff6b0646445770b664fad0fe3eee131b538d98 (diff)
untag in a different way to keep the sizes
We sign the autobuild and use ostree reset to repoint the regular branch to the same commit
-rwxr-xr-xbin/untag.sh16
1 files changed, 10 insertions, 6 deletions
diff --git a/bin/untag.sh b/bin/untag.sh
index 973236f..a82282b 100755
--- a/bin/untag.sh
+++ b/bin/untag.sh
@@ -6,17 +6,21 @@ export ARCH=$3
export VERSION=$4
export TAG=$5
-COMMIT_ARGS="--repo=${REPO}"
-if [ "x${GPG_KEY}" != "x" ]; then
- COMMIT_ARGS="${COMMIT_ARGS} --gpg-sign=${GPG_KEY}"
-fi
+OSTREE_ARGS="--repo=${REPO}"
+GPG_ARGS=""
if [ "x${GPG_HOME}" != "x" ]; then
- COMMIT_ARGS="${COMMIT_ARGS} --gpg-homedir=${GPG_HOME}"
+ GPG_ARGS="${COMMIT_ARGS} --gpg-homedir=${GPG_HOME}"
fi
for ORIG_BRANCH in `(cd ${REPO}/refs/heads/; echo runtime/${NAME}${TAG}*/${ARCH}/${VERSION})`; do
export NEW_BRANCH=`echo ${ORIG_BRANCH} | sed s/${TAG}//`;
export COMMITMSG=`ostree show --repo=${REPO} ${ORIG_BRANCH} | tail -n +4 | head -n 1 | sed -e 's/^[ \t]*//'`
- ostree commit ${COMMIT_ARGS} --tree=ref=${ORIG_BRANCH} -b ${NEW_BRANCH} -s "${COMMITMSG}"
+ if [ "x${GPG_KEY}" != "x" ]; then
+ ostree gpg-sign ${OSTREE_ARGS} ${GPG_ARGS} "${ORIG_BRANCH}" "${GPG_KEY}"
+ fi
+
+ mkdir -p `dirname ${REPO}/refs/heads/${NEW_BRANCH}`
+ touch ${REPO}/refs/heads/${NEW_BRANCH}
+ ostree reset ${OSTREE_ARGS} ${NEW_BRANCH} ${ORIG_BRANCH}
done