2015-01-15 13:59:12 +01:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# Creates the .gitignore file in the Modules to ignore the symlinks
|
|
|
|
#
|
|
|
|
# Tue Jan 13 14:18:05 CET 2015
|
|
|
|
#
|
|
|
|
|
2015-06-08 14:49:10 +02:00
|
|
|
if [[ -z ${QP_ROOT} ]]
|
2015-03-25 23:03:51 +01:00
|
|
|
then
|
2015-06-08 14:49:10 +02:00
|
|
|
print "The QP_ROOT environment variable is not set."
|
2015-03-25 23:03:51 +01:00
|
|
|
print "Please reload the quantum_package.rc file."
|
|
|
|
exit -1
|
|
|
|
fi
|
2015-06-08 14:49:10 +02:00
|
|
|
source ${QP_ROOT}/scripts/qp_include.sh
|
2015-03-25 23:03:51 +01:00
|
|
|
|
|
|
|
|
2015-06-02 18:17:59 +02:00
|
|
|
function do_gitingore()
|
|
|
|
{
|
|
|
|
cat << EOF > .gitignore
|
2015-01-15 13:59:12 +01:00
|
|
|
#
|
|
|
|
# Do not modify this file. Add your ignored files to the gitignore
|
|
|
|
# (without the dot at the beginning) file.
|
|
|
|
#
|
2015-07-04 00:11:06 +02:00
|
|
|
build.ninja
|
|
|
|
irpf90_entities
|
2015-01-15 13:59:12 +01:00
|
|
|
irpf90.make
|
2015-07-04 00:11:06 +02:00
|
|
|
IRPF90_man
|
|
|
|
IRPF90_temp
|
2015-01-15 13:59:12 +01:00
|
|
|
Makefile.depend
|
2015-06-02 18:17:59 +02:00
|
|
|
.ninja_deps
|
2015-07-04 00:11:06 +02:00
|
|
|
.ninja_log
|
|
|
|
tags
|
2015-01-15 13:59:12 +01:00
|
|
|
EOF
|
2015-06-02 18:17:59 +02:00
|
|
|
|
|
|
|
if [[ -f gitignore ]]
|
|
|
|
then
|
|
|
|
cat gitignore >> .gitignore
|
|
|
|
fi
|
|
|
|
|
|
|
|
find . -type l | sed "s@./@@" >> .gitignore
|
|
|
|
find . -type f -executable -print | sed "s@./@@" >> .gitignore
|
|
|
|
}
|
2015-01-15 13:59:12 +01:00
|
|
|
|
2015-06-02 18:17:59 +02:00
|
|
|
|
|
|
|
if [[ -z $1 ]]
|
2015-01-15 13:59:12 +01:00
|
|
|
then
|
2015-06-02 18:17:59 +02:00
|
|
|
check_current_dir_is_module
|
|
|
|
do_gitingore
|
|
|
|
else
|
|
|
|
check_current_dir_is_src
|
|
|
|
for i in $@
|
|
|
|
do
|
|
|
|
if [[ -d $i ]]
|
|
|
|
then
|
|
|
|
cd $i
|
|
|
|
do_gitingore
|
|
|
|
cd $OLDPWD
|
|
|
|
fi
|
|
|
|
done
|
2015-01-15 13:59:12 +01:00
|
|
|
fi
|
|
|
|
|
2015-07-04 00:11:06 +02:00
|
|
|
# Sort the .gitignore to reduce conflict in git merges
|
|
|
|
sort .gitignore |uniq > .gitignore.new
|
|
|
|
mv .gitignore.new .gitignore
|