Skip to content
Snippets Groups Projects
Commit f706a4a6 authored by Dilawar Singh's avatar Dilawar Singh
Browse files

Added moosegui scipt.

parent 9d5c34ef
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env bash
(
cd ..
debuild -uc -us | tee $0.log
)
#!/usr/bin/env bash
# This script is for launchpad.
(
set -e
set -o xtrace
cd ..
cat > moose.recipe <<EOF
# bzr-builder format 0.3 deb-version {debupstream}+{revno}
lp:moose
EOF
# one can do nesting here.
if [ $# -gt 0 ]; then
if [[ "$1" == "update" ]]; then
echo "Fetching repo and creating tar-ball"
bzr dailydeb --allow-fallback-to-native moose.recipe .. | tee $0.log
elif [[ "$1" == "pbuilder" ]]; then
bzr dailydeb --allow-fallback-to-native moose.recipe .. | tee $0.log
sudo -E pbuilder build ../*.dsc | tee $0.log
exit
fi
fi
tarFile=`find .. -type f -maxdepth 1 -name "moose_3.0*.tar.gz"`
echo "Found tarfiles are $tarFile"
if [[ ! $tarFile ]]; then
echo "I could not file a tar.gz file. Can't continue"
echo "++ Cleaning previous mess"
rm -rf ../moose_3.0* ../moose-{*
echo "++ Let me download a fresh one"
bzr dailydeb --allow-fallback-to-native moose.recipe .. | tee $0.log
fi
rm -f moose.recipe
echo "Building debian package"
bzr builddeb -- -uc -us | tee $0.log
)
#!/bin/bash
set -e
# This creates a package for pip. For testing purpose
moose_dir=moose-3.0
(
cd ..
svn export --force . scripts/$moose_dir
)
(
cp setup.py $moose_dir/
cd $moose_dir
echo "Creating new archive"
if [ -f dist/$moose_dir.tar.gz ]; then
rm -f dist/*.tar.gz
fi
python setup.py sdist -vv | tee $0.log
echo "Created new archive"
sudo pip install dist/*.tar.gz --no-clean | tee $0.log
echo "Do the rest in $moose_dir"
)
#!/usr/bin/env python
"""cmake_sanity_check.py: Check if Cmake files are ok.
Last modified: Sat Jan 18, 2014 05:01PM
"""
__author__ = "Dilawar Singh"
__copyright__ = "Copyright 2013, Dilawar Singh and NCBS Bangalore"
__credits__ = ["NCBS Bangalore"]
__license__ = "GNU GPL"
__version__ = "1.0.0"
__maintainer__ = "Dilawar Singh"
__email__ = "dilawars@ncbs.res.in"
__status__ = "Development"
import sys
import os
import re
from collections import defaultdict
makefiles = {}
cmakefiles = {}
makedirs = set()
cmakedirs = set()
def check(d):
searchMakefiles(d)
checkMissingCMake()
checkSrcs()
def checkMissingCMake():
if (makedirs - cmakedirs):
print("[Failed] Test 1")
print("Following directories have Makefile but not a CMakeFiles.txt file.")
print("%s" % "\t\n".join(makedirs - cmakedirs))
def searchMakefiles(d):
for d, subd, fs in os.walk(d):
if "CMakeLists.txt" in fs:
cmakedirs.add(d)
cmakefiles[d] = fs
if "Makefile" in fs:
makedirs.add(d)
makefiles[d] = fs
else: pass
def checkSrcs():
objPat = re.compile(r"\w+\.o")
srcPat = re.compile(r"\w+\.cpp")
srcs = []
csrcs = []
for d in makefiles:
with open(os.path.join(d, "Makefile"), "r") as f:
txt = f.read()
srcs = objPat.findall(txt)
try:
with open(os.path.join(d, "CMakeLists.txt"), "r") as f:
txt = f.read()
csrcs = srcPat.findall(txt)
except:
print("Dir {} does not have CMakeLists.txt".format(d))
csrcs = []
#print("[TEST 2] Checking if CMake is creating extra objects")
for csr in csrcs:
objName = csr.replace(".cpp", ".o")
if objName in srcs:
pass
else:
#print(" Failed: In dir {}, CMake is creating extra object {}".format(d, objName))
pass
print("[TEST 3] Checking if CMake is missing some objects")
for obj in srcs:
srcName = obj.replace(".o", ".cpp")
if srcName in csrcs: pass
else:
print(" Failed: In dir {}, CMake is missing object {}".format(d,
srcName))
def main():
dir = sys.argv[1]
check(dir)
if __name__ == '__main__':
main()
#!/bin/bash
( cd /usr/share/moose/gui && python mgui.py )
#!/bin/bash
set -e
set -x
(
cd ..
mkdir -p _build
cd _build
cmake ..
make | tee $0.log
cpack -G DEB
sudo dpkg -i moose*.deb
moosegui
)
#!/usr/bin/env bash
# This script is for launchpad.
(
set -e
set -o xtrace
cd ..
cat > moose.recipe <<EOF
# bzr-builder format 0.3 deb-version {debupstream}+{revno}
lp:moose
EOF
# one can do nesting here.
if [ $# -gt 0 ]; then
if [[ "$1" == "update" ]]; then
echo "Fetching repo and creating tar-ball"
bzr dailydeb --allow-fallback-to-native moose.recipe .. | tee $0.log
elif [[ "$1" == "pbuilder" ]]; then
bzr dailydeb --allow-fallback-to-native moose.recipe .. | tee $0.log
sudo -E pbuilder build ../*.dsc | tee $0.log
exit
fi
fi
tarFile=`find .. -type f -maxdepth 1 -name "moose_3.0*.tar.gz"`
echo "Found tarfiles are $tarFile"
if [[ ! $tarFile ]]; then
echo "I could not file a tar.gz file. Can't continue"
echo "++ Cleaning previous mess"
rm -rf ../moose_3.0* ../moose-{*
echo "++ Let me download a fresh one"
bzr dailydeb --allow-fallback-to-native moose.recipe .. | tee $0.log
fi
rm -f moose.recipe
echo "Building debian package"
bzr builddeb -- -uc -us | tee $0.log
)
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment