/[adm]/puppet/modules/gitmirror/templates/rsync-metadata.sh
ViewVC logotype

Contents of /puppet/modules/gitmirror/templates/rsync-metadata.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3410 - (show annotations) (download) (as text)
Mon Feb 10 09:01:37 2014 UTC (10 years, 2 months ago) by colin
File MIME type: text/x-sh
File size: 950 byte(s)
gitmirror: Use two rsyncs rather than have a config file race.
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 /usr/bin/rsync -a --include="description" --include="info" --include="info/web" --include="info/web/last-modified" --exclude="*" "$RSYNCROOT/$REPO/" "$GITROOT/$REPO/"
13 /usr/bin/rsync -a "$RSYNCROOT/$REPO/config" "$GITROOT/$REPO/config.upstream"
14
15 OWNER=$(git config --file "$GITROOT/$REPO/config.upstream" gitweb.owner)
16 DESC=$(git config --file "$GITROOT/$REPO/config.upstream" gitweb.description)
17 rm -f "$GITROOT/$REPO/config.upstream"
18
19 CUROWNER=$(git config --file "$GITROOT/$REPO/config" gitweb.owner)
20 if [ "$CUROWNER" != "$OWNER" ]; then
21 git config --file "$GITROOT/$REPO/config" gitweb.owner "$OWNER"
22 fi
23
24 CURDESC=$(git config --file "$GITROOT/$REPO/config" gitweb.description)
25 if [ "$CURDESC" != "$DESC" ]; then
26 git config --file "$GITROOT/$REPO/config" gitweb.owner "$DESC"
27 fi

Properties

Name Value
svn:eol-style native
svn:executable *
svn:mime-type text/x-sh

  ViewVC Help
Powered by ViewVC 1.1.30