Created
          August 7, 2012 17:26 
        
      - 
      
- 
        Save rurban/3287531 to your computer and use it in GitHub Desktop. 
    smoke-parrot shell script
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/bin/sh | |
| cd /usr/src/parrot/parrot-git || exit | |
| branch=${1:-master} | |
| # stash changes if dirty or detached head | |
| if git symbolic-ref -q HEAD | |
| then | |
| if git status|grep " Changes " 2>/dev/null | |
| then | |
| git stash save "smoke `date +%F` `git name-rev --name-only HEAD`" | |
| fi | |
| fi | |
| fbranch=smoked."`echo $branch|sed -e's,/,_,'`" | |
| git fetch origin $branch | |
| git checkout -b $branch | |
| git clean -dxf || git clean -d -x | |
| git reset --hard | |
| git pull origin $branch | |
| git reset --hard | |
| oldrev="`cat ../$fbranch`" | |
| newrev="`git rev-parse $branch`" | |
| if [ x$oldrev = x$newrev ] | |
| then | |
| echo "no changes for $branch $newrev" | |
| else | |
| perl Configure.pl --optimize | |
| make | |
| make smolder_test | |
| git rev-parse $branch && echo $newrev >../$fbranch | |
| fi | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment