Try to fix profanity omemo plugin

This commit is contained in:
Bob Mottram 2017-02-09 21:41:38 +00:00
parent 17f961a379
commit 7f0a93e467
1 changed files with 24 additions and 6 deletions

View File

@ -214,6 +214,9 @@ function add_user_xmpp {
echo '[connection]' > /home/$new_username/.config/profanity/profrc
echo "account=${new_username}@${HOSTNAME}" >> /home/$new_username/.config/profanity/profrc
echo '' >> /home/$new_username/.config/profanity/profrc
echo '[plugins]' >> /home/$new_username/.config/profanity/profrc
echo 'load=prof_omemo_plugin.py;' >> /home/$new_username/.config/profanity/profrc
chown -R $new_username:$new_username /home/$new_username/.local
chown -R $new_username:$new_username /home/$new_username/.config
@ -361,17 +364,26 @@ function upgrade_xmpp_client {
# upgrade omemo plugins for all users
set_repo_commit $INSTALL_DIR/profanity-omemo-plugin "profanity omemo plugin commit" "$PROFANITY_OMEMO_PLUGIN_COMMIT" $PROFANITY_OMEMO_PLUGIN_REPO
cd $INSTALL_DIR/profanity-omemo-plugin
sed -i 's|python setup.py|python2.7 setup.py|g' $INSTALL_DIR/profanity-omemo-plugin/install.sh
./install.sh
for d in /home/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
if [ ! -d /home/$USERNAME/.local/share/profanity/plugins ]; then
mkdir -p /home/$USERNAME/.local/share/profanity/plugins
fi
cp $INSTALL_DIR/profanity-omemo-plugin/omemo.py /home/$USERNAME/.local/share/profanity/plugins
if [ -f $INSTALL_DIR/profanity-omemo-plugin/omemo.py ]; then
rm $INSTALL_DIR/profanity-omemo-plugin/omemo.*
fi
cp $INSTALL_DIR/profanity-omemo-plugin/deploy/prof_omemo_plugin.py /home/$USERNAME/.local/share/profanity/plugins
chown -R $USERNAME:$USERNAME /home/$USERNAME/.local
fi
done
cp $INSTALL_DIR/profanity-omemo-plugin/omemo.py /etc/skel/.local/share/profanity/plugins
if [ -f /etc/skel/.local/share/profanity/plugins/omemo.py ]; then
rm /etc/skel/.local/share/profanity/plugins/omemo.*
fi
cp $INSTALL_DIR/profanity-omemo-plugin/deploy/prof_omemo_plugin.py /etc/skel/.local/share/profanity/plugins
}
function upgrade_xmpp {
@ -976,17 +988,20 @@ function install_xmpp_client {
fi
# install the omemo plugin
apt-get -yq install python-pip python-setuptools clang libffi-dev libssl-dev
git_clone $PROFANITY_OMEMO_PLUGIN_REPO $INSTALL_DIR/profanity-omemo-plugin
cd $INSTALL_DIR/profanity-omemo-plugin
git checkout $PROFANITY_OMEMO_PLUGIN_COMMIT -b $PROFANITY_OMEMO_PLUGIN_COMMIT
if [ ! -f $INSTALL_DIR/profanity-omemo-plugin/omemo.py ]; then
echo $'omemo.py not found'
if [ ! -f $INSTALL_DIR/profanity-omemo-plugin/deploy/prof_omemo_plugin.py ]; then
echo $'prof_omemo_plugin.py not found'
exit 389225
fi
sed -i 's|python setup.py|python2.7 setup.py|g' $INSTALL_DIR/profanity-omemo-plugin/install.sh
./install.sh
mkdir -p /etc/skel/.local/share/profanity/plugins
cp $INSTALL_DIR/profanity-omemo-plugin/omemo.py /etc/skel/.local/share/profanity/plugins
cp $INSTALL_DIR/profanity-omemo-plugin/omemo.py /home/$MY_USERNAME/.local/share/profanity/plugins
cp $INSTALL_DIR/profanity-omemo-plugin/deploy/prof_omemo_plugin.py /etc/skel/.local/share/profanity/plugins
cp $INSTALL_DIR/profanity-omemo-plugin/deploy/prof_omemo_plugin.py /home/$MY_USERNAME/.local/share/profanity/plugins
chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.local
XMPP_CLIENT_DIR=/home/$MY_USERNAME/.local/share/profanity
@ -1049,6 +1064,9 @@ function install_xmpp_client {
fi
echo '[connection]' > /home/$MY_USERNAME/.config/profanity/profrc
echo "account=${MY_USERNAME}@${DEFAULT_DOMAIN_NAME}" >> /home/$MY_USERNAME/.config/profanity/profrc
echo '' >> /home/$MY_USERNAME/.config/profanity/profrc
echo '[plugins]' >> /home/$MY_USERNAME/.config/profanity/profrc
echo 'load=prof_omemo_plugin.py;' >> /home/$MY_USERNAME/.config/profanity/profrc
chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.local
chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.config