Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh -e
- #
- # This script creates/updates OpenWRT git mirror. Maintains two repositories:
- # - git-svn managed one
- # - "clean" with selected branches and tags
- #
- REPO_LOCATION=${REPO_LOCATION:-$HOME/openwrt}
- CLEAN_REPO_LOCATION=${CLEAN_REPO_LOCATION:-$HOME/openwrt.clean}
- [ -d $REPO_LOCATION ] || (
- mkdir -p $REPO_LOCATION
- cd $REPO_LOCATION
- git init --bare
- git svn init -s svn://svn.openwrt.org/openwrt/
- git svn fetch
- )
- [ -d $CLEAN_REPO_LOCATION ] || (
- mkdir -p $CLEAN_REPO_LOCATION
- cd $CLEAN_REPO_LOCATION
- git init --bare
- )
- cd $REPO_LOCATION
- git svn fetch
- #
- # Add more branches if needed
- #
- REFS="${REFS} remotes/trunk:refs/heads/trunk"
- REFS="${REFS} remotes/backfire:refs/heads/backfire"
- for ref in $(git for-each-ref --format '%(refname)' refs/remotes/tags/); do
- case "$ref" in
- #
- # Add more excludes if needed
- #
- *BUILDROOT*|*HEAD*|*TESTED*|*kamikaze_pre1*)
- # Old tags removed from Subversion
- ;;
- *@*)
- # Conversion artifacts
- ;;
- *)
- REFS="${REFS} $ref:refs/tags/${ref#refs/remotes/tags/}"
- ;;
- esac
- done
- git push -q $CLEAN_REPO_LOCATION $REFS
Add Comment
Please, Sign In to add comment