Skip to content

Instantly share code, notes, and snippets.

@mintindeed
Created January 22, 2013 23:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mintindeed/4600002 to your computer and use it in GitHub Desktop.
Save mintindeed/4600002 to your computer and use it in GitHub Desktop.
#!/bin/bash
WP_UPGRADE_ROOT="/cygdrive/r/bgr/wordpress-3.3.1"
SITE_ROOT="/cygdrive/r/bgr/bgr2010"
PATCH_ROOT="/cygdrive/r/bgr"
DRY_RUN=01
if [[ "$DRY_RUN" -eq "0" ]] ; then
DRY_RUN=""
else
DRY_RUN="--dry-run"
echo "*** DRY RUN ***"
fi
rsync $DRY_RUN -crWmhPi --delete --force --exclude=".svn" $WP_UPGRADE_ROOT/wp-admin $SITE_ROOT
rsync $DRY_RUN -crWmhPi --delete --force --exclude=".svn" $WP_UPGRADE_ROOT/wp-includes $SITE_ROOT
rsync $DRY_RUN -crWmhPi --delete --force --exclude=".svn" $WP_UPGRADE_ROOT/wp-content/themes/twentyten $SITE_ROOT/wp-content/themes
rsync $DRY_RUN -crWmhPi --delete --force --exclude=".svn" $WP_UPGRADE_ROOT/wp-content/themes/twentyeleven $SITE_ROOT/wp-content/themes
mv -v $SITE_ROOT/wp-config.php $SITE_ROOT/SAVE-wp-config.php
rm -v -f $SITE_ROOT/wp-*.php $SITE_ROOT/index.php $SITE_ROOT/xmlrpc.php $SITE_ROOT/license.txt $SITE_ROOT/readme.html
cp -v $WP_UPGRADE_ROOT/wp-*.php $WP_UPGRADE_ROOT/index.php $WP_UPGRADE_ROOT/xmlrpc.php $WP_UPGRADE_ROOT/license.txt $WP_UPGRADE_ROOT/readme.html $SITE_ROOT
mv -v $SITE_ROOT/SAVE-wp-config.php $SITE_ROOT/wp-config.php
echo "Patching query.php..."
patch --verbose -i $PATCH_ROOT/query.php_2012-01-05.patch $SITE_ROOT/wp-includes/query.php
if [[ "$?" -ne "0" ]] ; then
echo "Patch failed!"
fi
##rsync $DRY_RUN -crWmhPi --delete --force --exclude=".svn" $WP_UPGRADE_ROOT/wp-admin $SITE_ROOT
##rsync $DRY_RUN --delete --force --exclude=".svn" /Users/gabrielk/Downloads/wordpress/wp-includes /Users/gabrielk/Sites/BGR/bgr2010
##
##cp -Rp /Users/gabrielk/Downloads/wordpress/wp-content/themes/twentyeleven /Users/gabrielk/Sites/BGR/bgr2010/wp-content/themes/
##
##rm -f /Users/gabrielk/Sites/BGR/bgr2010/wp-*.php /Users/gabrielk/Sites/BGR/bgr2010/index.php /Users/gabrielk/Sites/BGR/bgr2010/xmlrpc.php /Users/gabrielk/Sites/BGR/bgr2010/license.txt /Users/gabrielk/Sites/BGR/bgr2010/readme.html
##
##cp /Users/gabrielk/Downloads/wordpress/*.php /Users/gabrielk/Sites/BGR/bgr2010/
##[13:05:51] Gabriel Koen: /Users/gabrielk/Downloads/wordpress == new version of WordPress directory
##/Users/gabrielk/Sites/BGR/bgr2010 == svn working copy directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment