diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2012-12-16 02:34:47 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2012-12-16 02:34:47 +0100 |
commit | de3145b4cc657c6b99edd353d21a5ddc9b8a9316 (patch) | |
tree | bf988a78a7705ec47d72bd291c315015c746f550 /scripts | |
parent | 75279997a1ebadf976c4684709e4312fdfa23c26 (diff) | |
download | tde-de3145b4cc657c6b99edd353d21a5ddc9b8a9316.tar.gz tde-de3145b4cc657c6b99edd353d21a5ddc9b8a9316.zip |
Switch scripts into its own GIT repository
Switch main/thirdparty into its own GIT repository
Diffstat (limited to 'scripts')
m--------- | scripts | 0 | ||||
-rw-r--r-- | scripts/README | 2 | ||||
-rwxr-xr-x | scripts/commit_all_submodules | 48 | ||||
-rwxr-xr-x | scripts/switch_all_submodules_to_head_and_clean | 60 | ||||
-rwxr-xr-x | scripts/update_all_submodules | 70 |
5 files changed, 0 insertions, 180 deletions
diff --git a/scripts b/scripts new file mode 160000 +Subproject b0a915240f92352cf9675146940d045f76ee774 diff --git a/scripts/README b/scripts/README deleted file mode 100644 index 2f1f6175e..000000000 --- a/scripts/README +++ /dev/null @@ -1,2 +0,0 @@ -All useful GIT helper scripts should go here -This includes scripts useful to the TDE developers for pushing batch changes, etc. diff --git a/scripts/commit_all_submodules b/scripts/commit_all_submodules deleted file mode 100755 index c754640e7..000000000 --- a/scripts/commit_all_submodules +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -if [[ ! -e .git ]] || - [[ -z "`git rev-parse --git-dir 2>/dev/null`" ]]; then - echo "This script can only be run from a top level git directory. Exiting..." - exit 1 -fi - -branch=`git symbolic-ref -q HEAD | sed "s|^refs/heads/||"` -if [[ -z "$branch" ]] || - [[ -z "`git rev-parse --symbolic-full-name --remotes=\"*/$branch\"`" ]]; then - echo "There is not active upstream branch. Exiting..." - exit 1 -fi - -echo "Preparing $PWD for development use" -if [[ $1 == "" ]]; then - gituser=`sed -n "/^\[remote \"origin\"\]/,/url/s/\turl = http:\/\/\([^@]*\)@.*/\1/p" <\`git rev-parse --git-dir\`/config | grep -v "\(anonymous\|system\)"` -else - gituser=$1 -fi - -if [[ $gituser == "" ]]; then - read -p "Enter your TDE GIT username []: " -e gituser -fi - -if [[ $gituser == "" ]]; then - gituser="anonymous" -fi - -read -p "Enter your commit message []: " -e commitmessage - -git submodule foreach "git commit -a -m \"$commitmessage\" || true" -git submodule foreach "sed -i \"s/system@scm\.trinitydesktop\.org/$gituser@scm\.trinitydesktop\.org/g\" \`git rev-parse --git-dir\`/config" -git submodule foreach "git pull &&\ - [[ \"\`git rev-parse HEAD\`\" == \"\`git rev-parse origin/$branch\`\" ]] ||\ - git push origin HEAD" -RETCODE=$? -if [[ $RETCODE != 0 ]]; then - echo "Something went wrong" - exit 1 -fi - -git commit -a -m "$commitmessage" || true -sed -i "s/system@scm\.trinitydesktop\.org/$gituser@scm\.trinitydesktop\.org/g" `git rev-parse --git-dir`/config -git pull &&\ - [[ "`git rev-parse HEAD`" == "`git rev-parse origin/$branch`" ]] ||\ - git push origin HEAD || true diff --git a/scripts/switch_all_submodules_to_head_and_clean b/scripts/switch_all_submodules_to_head_and_clean deleted file mode 100755 index 631381272..000000000 --- a/scripts/switch_all_submodules_to_head_and_clean +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash - -if [[ ! -e .git ]] || - [[ -z "`git rev-parse --git-dir 2>/dev/null`" ]]; then - echo "This script can only be run from a top level git directory. Exiting..." - exit 1 -fi - -branch=`git symbolic-ref -q HEAD | sed "s|^refs/heads/||"` -if [[ -z "$branch" ]] || - [[ -z "`git rev-parse --symbolic-full-name --remotes=\"*/$branch\"`" ]]; then - echo "There is not active upstream branch. Exiting..." - exit 1 -fi - -echo "Preparing $PWD for development use" -if [[ $1 == "" ]]; then - gituser=`sed -n "/^\[remote \"origin\"\]/,/url/s/\turl = http:\/\/\([^@]*\)@.*/\1/p" <\`git rev-parse --git-dir\`/config | grep -v "\(anonymous\|system\)"` -else - gituser=$1 -fi - -if [[ $gituser == "" ]]; then - read -p "Enter your TDE GIT username []: " -e gituser -fi - -if [[ $gituser == "" ]]; then - gituser="anonymous" -fi - -THISSCRIPT=$(readlink -f $0) - -if [[ ! -e "$THISSCRIPT" ]]; then - echo "Unable to find myself! Exiting..." - exit 1 -fi - -if [[ ! -z "`git status --porcelain`" ]]; then - git reset --hard HEAD - git clean -dxff -fi -git pull -if [[ ! -z "`git status --porcelain`" ]]; then - git reset --hard HEAD - git clean -dxff -fi - -if [[ -e .gitmodules ]]; then - if [[ $gituser == "anonymous" ]]; then - sed -i 's/system@//g' .gitmodules - else - sed -i "s/system@/$gituser@/g" .gitmodules - fi - - git submodule init - git submodule update - git submodule foreach "git checkout $branch && $THISSCRIPT $gituser" - - git checkout -- .gitmodules -fi diff --git a/scripts/update_all_submodules b/scripts/update_all_submodules deleted file mode 100755 index 498dceff0..000000000 --- a/scripts/update_all_submodules +++ /dev/null @@ -1,70 +0,0 @@ -#!/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 - -if [[ ! -e .git ]] || - [[ -z "`git rev-parse --git-dir 2>/dev/null`" ]]; then - echo "Current directory does not contain a .git folder. Exiting..." - exit 1 -fi - -branch=`git symbolic-ref -q HEAD | sed "s|^refs/heads/||"` -if [[ -z "$branch" ]] || - [[ -z "`git rev-parse --symbolic-full-name --remotes=\"*/$branch\"`" ]]; then - echo "There is not active upstream branch. Exiting..." - exit 1 -fi - -touch /var/lock/update-tde-git-submodules - -PARENTDIR=$PWD -echo "Working in $PARENTDIR" -git pull -if [[ ! -z "`git status --porcelain`" ]]; then - git reset --hard HEAD - git clean -dxff -fi - -exec 3< submodules -while read <&3 -do - cd $PARENTDIR - DIR2UPDATE=$REPLY - if [[ $DIR2UPDATE != "" ]]; then - echo "Attempting to reset submodule $DIR2UPDATE" - cd $PARENTDIR/$DIR2UPDATE/.. - cd `git rev-parse --show-toplevel` - if [[ -z "`grep \"^Updated: $PWD$\" /var/lock/update-tde-git-submodules`" ]]; then - echo "Updated: $PWD" >>/var/lock/update-tde-git-submodules - git submodule init - git submodule update - fi - cd $PARENTDIR/$DIR2UPDATE - if [[ ! -z "`git status --porcelain`" ]]; then - git reset --hard HEAD - git clean -dxff - fi - git checkout $branch - git pull - cd .. - cd `git rev-parse --show-toplevel` - echo "Committing changes to $PWD" - if [[ ! -z "`git status --porcelain $PARENTDIR/$DIR2UPDATE`" ]]; then - git add $PARENTDIR/$DIR2UPDATE - git commit $PARENTDIR/$DIR2UPDATE -m "Reset submodule $DIR2UPDATE to latest HEAD" - fi - if [[ "`git rev-parse HEAD`" != "`git rev-parse origin/$branch`" ]]; then - git push origin HEAD - fi - fi -done -exec 3>&- - -# Let the disk subsystem recover -sleep 60 - -rm /var/lock/update-tde-git-submodules |