From bad674b891fe3b58679768b9788d927d8983f1f4 Mon Sep 17 00:00:00 2001 From: Yun Qu Date: Thu, 21 Jul 2016 09:47:51 -0700 Subject: [PATCH] update scripts --- .gitignore | 5 +++++ ubuntu/scripts/update_docs.sh | 18 ++++++++++++------ ubuntu/scripts/update_pynq.sh | 3 +-- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 82e4e7fffc..6740cb13c8 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,11 @@ # Packages ############ +# Windows Thumbnail +############ +Thumbs.db +thumbs.db + # Logs and Databases ###################### *.log diff --git a/ubuntu/scripts/update_docs.sh b/ubuntu/scripts/update_docs.sh index 8ab3539e63..de9cd3460b 100755 --- a/ubuntu/scripts/update_docs.sh +++ b/ubuntu/scripts/update_docs.sh @@ -2,6 +2,7 @@ REPO_DIR=/home/xpp/pynq_git PYNQ_DIR=/usr/local/lib/python3.4/dist-packages/pynq +BACKUP_DIR=/home/xpp/pynq_backup FINAL_DOCS_DIR=/home/xpp/docs FINAL_NOTEBOOKS_DIR=/home/xpp/jupyter_notebooks @@ -36,21 +37,26 @@ if ! [ $(id -u) = 0 ]; then exit 1 fi -if [ -d $REPO_DIR ]; then - echo "plesae manually remove ${REPO_DIR} before running this script." - echo "rm -rf ${REPO_DIR}" +if [ -d $REPO_DIR ] || [ -d $BACKUP_DIR ] ; then + echo "" + echo "please manually remove git backup folders before running this script." + echo "rm -rf ${REPO_DIR} ${BACKUP_DIR}" echo "" exit 1 fi - -echo "1. Build docs" + +echo "1. Backing up files into ${BACKUP_DIR}" +mkdir $BACKUP_DIR +cp -r $FINAL_DOCS_DIR $FINAL_NOTEBOOKS_DIR $FINAL_SCRIPTS_DIR $BACKUP_DIR + +echo "2. Build docs" git clone https://github.com/Xilinx/PYNQ $REPO_DIR cd $REPO_DIR/docs sphinx-apidoc -f -o ./source $PYNQ_DIR python3 ipynb_post_processor.py make clean ; make html -echo "2. Transfer Git files into final filesystem with correct ownership" +echo "3. Transfer Git files into final filesystem with correct ownership" rm -rf $FINAL_DOCS_DIR/* $FINAL_NOTEBOOKS_DIR/* cp -r $REPO_DIR/docs/build/html/* $FINAL_DOCS_DIR cp -r $REPO_DIR/$BOARD/notebooks/* $FINAL_NOTEBOOKS_DIR diff --git a/ubuntu/scripts/update_pynq.sh b/ubuntu/scripts/update_pynq.sh index d084ab06fb..cb02d3200f 100755 --- a/ubuntu/scripts/update_pynq.sh +++ b/ubuntu/scripts/update_pynq.sh @@ -1,8 +1,7 @@ #!/bin/bash - SCRIPT_NAME=`basename "$0"` -BACKUP_DIR=/home/xpp/pynq_update_backup +BACKUP_DIR=/home/xpp/pynq_backup REPO_DIR=/home/xpp/pynq_git PYNQ_DIR=/usr/local/lib/python3.4/dist-packages/pynq