From c37c1aae36ad93f934aba571f1aef2523d6b79d5 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 8 Jan 2016 15:20:44 +0000 Subject: [PATCH] Peg hubzilla addons to a specific commit --- src/freedombone | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/freedombone b/src/freedombone index 23c48450..5ef36afa 100755 --- a/src/freedombone +++ b/src/freedombone @@ -196,6 +196,7 @@ HUBZILLA_REPO="https://github.com/redmatrix/hubzilla.git" HUBZILLA_ADDONS_REPO="https://github.com/redmatrix/hubzilla-addons.git" HUBZILLA_ADMIN_PASSWORD= HUBZILLA_COMMIT='761afd029d97703f2f7609d546b7b5f3d257c601' +HUBZILLA_ADDONS_COMMIT='e32f98d65850a8681e8242f3db8b6484abb35c67' # Domain name for git hosting installation GIT_DOMAIN_NAME= @@ -8455,6 +8456,20 @@ function install_hubzilla { else echo "Hubzilla commit:$HUBZILLA_COMMIT" >> $COMPLETION_FILE fi + if grep -q "Hubzilla addons commit" $COMPLETION_FILE; then + CURRENT_HUBZILLA_ADDONS_COMMIT=$(grep "Hubzilla addons commit" $COMPLETION_FILE | awk -F ':' '{print $2}') + if [[ "$CURRENT_HUBZILLA_ADDONS_COMMIT" != "$HUBZILLA_ADDONS_COMMIT" ]]; then + cd /var/www/$HUBZILLA_DOMAIN_NAME/htdocs/addon + git stash + git checkout master + git pull + git checkout $HUBZILLA_ADDONS_COMMIT -b $HUBZILLA_ADDONS_COMMIT + sed -i "s/Hubzilla addons commit.*/Hubzilla addons commit:$HUBZILLA_ADDONS_COMMIT/g" $COMPLETION_FILE + chown -R www-data:www-data /var/www/$HUBZILLA_DOMAIN_NAME/htdocs + fi + else + echo "Hubzilla addons commit:$HUBZILLA_ADDONS_COMMIT" >> $COMPLETION_FILE + fi fi if grep -Fxq "install_hubzilla" $COMPLETION_FILE; then @@ -8487,11 +8502,21 @@ function install_hubzilla { rm -rf /var/www/$HUBZILLA_DOMAIN_NAME/htdocs mv hubzilla /var/www/$HUBZILLA_DOMAIN_NAME/htdocs - chown -R www-data:www-data /var/www/$HUBZILLA_DOMAIN_NAME/htdocs + git clone $HUBZILLA_ADDONS_REPO /var/www/$HUBZILLA_DOMAIN_NAME/htdocs/addon + cd /var/www/$HUBZILLA_DOMAIN_NAME/htdocs/addon + git checkout $HUBZILLA_ADDONS_COMMIT -b $HUBZILLA_ADDONS_COMMIT + if ! grep -q "Hubzilla addons commit" $COMPLETION_FILE; then + echo "Hubzilla addons commit:$HUBZILLA_ADDONS_COMMIT" >> $COMPLETION_FILE + else + sed -i "s/Hubzilla addons commit.*/Hubzilla addons commit:$HUBZILLA_ADDONS_COMMIT/g" $COMPLETION_FILE + fi + # some extra themes git clone https://github.com/DeadSuperHero/redmatrix-themes /var/www/$HUBZILLA_DOMAIN_NAME/htdocs/redmatrix-themes1 cp -r /var/www/$HUBZILLA_DOMAIN_NAME/htdocs/redmatrix-themes1/* view/theme/ + + chown -R www-data:www-data /var/www/$HUBZILLA_DOMAIN_NAME/htdocs fi get_mariadb_hubzilla_admin_password