summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2016-12-07 16:33:56 +0000
committerRay Strode <rstrode@redhat.com>2016-12-07 16:33:56 +0000
commite7c0cb2adaeee0cdc576595c47e3d8dd8eb9d71c (patch)
tree7b4623ce81296cee253c1581db7b123d27d7c10f
parent9110705c1f0cdfa65f91ecdb636065c033b5f0b2 (diff)
clean-up-bad-named-entries.sh: script for mopping up a mess I made
When I first did the github mirroring I didn't handled nested repos in a namespaced way. This script goes in and deletes all the unnamespaced names.
-rw-r--r--clean-up-bad-named-entries.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/clean-up-bad-named-entries.sh b/clean-up-bad-named-entries.sh
new file mode 100644
index 0000000..ba35f97
--- /dev/null
+++ b/clean-up-bad-named-entries.sh
@@ -0,0 +1,11 @@
+cd /git
+find -path './users' -prune -o -name config -print | while read repo_config; do
+ pushd $(dirname $repo_config)
+
+ if [ -e git-daemon-export-ok -a -e HEAD -a -e $(awk '{ print $2 }' HEAD) ]; then
+ echo cleaning up repo "$(basename $PWD .git)"
+ curl --user "fdo-mirror:$(cat /etc/github-mirror/mirror.cfg |grep password | awk -F= '{ print $2 }')" -X DELETE "https://api.github.com/repos/freedesktop/$(basename $PWD .git)"
+ fi
+
+ popd
+done