From 5de4b9a0264631fbc38f1661899e450c4bafd3f8 Mon Sep 17 00:00:00 2001 From: Brandon Gray Date: Thu, 13 Jul 2017 11:30:05 -0500 Subject: [PATCH] remove unused setup_git_package from distgit role --- roles/distgit/files/setup_git_package | 130 -------------------------- 1 file changed, 130 deletions(-) delete mode 100644 roles/distgit/files/setup_git_package diff --git a/roles/distgit/files/setup_git_package b/roles/distgit/files/setup_git_package deleted file mode 100644 index f6bfea217b..0000000000 --- a/roles/distgit/files/setup_git_package +++ /dev/null @@ -1,130 +0,0 @@ -#!/bin/bash -# -# Create a new repo. -# THIS HAS TO BE RUN ON THE GIT SERVER! - -# WARNING: -# This file is maintained within ansible -# All local changes will be lost. - - -# Figure out the environment we're running in -GITROOT=/srv/git/repositories - -# check if a moron is driving me -if [ ! -d $GITROOT ] ; then - # we're not on the git server (this check is fragile) - echo "ERROR: This script has to be run on the git server." - echo "ERROR: Homer sez 'Duh'." - exit -9 -fi - -# Local variables -VERBOSE=0 -TEST= -IGNORE= -AUTHOR="Fedora Release Engineering " -GIT_SSH_URL="ssh://localhost" - -Usage() { - cat < - - Creates a new repo for - -Options: - -h,--help This help message -EOF -} - -if [ $# -gt 2 ]; then - Usage - exit -1 -fi - -# parse the arguments -while [ -n "$1" ] ; do - case "$1" in - -h | --help ) - Usage - exit 0 - ;; - - * ) - PACKAGE="$1" - ;; - esac - shift -done - -# I hate shell scripting. I'm sure the above is totally wrong - -# check the arguments -if [ -z "$PACKAGE" ] ; then - Usage - exit -1 -fi - -# Sanity checks before we start doing damage -[ $VERBOSE -gt 1 ] && echo "Checking package $PACKAGE..." -if [ -f $GITROOT/$PACKAGE.git/refs/heads/master ] ; then - echo "ERROR: Package module $PACKAGE already exists!" >&2 - exit -1 -fi - -# 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 check -if [ ! -w $GITROOT ] ; then - echo "ERROR: You can not write to $GITROOT" - echo "ERROR: You can not create repos" - exit -1 -fi - -# Now start working on creating those branches -# Create a tmpdir to do some git work in -TMPDIR=$(mktemp -d /tmp/tmpXXXXXX) - -# First create the master repo -mkdir -p $GITROOT/$PACKAGE.git -pushd $GITROOT/$PACKAGE.git >/dev/null -git init -q --shared --bare -echo "$PACKAGE" > description # This is used to figure out who to send mail to. -git config --add hooks.mailinglist "$PACKAGE-owner@fedoraproject.org,scm-commits@lists.fedoraproject.org" -git config --add hooks.maildomain fedoraproject.org -popd >/dev/null - -# Now clone that repo and create the .gitignore and sources file -git init -q $TMPDIR/$PACKAGE -pushd $TMPDIR/$PACKAGE >/dev/null -touch .gitignore sources -git add . -git commit -q -m 'Initial setup of the repo' --author "$AUTHOR" -git remote add origin $GITROOT/$PACKAGE.git -git push -q origin master -popd >/dev/null - -# Place the gitolite update hook in place since we're not using our own -ln -s /etc/gitolite/hooks/common/update $GITROOT/$PACKAGE.git/hooks/update - - -# Setup our post-receive hooks -mkdir -p $GITROOT/$PACKAGE.git/hooks/post-receive-chained.d -ln -s /usr/share/git-core/mail-hooks/gnome-post-receive-email \ - $GITROOT/$PACKAGE.git/hooks/post-receive-chained.d/post-receive-email -ln -s /usr/share/git-core/post-receive-fedmsg \ - $GITROOT/$PACKAGE.git/hooks/post-receive-chained.d/post-receive-fedmsg -ln -s /usr/share/git-core/post-receive-alternativearch \ - $GITROOT/$PACKAGE.git/hooks/post-receive-chained.d/post-receive-alternativearch - -# This one kicks off all the others in post-receive-chained.d -ln -s /usr/share/git-core/post-receive-chained \ - $GITROOT/$PACKAGE.git/hooks/post-receive - -rm -rf $TMPDIR -echo "Done."