From 35278c9895401a728a0f31ce9afb4dcbb0a3c64f Mon Sep 17 00:00:00 2001
From: rahulp13
Date: Thu, 19 Dec 2019 11:46:33 +0530
Subject: abort installation on apt errors
---
install-eSim.sh | 28 +++++++++++++++++++++-------
1 file changed, 21 insertions(+), 7 deletions(-)
diff --git a/install-eSim.sh b/install-eSim.sh
index 948e36f2..50e35c48 100755
--- a/install-eSim.sh
+++ b/install-eSim.sh
@@ -15,7 +15,7 @@
# NOTES: ---
# AUTHOR: Fahim Khan, Rahul Paknikar, Saurabh Bansode
# ORGANIZATION: FOSSEE at IIT Bombay.
-# CREATED: Wednesday 26 November 2019 16:14
+# CREATED: Wednesday 18 December 2019 16:14
# REVISION: ---
#===============================================================================
@@ -56,7 +56,7 @@ function installNghdl
./install-nghdl.sh --install
if [ $? -ne 0 ];then
- echo -e "\n\n\nNghdl ERROR: Error while installing nghdl\n\n"
+ echo -e "\n\nNghdl ERROR: Error while installing nghdl\n\n"
exit 0
else
ngspiceFlag=1
@@ -84,19 +84,33 @@ function addKicadPPA
sudo add-apt-repository --yes ppa:js-reynaud/kicad-4
sudo apt-get update
else
- echo "Kicad-4 is available in synaptic"
+ echo "KiCad-4 is available in synaptic"
fi
}
function installDependency
{
- echo "Installing Kicad............"
+ echo "Installing KiCad............"
sudo apt-get install -y kicad
+ if [ $? -ne 0 ]; then
+ echo -e "\n\nKiCad couldn't be installed.\nKindly resolve above APT repository errors and try again."
+ exit 1
+ fi
+
echo "Installing PyQt4............"
sudo apt-get install -y python-qt4
+ if [ $? -ne 0 ]; then
+ echo -e "\n\nPyQt-4 dependency couldn't be installed.\nKindly resolve above APT repository errors and try again."
+ exit 1
+ fi
+
echo "Installing Matplotlib......."
sudo apt-get install -y python-matplotlib
+ if [ $? -ne 0 ]; then
+ echo -e "\n\nMatplotlib dependency couldn't be installed.\nKindly resolve above APT repository errors and try again."
+ exit 1
+ fi
}
@@ -114,7 +128,7 @@ function copyKicadLibrary
echo "fp-lib-table copied in the directory"
sudo cp -r src/.OfflineFiles/TerminalBlock_Altech_AK300-2_P5.00mm.kicad_mod /usr/share/kicad/modules/Connectors_Terminal_Blocks.pretty/
sudo cp -r src/.OfflineFiles/TO-220-3_Vertical.kicad_mod /usr/share/kicad/modules/TO_SOT_Packages_THT.pretty/
- #Copy Kicad library made for eSim
+ #Copy KiCad library made for eSim
sudo cp -r kicadSchematicLibrary/*.lib /usr/share/kicad/library/
sudo cp -r kicadSchematicLibrary/*.dcm /usr/share/kicad/library/
@@ -268,7 +282,7 @@ elif [ $option == "--uninstall" ];then
if [ $getConfirmation == "y" -o $getConfirmation == "Y" ];then
echo "Deleting Files................"
sudo rm -rf $HOME/.esim $HOME/.config/kicad $HOME/Desktop/esim.desktop esim-start.sh esim.desktop /usr/bin/esim
- echo "Removing Kicad................"
+ echo "Removing KiCad................"
sudo apt-get remove -y kicad
echo "Removing NGHDL................"
rm -rf src/modelParamXML/Nghdl/*
@@ -293,4 +307,4 @@ else
echo "Please select the proper operation."
echo "--install"
echo "--uninstall"
-fi
\ No newline at end of file
+fi
--
cgit
From 41b69cea94cb3421bee02364c73ac3baeb8f77ec Mon Sep 17 00:00:00 2001
From: rahulp13
Date: Thu, 19 Dec 2019 12:50:34 +0530
Subject: update script
---
install-eSim.sh | 34 ++++++++++++++++++----------------
1 file changed, 18 insertions(+), 16 deletions(-)
diff --git a/install-eSim.sh b/install-eSim.sh
index 50e35c48..bebcf700 100755
--- a/install-eSim.sh
+++ b/install-eSim.sh
@@ -1,10 +1,9 @@
#!/bin/bash
#===============================================================================
-#
# FILE: install-eSim.sh
#
# USAGE: ./install-eSim.sh --install
-# or
+# OR
# ./install-eSim.sh --uninstall
#
# DESCRIPTION: This is installation/uninstallation script for eSim
@@ -49,14 +48,14 @@ function createConfigFile
function installNghdl
{
- echo "Installing nghdl............"
+ echo "Installing NGHDL............"
unzip nghdl-master.zip
mv nghdl-master nghdl
cd nghdl/
./install-nghdl.sh --install
if [ $? -ne 0 ];then
- echo -e "\n\nNghdl ERROR: Error while installing nghdl\n\n"
+ echo -e "\n\nThere was some error while installing NGHDL\n\n"
exit 0
else
ngspiceFlag=1
@@ -80,7 +79,7 @@ function addKicadPPA
grep -h "^deb.*$kicadppa*" /etc/apt/sources.list.d/* > /dev/null 2>&1
if [ $? -ne 0 ]
then
- echo "Adding kicad-4 PPA to install latest ghdl version"
+ echo "Adding KiCad-4 PPA to local apt-repository"
sudo add-apt-repository --yes ppa:js-reynaud/kicad-4
sudo apt-get update
else
@@ -94,21 +93,21 @@ function installDependency
echo "Installing KiCad............"
sudo apt-get install -y kicad
if [ $? -ne 0 ]; then
- echo -e "\n\nKiCad couldn't be installed.\nKindly resolve above APT repository errors and try again."
+ echo -e "\n\n\"KiCad\" couldn't be installed.\nKindly resolve above \"apt-get\" errors and try again."
exit 1
fi
echo "Installing PyQt4............"
sudo apt-get install -y python-qt4
if [ $? -ne 0 ]; then
- echo -e "\n\nPyQt-4 dependency couldn't be installed.\nKindly resolve above APT repository errors and try again."
+ echo -e "\n\n\"PyQt4\" dependency couldn't be installed.\nKindly resolve above \"apt-get\" errors and try again."
exit 1
fi
echo "Installing Matplotlib......."
sudo apt-get install -y python-matplotlib
if [ $? -ne 0 ]; then
- echo -e "\n\nMatplotlib dependency couldn't be installed.\nKindly resolve above APT repository errors and try again."
+ echo -e "\n\n\"Matplotlib\" dependency couldn't be installed.\nKindly resolve above \"apt-get\" errors and try again."
exit 1
fi
@@ -266,7 +265,7 @@ if [ $option == "--install" ];then
exit 0
fi
- echo "-----------------eSim installed Successfully-----------------"
+ echo "-----------------eSim Installed Successfully-----------------"
echo "Type \"esim\" in Terminal to launch it"
echo "or double click on \"eSim\" icon placed on Desktop"
@@ -277,7 +276,7 @@ if [ $option == "--install" ];then
elif [ $option == "--uninstall" ];then
- echo -n "Are you sure? It will remove complete eSim including KiCad, Ngspice, NGHDL, your subcircuit and model library packages(y/n):"
+ echo -n "Are you sure? It will remove complete eSim including KiCad, Ngspice, NGHDL and model library packages(y/n):"
read getConfirmation
if [ $getConfirmation == "y" -o $getConfirmation == "Y" ];then
echo "Deleting Files................"
@@ -287,14 +286,17 @@ elif [ $option == "--uninstall" ];then
echo "Removing NGHDL................"
rm -rf src/modelParamXML/Nghdl/*
cd nghdl/
- ./install-nghdl.sh --uninstall
- cd ../
- rm -rf nghdl
-
if [ $? -eq 0 ];then
- echo "Uninstalled successfully"
+ ./install-nghdl.sh --uninstall
+ cd ../
+ rm -rf nghdl
+ if [ $? -eq 0 ];then
+ echo -e "----------------eSim Uninstalled Successfully----------------"
+ else
+ echo -e "\nError while removing some files/directories in \"nghdl\". Please remove it manually"
+ fi
else
- echo "Error while removing some file/directory. Please remove it manually"
+ echo -e "\nCannot find \"nghdl\" directory. Please remove it manually"
fi
elif [ $getConfirmation == "n" -o $getConfirmation == "N" ];then
exit 0
--
cgit
From b9f819633a2667a6dd4b2e8d5fe785ff1c5a75ca Mon Sep 17 00:00:00 2001
From: rahulp13
Date: Mon, 23 Dec 2019 15:33:28 +0530
Subject: absolute path for fp-lib-table swaps
---
src/frontEnd/Application.py | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py
index a610a013..808634cc 100755
--- a/src/frontEnd/Application.py
+++ b/src/frontEnd/Application.py
@@ -96,8 +96,6 @@ class Application(QtGui.QMainWindow):
self.closeproj.setShortcut('Ctrl+X')
self.closeproj.triggered.connect(self.close_project)
-
-
for file in os.listdir(os.getenv('HOME') + "/.config/kicad"):
if file.startswith("fp-lib-table"):
if file.endswith("offline"):
@@ -252,6 +250,7 @@ class Application(QtGui.QMainWindow):
self.obj_Mainview.obj_projectExplorer.addTreeNode(directory, filelist)
except:
pass
+
def help_project(self):
print "Function : Help"
@@ -260,18 +259,17 @@ class Application(QtGui.QMainWindow):
self.obj_Mainview.obj_dockarea.usermanual()
-
def go_online_offline(self):
if not self.obj_kicad.check_open_schematic():
if self.online_flag:
- os.rename("../../../../.config/kicad/fp-lib-table", "../../../../.config/kicad/fp-lib-table-online")
- os.rename("../../../../.config/kicad/fp-lib-table-offline", "../../../../.config/kicad/fp-lib-table")
+ os.rename(os.getenv('HOME') + "/.config/kicad/fp-lib-table", os.getenv('HOME') + "/.config/kicad/fp-lib-table-online")
+ os.rename(os.getenv('HOME') + "/.config/kicad/fp-lib-table-offline", os.getenv('HOME') + "/.config/kicad/fp-lib-table")
self.webConnect.setIcon(QtGui.QIcon('../../images/offline.png'))
self.webConnect.setText('Go Online')
self.online_flag = False
else:
- os.rename("../../../../.config/kicad/fp-lib-table", "../../../../.config/kicad/fp-lib-table-offline")
- os.rename("../../../../.config/kicad/fp-lib-table-online", "../../../../.config/kicad/fp-lib-table")
+ os.rename(os.getenv('HOME') + "/.config/kicad/fp-lib-table", os.getenv('HOME') + "/.config/kicad/fp-lib-table-offline")
+ os.rename(os.getenv('HOME') + "/.config/kicad/fp-lib-table-online", os.getenv('HOME') + "/.config/kicad/fp-lib-table")
self.webConnect.setIcon(QtGui.QIcon('../../images/online.png'))
self.webConnect.setText('Go Offline')
self.online_flag = True
--
cgit