+1 looks good
On 27 February 2015 at 16:48, Patrick Uiterwijk <puiterwijk@xxxxxxxxx> wrote:
From 6e98a2dc667365633e47c63730feefc8d752886c Mon Sep 17 00:00:00 2001From: Patrick Uiterwijk <puiterwijk@xxxxxxxxxx>Date: Fri, 27 Feb 2015 23:39:59 +0000Subject: [PATCH] Fix setup_git_package to handle setting up after gitolite setup a broken reposetup_git_package did the same check as pkgdb_sync did [1].Also, if gitolite already came by, it will have created an update hook, which blocks us from pushing the initial commit (since gitolite has no idea who we are).So in that case, we will just remove the update hook: gitolite will recreate it when it comes by the repo with genacls.sh.The change to mkdir -p is just syntax to make it not print an error in case the directory already existed.Signed-off-by: Patrick Uiterwijk <puiterwijk@xxxxxxxxxx>---roles/distgit/files/setup_git_package | 10 ++++++++--1 files changed, 8 insertions(+), 2 deletions(-)diff --git a/roles/distgit/files/setup_git_package b/roles/distgit/files/setup_git_packageindex b22b31f..67103ec 100644--- a/roles/distgit/files/setup_git_package+++ b/roles/distgit/files/setup_git_package@@ -68,11 +68,17 @@ fi# Sanity checks before we start doing damage[ $VERBOSE -gt 1 ] && echo "Checking package $PACKAGE..."-if [ -d $GITROOT/$PACKAGE.git ] ; then+if [ -f $GITROOT/$PACKAGE.git/refs/heads/master ] ; thenecho "ERROR: Package module $PACKAGE already exists!" >&2exit -1fi+# A cleanup in case gitolite came by this repo+if [ -f $GITROOT/$PACKAGE.git/hooks/update ] ; then+ echo "Gitolite already initialized this repo. Will remove its hooks"+ rm -f $GITROOT/$PACKAGE.git/hooks/update+fi+# "global" permissions checkif [ ! -w $GITROOT ] ; thenecho "ERROR: You can not write to $GITROOT"@@ -85,7 +91,7 @@ fiTMPDIR=$(mktemp -d /tmp/tmpXXXXXX)# First create the master repo-mkdir $GITROOT/$PACKAGE.git+mkdir -p $GITROOT/$PACKAGE.gitpushd $GITROOT/$PACKAGE.git >/dev/nullgit init -q --shared --bareecho "$PACKAGE" > description # This is used to figure out who to send mail to.--1.7.2.1
_______________________________________________
infrastructure mailing list
infrastructure@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/infrastructure
Stephen J Smoogen.
_______________________________________________ infrastructure mailing list infrastructure@xxxxxxxxxxxxxxxxxxxxxxx https://admin.fedoraproject.org/mailman/listinfo/infrastructure