[PATCH] butt ugly hack to sync f26 updates.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Dennis Gilmore <ausil@xxxxxxxxxxxxxxxxx>

a releng issue has been filed @ https://pagure.io/releng/issue/6692 to
do it in a much better way

Signed-off-by: Dennis Gilmore <ausil@xxxxxxxxxxxxxxxxx>
---
 roles/bodhi2/backend/files/fedora-updates-push | 91 ++++++++++++++++++++++++++
 1 file changed, 91 insertions(+)

diff --git a/roles/bodhi2/backend/files/fedora-updates-push b/roles/bodhi2/backend/files/fedora-updates-push
index d8c9227..201c2e2 100755
--- a/roles/bodhi2/backend/files/fedora-updates-push
+++ b/roles/bodhi2/backend/files/fedora-updates-push
@@ -6,7 +6,11 @@ ATOMICSOURCE=/mnt/koji/mash/atomic/
 ATOMICDEST=/mnt/koji/atomic/
 
 OPTIONS="-rlptDvHh --stats --delay-updates $RSYNC_OPTS"
+#f26 exlcude 
+PRIMARY_EXCLUDES=" --exclude=aarch64 --exclude=ppc64 --exclude=ppc64le --exclude=s390x "
+ALT_EXCLUDES=" --exclude=armhfp --exclude=SRPMS --exclude=x86_64 --exclude=s390x"
 
+#old style simple sync
 for rel in 24 25; do
 
     OUTPUT1=$(rsync $OPTIONS --exclude "repodata/*" \
@@ -49,6 +53,93 @@ for rel in 24 25; do
     fi
 
 done
+#new style primary sync
+for rel in 26; do
+
+    OUTPUT1=$(rsync $OPTIONS --exclude "repodata/*" $PRIMARY_EXCLUDES \
+            $SOURCE/f$rel-updates/ $DEST/$rel/ --link-dest $DEST/testing/$rel/)
+    OUTPUT2=$(rsync $OPTIONS --delete --delete-delay $PRIMARY_EXCLUDES --exclude=Live --exclude=Images \
+            $SOURCE/f$rel-updates/ $DEST/$rel/)
+
+    # Grep out some signals from the stats
+    bytes=$(echo "$OUTPUT1" | grep "Literal data" | awk ' { print $3 } ')
+    deleted=$(echo "$OUTPUT2" | grep "deleting " | wc -l)
+
+    # If anything changed, then publish a fedmsg message as bodhi.updates.sync
+    if [ "$bytes" != "0" -o "$deleted" != "0" ]; then
+      echo "{\"bytes\": \"$bytes\", \"deleted\": \"$deleted\", \"repo\": \"updates\", \"release\": \"$rel\"}" | fedmsg-logger \
+          --cert-prefix ftpsync \
+          --modname bodhi \
+          --topic updates.fedora.sync \
+          --json-input &> /dev/null
+    fi
+
+done
+for rel in 26; do
+
+    OUTPUT1=$(rsync $OPTIONS --exclude "repodata/*" $PRIMARY_EXCLUDES \
+            $SOURCE/f$rel-updates-testing/ $DEST/testing/$rel/)
+    OUTPUT2=$(rsync $OPTIONS --delete --delete-delay $PRIMARY_EXCLUDES --exclude=Live --exclude=Images \
+            $SOURCE/f$rel-updates-testing/ $DEST/testing/$rel/)
+
+    # Grep out some signals from the stats
+    bytes=$(echo "$OUTPUT1" | grep "Literal data" | awk ' { print $3 } ')
+    deleted=$(echo "$OUTPUT2" | grep "deleting " | wc -l)
+
+    # If anything changed, then publish a fedmsg message as bodhi.updates.sync
+    if [ "$bytes" != "0" -o "$deleted" != "0" ]; then
+      echo "{\"bytes\": \"$bytes\", \"deleted\": \"$deleted\", \"repo\": \"updates-testing\", \"release\": \"$rel\"}" | fedmsg-logger \
+          --cert-prefix ftpsync \
+          --modname bodhi \
+          --topic updates.fedora.sync \
+          --json-input &> /dev/null
+    fi
+
+done
+# new style alternative sync
+for rel in 26; do
+
+    OUTPUT1=$(rsync $OPTIONS --exclude "repodata/*" $ALT_EXCLUDES \
+            $SOURCE/f$rel-updates/ $DEST/$rel/ --link-dest $DEST/testing/$rel/)
+    OUTPUT2=$(rsync $OPTIONS --delete --delete-delay $ALT_EXCLUDES --exclude=Live --exclude=Images \
+            $SOURCE/f$rel-updates/ $DEST/$rel/)
+
+    # Grep out some signals from the stats
+    bytes=$(echo "$OUTPUT1" | grep "Literal data" | awk ' { print $3 } ')
+    deleted=$(echo "$OUTPUT2" | grep "deleting " | wc -l)
+
+    # If anything changed, then publish a fedmsg message as bodhi.updates.sync
+    if [ "$bytes" != "0" -o "$deleted" != "0" ]; then
+      echo "{\"bytes\": \"$bytes\", \"deleted\": \"$deleted\", \"repo\": \"updates\", \"release\": \"$rel\"}" | fedmsg-logger \
+          --cert-prefix ftpsync \
+          --modname bodhi \
+          --topic updates.fedora.sync \
+          --json-input &> /dev/null
+    fi
+
+done
+for rel in 26; do
+
+    OUTPUT1=$(rsync $OPTIONS --exclude "repodata/*" $ALT_EXCLUDES \
+            $SOURCE/f$rel-updates-testing/ $DEST/testing/$rel/)
+    OUTPUT2=$(rsync $OPTIONS --delete --delete-delay $ALT_EXCLUDES --exclude=Live --exclude=Images \
+            $SOURCE/f$rel-updates-testing/ $DEST/testing/$rel/)
+
+    # Grep out some signals from the stats
+    bytes=$(echo "$OUTPUT1" | grep "Literal data" | awk ' { print $3 } ')
+    deleted=$(echo "$OUTPUT2" | grep "deleting " | wc -l)
+
+    # If anything changed, then publish a fedmsg message as bodhi.updates.sync
+    if [ "$bytes" != "0" -o "$deleted" != "0" ]; then
+      echo "{\"bytes\": \"$bytes\", \"deleted\": \"$deleted\", \"repo\": \"updates-testing\", \"release\": \"$rel\"}" | fedmsg-logger \
+          --cert-prefix ftpsync \
+          --modname bodhi \
+          --topic updates.fedora.sync \
+          --json-input &> /dev/null
+    fi
+
+done
+
 for rel in 24 25; do
 
     OUTPUT1=$(rsync $OPTIONS --ignore-existing \
-- 
1.8.3.1
_______________________________________________
infrastructure mailing list -- infrastructure@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to infrastructure-leave@xxxxxxxxxxxxxxxxxxxxxxx




[Index of Archives]     [Fedora Development]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux