Branch: null

622cbc8d 2011-11-04 13:16:09 Timothy Pearson
Add scripts directory
A README
diff --git a/README b/README
new file mode 100644
index 0000000..2f1f617
--- /dev/null
+++ b/README
@@ -0,0 +1,2 @@
+All useful GIT helper scripts should go here
+This includes scripts useful to the TDE developers for pushing batch changes, etc.
5020be6d 2011-11-04 15:27:16 Automated System
Add initial update submodules script
A update_all_submodules
diff --git a/update_all_submodules b/update_all_submodules
new file mode 100755
index 0000000..74cdfbd
--- /dev/null
+++ b/update_all_submodules
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+PARENTDIR=$PWD
+echo "Working in $PARENTDIR"
+
+exec 3< submodules
+while read <&3
+do
+	cd $PARENTDIR
+	DIR2UPDATE=$REPLY
+	if [[ $DIR2UPDATE != "" ]]; then
+		echo "Attempting to reset submodule $DIR2UPDATE"
+		cd $PARENTDIR/$DIR2UPDATE/..
+		while [[ ! -d .git ]]; do
+			cd ../
+		done
+		git submodule init
+		git submodule update
+		cd $PARENTDIR/$DIR2UPDATE
+		git reset --hard HEAD
+		git clean -d -x -f
+		git checkout master
+		git pull
+		cd ..
+		while [[ ! -d .git ]]; do
+			cd ../
+		done
+		echo "Committing changes to $PWD"
+		git commit -a -m "Reset submodule to latest HEAD"
+		git push origin master
+	fi
+done
+exec 3>&-
d3ca02e5 2011-11-04 15:32:44 Automated System
Update the update script
M update_all_submodules
diff --git a/update_all_submodules b/update_all_submodules
index 74cdfbd..5f21cfd 100755
--- a/update_all_submodules
+++ b/update_all_submodules
@@ -2,6 +2,13 @@
 
 PARENTDIR=$PWD
 echo "Working in $PARENTDIR"
+if [[ ! -d .git ]]; then
+	echo "Current directory does not contain a .git folder.  Exiting..."
+	exit 1
+fi
+git pull
+git reset --hard HEAD
+git clean -d -x -f
 
 exec 3< submodules
 while read <&3
7337e4a9 2011-11-04 15:45:12 Automated System
Update the update script (again)
M update_all_submodules
diff --git a/update_all_submodules b/update_all_submodules
index 5f21cfd..63b0850 100755
--- a/update_all_submodules
+++ b/update_all_submodules
@@ -33,7 +33,8 @@
 			cd ../
 		done
 		echo "Committing changes to $PWD"
-		git commit -a -m "Reset submodule to latest HEAD"
+#		git commit -a -m "Reset submodule to latest HEAD"
+		git commit $PARENTDIR/$DIR2UPDATE -m "Reset submodule to latest HEAD"
 		git push origin master
 	fi
 done
824ecf74 2011-11-04 15:53:12 Automated System
Update update script yet again
M update_all_submodules
diff --git a/update_all_submodules b/update_all_submodules
index 63b0850..50a0057 100755
--- a/update_all_submodules
+++ b/update_all_submodules
@@ -34,6 +34,7 @@
 		done
 		echo "Committing changes to $PWD"
 #		git commit -a -m "Reset submodule to latest HEAD"
+		git add $PARENTDIR/$DIR2UPDATE
 		git commit $PARENTDIR/$DIR2UPDATE -m "Reset submodule to latest HEAD"
 		git push origin master
 	fi
4e243ce3 2011-11-04 16:13:28 Automated System
Make update script more verbose
M update_all_submodules
diff --git a/update_all_submodules b/update_all_submodules
index 50a0057..41f6679 100755
--- a/update_all_submodules
+++ b/update_all_submodules
@@ -35,7 +35,7 @@
 		echo "Committing changes to $PWD"
 #		git commit -a -m "Reset submodule to latest HEAD"
 		git add $PARENTDIR/$DIR2UPDATE
-		git commit $PARENTDIR/$DIR2UPDATE -m "Reset submodule to latest HEAD"
+		git commit $PARENTDIR/$DIR2UPDATE -m "Reset submodule $DIR2UPDATE to latest HEAD"
 		git push origin master
 	fi
 done
c9f0b9f3 2011-11-04 16:19:42 Automated System
Update the update script one last time
M update_all_submodules
diff --git a/update_all_submodules b/update_all_submodules
index 41f6679..d0bf837 100755
--- a/update_all_submodules
+++ b/update_all_submodules
@@ -1,5 +1,13 @@
 #!/bin/bash
 
+if [[ -e /var/lock/update-tde-git-submodules ]]; then
+        echo "TDE GIT submodules are currently being updated"
+        echo "If this is not the case, please remove the lockfile /var/lock/update-tde-git-submodules"
+        exit 0
+fi
+
+touch /var/lock/update-tde-git-submodules
+
 PARENTDIR=$PWD
 echo "Working in $PARENTDIR"
 if [[ ! -d .git ]]; then
@@ -40,3 +48,8 @@
 	fi
 done
 exec 3>&-
+
+# Let the disk subsystem recover
+sleep 60
+
+rm /var/lock/update-tde-git-submodules
88dfc651 2011-11-05 15:00:50 Timothy Pearson
Add switch_all_submodules_to_head_and_clean script for developers
A switch_all_submodules_to_head_and_clean
diff --git a/switch_all_submodules_to_head_and_clean b/switch_all_submodules_to_head_and_clean
new file mode 100755
index 0000000..15e1076
--- /dev/null
+++ b/switch_all_submodules_to_head_and_clean
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+if [[ ! -d .git ]]; then
+	echo "This script can only be run from a top level git directory.  Exiting..."
+	exit 1
+fi
+
+echo "Preparing $PWD for development use"
+if [[ $1 == "" ]]; then
+	read -p "Enter your TDE GIT username []: " -e gituser
+fi
+
+if [[ $gituser == "" ]]; then
+	gituser="anonymous"
+fi
+
+THISSCRIPT=$(readlink -f $0)
+echo "$THISSCRIPT"
+exit 1
+
+if [[ ! -e "$THISSCRIPT" ]]; then
+	echo "Unable to find myself!  Exiting..."
+	exit 1
+fi
+
+git reset --hard HEAD
+git clean -dxf
+
+if [[ -e .gitmodules ]]; then
+	if [[ $1 == "anonymous" ]]; then
+		sed -i 's/system@//g' .gitmodules
+	else
+		sed -i "s/system@/$1@/g" .gitmodules
+	fi
+
+	git submodule init
+	git submodule update
+	git submodule foreach "'git checkout master && git pull && $THISSCRIPT $1'"
+
+	git checkout -- .gitmodules
+fi
42325576 2011-11-05 15:01:43 Timothy Pearson
Fix last commit
M switch_all_submodules_to_head_and_clean
diff --git a/switch_all_submodules_to_head_and_clean b/switch_all_submodules_to_head_and_clean
index 15e1076..9620d51 100755
--- a/switch_all_submodules_to_head_and_clean
+++ b/switch_all_submodules_to_head_and_clean
@@ -15,8 +15,6 @@
 fi
 
 THISSCRIPT=$(readlink -f $0)
-echo "$THISSCRIPT"
-exit 1
 
 if [[ ! -e "$THISSCRIPT" ]]; then
 	echo "Unable to find myself!  Exiting..."
f9a97d74 2011-11-05 15:06:21 Timothy Pearson
Fix script again
M switch_all_submodules_to_head_and_clean
diff --git a/switch_all_submodules_to_head_and_clean b/switch_all_submodules_to_head_and_clean
index 9620d51..9049344 100755
--- a/switch_all_submodules_to_head_and_clean
+++ b/switch_all_submodules_to_head_and_clean
@@ -33,7 +33,9 @@
 
 	git submodule init
 	git submodule update
-	git submodule foreach "'git checkout master && git pull && $THISSCRIPT $1'"
+	git submodule foreach "git checkout master"
+	git submodule foreach "git pull"
+	git submodule foreach "$THISSCRIPT $1"
 
 	git checkout -- .gitmodules
 fi
a8b9bef5 2011-11-05 16:13:47 Timothy Pearson
Fix switch_all_submodules_to_head_and_clean script
M switch_all_submodules_to_head_and_clean
diff --git a/switch_all_submodules_to_head_and_clean b/switch_all_submodules_to_head_and_clean
index 9049344..5b409b8 100755
--- a/switch_all_submodules_to_head_and_clean
+++ b/switch_all_submodules_to_head_and_clean
@@ -8,6 +8,8 @@
 echo "Preparing $PWD for development use"
 if [[ $1 == "" ]]; then
 	read -p "Enter your TDE GIT username []: " -e gituser
+else
+	gituser=$1
 fi
 
 if [[ $gituser == "" ]]; then
@@ -25,17 +27,17 @@
 git clean -dxf
 
 if [[ -e .gitmodules ]]; then
-	if [[ $1 == "anonymous" ]]; then
+	if [[ $gituser == "anonymous" ]]; then
 		sed -i 's/system@//g' .gitmodules
 	else
-		sed -i "s/system@/$1@/g" .gitmodules
+		sed -i "s/system@/$gituser@/g" .gitmodules
 	fi
 
 	git submodule init
 	git submodule update
 	git submodule foreach "git checkout master"
 	git submodule foreach "git pull"
-	git submodule foreach "$THISSCRIPT $1"
+	git submodule foreach "$THISSCRIPT $gituser"
 
 	git checkout -- .gitmodules
 fi
703e8cc9 2011-11-05 23:43:01 Timothy Pearson
Add preliminary commit all script
A commit_all_submodules
diff --git a/commit_all_submodules b/commit_all_submodules
new file mode 100755
index 0000000..0d53c18
--- /dev/null
+++ b/commit_all_submodules
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+if [[ ! -d .git ]]; then
+	echo "This script can only be run from a top level git directory.  Exiting..."
 ** Diff limit reached (max: 250 lines) **
93bbe206 2011-11-05 23:50:40 Timothy Pearson
Fix commit_all_submodules script
M commit_all_submodules
 ** Diff limit reached (max: 250 lines) **
a2610d4e 2011-11-07 01:10:15 Timothy Pearson
Update the GIT helper scripts
M commit_all_submodules
M switch_all_submodules_to_head_and_clean
 ** Diff limit reached (max: 250 lines) **
9bf803fd 2011-11-08 00:32:09 Timothy Pearson
Fix commit_all_submodules script
M commit_all_submodules
 ** Diff limit reached (max: 250 lines) **
5ead2a2d 2012-03-09 14:24:36 Timothy Pearson
Update commit_all_submodules script
M commit_all_submodules
 ** Diff limit reached (max: 250 lines) **
95dd4739 2012-12-03 20:44:32 Slávek Banko
Updating git scripts
+ add support for gitfile (submodules with git >= 1.7.8)
+ add gituser detection from git configuration
+ add support for branches
+ various optimizations
M commit_all_submodules
M switch_all_submodules_to_head_and_clean
M update_all_submodules
 ** Diff limit reached (max: 250 lines) **
c2cf6015 2012-12-07 20:59:01 Timothy Pearson
Remove ignore-submodules flag from git commands in order to support older GIT versions
M switch_all_submodules_to_head_and_clean
M update_all_submodules
 ** Diff limit reached (max: 250 lines) **
e11c8eac 2012-12-08 14:11:57 Timothy Pearson
Created initial directory structure
A README.GIT
 ** Diff limit reached (max: 250 lines) **
2ad7c092 2012-12-08 14:11:57 Timothy Pearson
Updated GIT readme file
M README.GIT
 ** Diff limit reached (max: 250 lines) **
9220d248 2012-12-08 14:11:57 Timothy Pearson
Added TQt4 HEAD
M README.GIT
 ** Diff limit reached (max: 250 lines) **
2f8d755a 2012-12-08 14:11:57 Timothy Pearson
Update README.GIT file with new GIT tutorial location
M README.GIT
 ** Diff limit reached (max: 250 lines) **
8c91b5f0 2012-12-11 13:40:55 Timothy Pearson
Add astyle options
A astyle/beautify_source_tree
A astyle/tde_astylerc
 ** Diff limit reached (max: 250 lines) **
e36ec815 2012-12-11 14:04:15 Timothy Pearson
Fix script
M astyle/beautify_source_tree
 ** Diff limit reached (max: 250 lines) **
b430a3e4 2013-01-03 19:17:36 Slávek Banko
Added scripts for creating tarballs
A create_all_tarballs
A create_tarball
 ** Diff limit reached (max: 250 lines) **
d5d288f9 2013-02-13 15:53:28 Slávek Banko
create_tarball: Add renaming of rebranded packages
M create_tarball
 ** Diff limit reached (max: 250 lines) **
6a19cd9b 2013-02-13 15:53:36 Slávek Banko
create_tarball: Add option to select compression method
M create_tarball
 ** Diff limit reached (max: 250 lines) **
f18522cf 2013-03-05 15:16:12 Slávek Banko
create_tarball: Remove unneeded renaming of rebranded packages
M create_tarball
 ** Diff limit reached (max: 250 lines) **
f7f29b7c 2013-04-22 07:56:07 Slávek Banko
create_tarball: Fix wrong path transformation in symlinks
M create_tarball
 ** Diff limit reached (max: 250 lines) **
7e23a1ee 2013-05-04 19:30:01 Slávek Banko
Added ignore-submodules flag, depending on the GIT version
M switch_all_submodules_to_head_and_clean
M update_all_submodules
 ** Diff limit reached (max: 250 lines) **
a48d32b2 2013-08-18 04:31:18 Slávek Banko
create_tarball: Add support for multithreaded compressors
M create_tarball
 ** Diff limit reached (max: 250 lines) **
c5010d96 2014-03-30 19:59:49 Slávek Banko
create_tarball: Add automatic creation of SCM metadata
M create_tarball
 ** Diff limit reached (max: 250 lines) **
45dd8325 2014-12-09 14:46:50 Slávek Banko
create_tarball: Sort tags as version numbers instead of as text

Signed-off-by: Slávek Banko <slavek.banko@...>
M create_tarball
 ** Diff limit reached (max: 250 lines) **