From e1382bbd8d07304021b20f91f2c8119c1b0bff20 Mon Sep 17 00:00:00 2001
From: merakor <cem@ckyln.com>
Date: Fri, 29 May 2020 17:24:00 +0000
Subject: doc: update sample script

FossilOrigin-Name: 4ff8199d4ee0a914db22d294a15c567a39ffaea4afd21fa9a6f0a00b07f1968d
---
 doc/rsync-repositories.txt | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

(limited to 'doc')

diff --git a/doc/rsync-repositories.txt b/doc/rsync-repositories.txt
index 71fca39..dfe3cb5 100644
--- a/doc/rsync-repositories.txt
+++ b/doc/rsync-repositories.txt
@@ -27,19 +27,15 @@ own use.
     HOSTNAME=rsync://carbslinux.org/repo
     GITDIR=/pub/git/repo
     SHAREDIR=/pub/share/repo
-    _rsync() { rsync -aC --delete --exclude=.rsync "$@" ;}
 
     git -C "$GITDIR" pull
-    _rsync "$GITDIR/." "$SHAREDIR"
+    rsync -aC --delete --include=core --exclude=.rsync \
+        "$GITDIR/" "$SHAREDIR"
 
-    # For some reason the core repositories were not synced
-    # so I resorted to this solution
-    for dir in "$GITDIR/"*; do
+    for dir in "$SHAREDIR/"*; do
         [ -d "$dir" ] || continue
-        _rsync "$dir/." "$SHAREDIR/${dir##*/}"
-
-        [ -f "$SHAREDIR/${dir##*/}/.rsync" ] ||
-            printf '%s/%s\n' "$HOSTNAME" "${dir##*/}" > "$SHAREDIR/${dir##*/}/.rsync"
+        [ -f "$dir/.rsync" ] ||
+            printf '%s/%s\n' "$HOSTNAME" "${dir##*/}" > "$dir/.rsync"
     done
 
 
-- 
cgit v1.2.3