1 |
#!/bin/bash |
2 |
|
3 |
REPO="$1" |
4 |
GITROOT="/git" |
5 |
RSYNCROOT="rsync://valstar.mageia.org/git" |
6 |
|
7 |
if [ ! -d "$GITROOT/$REPO" ]; then |
8 |
echo "No repository found $REPO" >&2 |
9 |
exit 1 |
10 |
fi |
11 |
|
12 |
cp -af "$GITROOT/$REPO/config" "$GITROOT/$REPO/config.orig" |
13 |
/usr/bin/rsync -a --delete --include="description" --include="config" --include="info" --include="info/web" --include="info/web/last-modified" --exclude="*" "$RSYNCROOT/$REPO/" "$GITROOT/$REPO/" |
14 |
cp -af "$GITROOT/$REPO/config" "$GITROOT/$REPO/config.upstream" |
15 |
mv -f "$GITROOT/$REPO/config.orig" "$GITROOT/$REPO/config" |
16 |
|
17 |
OWNER=$(git config --file "$GITROOT/$REPO/config.upstream" gitweb.owner) |
18 |
DESC=$(git config --file "$GITROOT/$REPO/config.upstream" gitweb.description) |
19 |
rm -f "$GITROOT/$REPO/config.upstream" |
20 |
|
21 |
CUROWNER=$(git config --file "$GITROOT/$REPO/config" gitweb.owner) |
22 |
if [ "$CUROWNER" != "$OWNER" ]; then |
23 |
git config --file "$GITROOT/$REPO/config" gitweb.owner "$OWNER" |
24 |
fi |
25 |
|
26 |
CURDESC=$(git config --file "$GITROOT/$REPO/config" gitweb.description) |
27 |
if [ "$CURDESC" != "$DESC" ]; then |
28 |
git config --file "$GITROOT/$REPO/config" gitweb.owner "$DESC" |
29 |
fi |