﻿<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
	<id>https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=%E5%88%A9%E7%94%A8%E8%80%85%3AGdh%2FWorkflow</id>
	<title>利用者:Gdh/Workflow - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=%E5%88%A9%E7%94%A8%E8%80%85%3AGdh%2FWorkflow"/>
	<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:Gdh/Workflow&amp;action=history"/>
	<updated>2026-11-27T05:42:22Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:Gdh/Workflow&amp;diff=142897&amp;oldid=prev</id>
		<title>Yamyam: 1版 をインポートしました</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:Gdh/Workflow&amp;diff=142897&amp;oldid=prev"/>
		<updated>2018-06-28T20:56:52Z</updated>

		<summary type="html">&lt;p&gt;1版 をインポートしました&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ja&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← 古い版&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;2018年6月28日 (木) 20:56時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;ja&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(相違点なし)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Yamyam</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:Gdh/Workflow&amp;diff=142896&amp;oldid=prev</id>
		<title>wiki&gt;Gdh: Recopied blender_release again. I really need to wait until I finish changing it before I put it up here.</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:Gdh/Workflow&amp;diff=142896&amp;oldid=prev"/>
		<updated>2013-07-02T00:02:25Z</updated>

		<summary type="html">&lt;p&gt;Recopied blender_release again. I really need to wait until I finish changing it before I put it up here.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Workflow =&lt;br /&gt;
&lt;br /&gt;
My workflow mainly consists of Bash scripts and aliases.&lt;br /&gt;
&lt;br /&gt;
=== Bash Scripts ===&lt;br /&gt;
&lt;br /&gt;
==== Yes/No Script (yesno.sh) ====&lt;br /&gt;
&lt;br /&gt;
I found this script on the Internet. It asks the user a yes/no question. If you give it a default, the user can accept the default by just pressing enter. If you give it a timeout, it will assume the default answer after that amount of time. I include this script because a lot of my other scripts use it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# Original script by Mitch Frazier. Copied from&lt;br /&gt;
# http://www.linuxjournal.com/content/asking-yesno-question-bash-script&lt;br /&gt;
# I made one change and turned the yesno function into the actual script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#####################################################################&lt;br /&gt;
# Print warning message.&lt;br /&gt;
&lt;br /&gt;
function warning()&lt;br /&gt;
{&lt;br /&gt;
    echo &amp;quot;$*&amp;quot; &amp;gt;&amp;amp;2&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#####################################################################&lt;br /&gt;
# Print error message and exit.&lt;br /&gt;
&lt;br /&gt;
function error()&lt;br /&gt;
{&lt;br /&gt;
    echo &amp;quot;$*&amp;quot; &amp;gt;&amp;amp;2&lt;br /&gt;
    exit 1&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#####################################################################&lt;br /&gt;
# Ask yesno question.&lt;br /&gt;
#&lt;br /&gt;
# Usage: yesno OPTIONS QUESTION&lt;br /&gt;
#&lt;br /&gt;
#   Options:&lt;br /&gt;
#     --timeout N    Timeout if no input seen in N seconds.&lt;br /&gt;
#     --default ANS  Use ANS as the default answer on timeout or&lt;br /&gt;
#                    if an empty answer is provided.&lt;br /&gt;
#&lt;br /&gt;
# Exit status is the answer.&lt;br /&gt;
&lt;br /&gt;
ans=&amp;#039;&amp;#039;&lt;br /&gt;
ok=0&lt;br /&gt;
timeout=0&lt;br /&gt;
default=&amp;#039;&amp;#039;&lt;br /&gt;
t=0&lt;br /&gt;
&lt;br /&gt;
while [[ &amp;quot;$1&amp;quot; ]]&lt;br /&gt;
do&lt;br /&gt;
    case &amp;quot;$1&amp;quot; in&lt;br /&gt;
    --default)&lt;br /&gt;
        shift&lt;br /&gt;
        default=$1&lt;br /&gt;
        if [[ ! &amp;quot;$default&amp;quot; ]]; then error &amp;quot;Missing default value&amp;quot;; fi&lt;br /&gt;
        t=$(tr &amp;#039;[:upper:]&amp;#039; &amp;#039;[:lower:]&amp;#039; &amp;lt;&amp;lt;&amp;lt;$default)&lt;br /&gt;
        if [[ &amp;quot;$t&amp;quot; != &amp;#039;y&amp;#039;  &amp;amp;&amp;amp;  &amp;quot;$t&amp;quot; != &amp;#039;yes&amp;#039;  &amp;amp;&amp;amp;  &amp;quot;$t&amp;quot; != &amp;#039;n&amp;#039;  &amp;amp;&amp;amp;  &amp;quot;$t&amp;quot; != &amp;#039;no&amp;#039; ]]; then&lt;br /&gt;
            error &amp;quot;Illegal default answer: $default&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
        default=$t&lt;br /&gt;
        shift&lt;br /&gt;
        ;;&lt;br /&gt;
&lt;br /&gt;
    --timeout)&lt;br /&gt;
        shift&lt;br /&gt;
        timeout=$1&lt;br /&gt;
        if [[ ! &amp;quot;$timeout&amp;quot; ]]; then error &amp;quot;Missing timeout value&amp;quot;; fi&lt;br /&gt;
        if [[ ! &amp;quot;$timeout&amp;quot; =~ ^[0-9][0-9]*$ ]]; then error &amp;quot;Illegal timeout value: $timeout&amp;quot;; fi&lt;br /&gt;
        shift&lt;br /&gt;
        ;;&lt;br /&gt;
&lt;br /&gt;
    -*)&lt;br /&gt;
        error &amp;quot;Unrecognized option: $1&amp;quot;&lt;br /&gt;
        ;;&lt;br /&gt;
&lt;br /&gt;
    *)&lt;br /&gt;
        break&lt;br /&gt;
        ;;&lt;br /&gt;
    esac&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
if [[ $timeout -ne 0  &amp;amp;&amp;amp;  ! &amp;quot;$default&amp;quot; ]]; then&lt;br /&gt;
    error &amp;quot;Non-zero timeout requires a default answer&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! &amp;quot;$*&amp;quot; ]]; then error &amp;quot;Missing question&amp;quot;; fi&lt;br /&gt;
&lt;br /&gt;
while [[ $ok -eq 0 ]]&lt;br /&gt;
do&lt;br /&gt;
    if [[ $timeout -ne 0 ]]; then&lt;br /&gt;
        if ! read -t $timeout -p &amp;quot;$*&amp;quot; ans; then&lt;br /&gt;
        	echo -e&lt;br /&gt;
            ans=$default&lt;br /&gt;
        else&lt;br /&gt;
            # Turn off timeout if answer entered.&lt;br /&gt;
            timeout=0&lt;br /&gt;
            if [[ ! &amp;quot;$ans&amp;quot; ]]; then ans=$default; fi&lt;br /&gt;
        fi&lt;br /&gt;
    else&lt;br /&gt;
        read -p &amp;quot;$*&amp;quot; ans&lt;br /&gt;
        if [[ ! &amp;quot;$ans&amp;quot; ]]; then&lt;br /&gt;
            ans=$default&lt;br /&gt;
        else&lt;br /&gt;
            ans=$(tr &amp;#039;[:upper:]&amp;#039; &amp;#039;[:lower:]&amp;#039; &amp;lt;&amp;lt;&amp;lt;$ans)&lt;br /&gt;
        fi &lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
    if [[ &amp;quot;$ans&amp;quot; == &amp;#039;y&amp;#039;  ||  &amp;quot;$ans&amp;quot; == &amp;#039;yes&amp;#039;  ||  &amp;quot;$ans&amp;quot; == &amp;#039;n&amp;#039;  ||  &amp;quot;$ans&amp;quot; == &amp;#039;no&amp;#039; ]]; then&lt;br /&gt;
        ok=1&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
    if [[ $ok -eq 0 ]]; then warning &amp;quot;Valid answers are: yes y no n&amp;quot;; fi&lt;br /&gt;
done&lt;br /&gt;
[[ &amp;quot;$ans&amp;quot; = &amp;quot;y&amp;quot; || &amp;quot;$ans&amp;quot; == &amp;quot;yes&amp;quot; ]]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Blender Builder (blender_builder.sh) ====&lt;br /&gt;
&lt;br /&gt;
This script compiles Blender. It will also run it. It will accept two different arguments: &amp;#039;--norun&amp;#039;, which will cause it to exit without running Blender, and &amp;#039;--yesrun&amp;#039;, which will cause it to run Blender without asking. If the user doesn&amp;#039;t use those arguments, it will ask the user (using the yesno.sh script above) if they want to run Blender.&lt;br /&gt;
&lt;br /&gt;
This script will compile Blender with a custom splash. If you don&amp;#039;t want a custom splash comment out the code that would generate it. The code in question is marked.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# Set variables.&lt;br /&gt;
&lt;br /&gt;
# Don&amp;#039;t change this one. It is the URL for the trunk.&lt;br /&gt;
trunk=&amp;#039;https://svn.blender.org/svnroot/bf-blender/trunk/blender&amp;#039;&lt;br /&gt;
&lt;br /&gt;
# Change this one to the directory ABOVE your blender source tree.&lt;br /&gt;
# I have this directory to hold my build tree, my GSoC files, etc.&lt;br /&gt;
# This assumes that the user does out-of-source builds (which are&lt;br /&gt;
# highly recommended).&lt;br /&gt;
ROOT=&amp;#039;/home/gavin/Code/blender-svn&amp;#039;&lt;br /&gt;
&lt;br /&gt;
# Change this one to the directory containing the source tree.&lt;br /&gt;
SRC=&amp;quot;$ROOT/blender&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# This is the directory where the build tree is stored. Notice&lt;br /&gt;
# that it is contained in the same directory as the source tree.&lt;br /&gt;
# Change this if needed.&lt;br /&gt;
BUILD=&amp;quot;$ROOT/build&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# This is the absolute path to Blender&amp;#039;s splash image. This is in&lt;br /&gt;
# the source tree. (On my computer, the source tree is in the folder&lt;br /&gt;
# $SRC/blender. Change this one if needed.&lt;br /&gt;
# ONLY USE IF YOU WANT A CUSTOM SPLASH!&lt;br /&gt;
SPLASH=&amp;quot;$SRC/release/datafiles/splash.png&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# This is the path to my custom splash image. This is in the directory&lt;br /&gt;
# above the source tree. Change if needed.&lt;br /&gt;
# ONLY USE IF YOU WANT A CUSTOM SPLASH!&lt;br /&gt;
MY_SPLASH=&amp;quot;$ROOT/splash.png&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# This is the path to the file where we store a temporary copy of&lt;br /&gt;
# the official splash. Change this if needed.&lt;br /&gt;
# ONLY USE IF YOU WANT A CUSTOM SPLASH!&lt;br /&gt;
TEMP_SPLASH=&amp;quot;$ROOT/current.png&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# This is how many threads the user wants to use for building.&lt;br /&gt;
# Change this if needed.&lt;br /&gt;
THREADS=8&lt;br /&gt;
&lt;br /&gt;
# This sound plays when the merge is finished.&lt;br /&gt;
# Change to your preferred sound file.&lt;br /&gt;
sound=&amp;#039;/usr/share/sounds/ubuntu/stereo/dialog-question.ogg&amp;#039;&lt;br /&gt;
&lt;br /&gt;
# This is the location of the yesno script. I use this script to&lt;br /&gt;
# ask the user a yes/no question. Change this if needed.&lt;br /&gt;
yesno=&amp;#039;/home/gavin/Scripts/yesno.sh&amp;#039;&lt;br /&gt;
&lt;br /&gt;
# We can pass in an argument to not run blender.&lt;br /&gt;
NORUN=0&lt;br /&gt;
YESRUN=0&lt;br /&gt;
if [ $# -eq 1 ];&lt;br /&gt;
then&lt;br /&gt;
	if [ $1 == &amp;quot;--norun&amp;quot; ];&lt;br /&gt;
	then&lt;br /&gt;
		NORUN=1&lt;br /&gt;
	elif [ $1 == &amp;quot;--yesrun&amp;quot; ];&lt;br /&gt;
	then&lt;br /&gt;
		YESRUN=1&lt;br /&gt;
	else&lt;br /&gt;
		echo -e &amp;quot;Unrecognized argument $1.&amp;quot;&lt;br /&gt;
	fi&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Get into the blender root directory.&lt;br /&gt;
cd $SRC&lt;br /&gt;
&lt;br /&gt;
# Replace the real splash with our splash.&lt;br /&gt;
# ONLY USE IF YOU WANT A CUSTOM SPLASH!&lt;br /&gt;
mv -f $SPLASH $TEMP_SPLASH&lt;br /&gt;
cp $MY_SPLASH $SPLASH&lt;br /&gt;
&lt;br /&gt;
# Compile blender.&lt;br /&gt;
cd $BUILD&lt;br /&gt;
cmake $SRC&lt;br /&gt;
make install -j$THREADS&lt;br /&gt;
&lt;br /&gt;
# Put the real splash back.&lt;br /&gt;
# ONLY USE IF YOU WANT A CUSTOM SPLASH!&lt;br /&gt;
cd $SRC&lt;br /&gt;
rm $SPLASH&lt;br /&gt;
mv -f $TEMP_SPLASH $SPLASH&lt;br /&gt;
svn revert $SPLASH&lt;br /&gt;
&lt;br /&gt;
# Play an alert sound to let me know it&amp;#039;s done building.&lt;br /&gt;
paplay $sound&lt;br /&gt;
&lt;br /&gt;
# Run blender.&lt;br /&gt;
if [[ $NORUN -ne 1 ]];&lt;br /&gt;
then&lt;br /&gt;
	if [[ $YESRUN -ne 1 ]];&lt;br /&gt;
	then&lt;br /&gt;
		if $yesno --timeout 30 --default no &amp;quot;Run Blender [y/n]: &amp;quot;;&lt;br /&gt;
		then&lt;br /&gt;
			cd $BUILD&lt;br /&gt;
			bin/blender&lt;br /&gt;
		fi&lt;br /&gt;
	else&lt;br /&gt;
		cd $BUILD&lt;br /&gt;
		bin/blender&lt;br /&gt;
	fi&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Blender Updater (blender_updater.sh) ====&lt;br /&gt;
&lt;br /&gt;
This script updates trunk to the latest revision.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# Define variables.&lt;br /&gt;
&lt;br /&gt;
# Don&amp;#039;t change this one. It is the URL for the trunk.&lt;br /&gt;
trunk=&amp;#039;https://svn.blender.org/svnroot/bf-blender/trunk/blender&amp;#039;&lt;br /&gt;
&lt;br /&gt;
# Change this one to the directory ABOVE your blender source tree.&lt;br /&gt;
# I have this directory to hold my build tree, my GSoC files, etc.&lt;br /&gt;
# This assumes that the user does out-of-source builds (which are&lt;br /&gt;
# highly recommended).&lt;br /&gt;
ROOT=&amp;#039;/home/gavin/Code/blender-svn&amp;#039;&lt;br /&gt;
&lt;br /&gt;
# Change this one to the directory containing the source tree.&lt;br /&gt;
SRC=&amp;quot;$ROOT/blender&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# This is the file where the svn log is written to.&lt;br /&gt;
# Change this if needed.&lt;br /&gt;
log=&amp;quot;$ROOT/log&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# This is the file that the current revision number is&lt;br /&gt;
# written to. Change this if needed.&lt;br /&gt;
revision=&amp;quot;$ROOT/.rev&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# This is the location of the blender_builder script.&lt;br /&gt;
# Change this to the location of your builder script.&lt;br /&gt;
build=&amp;#039;/home/gavin/Scripts/blender/blender_builder.sh&amp;#039;&lt;br /&gt;
&lt;br /&gt;
# This is where the actual script begins.&lt;br /&gt;
&lt;br /&gt;
# Update the source.&lt;br /&gt;
cd $SRC&lt;br /&gt;
svn switch $trunk&lt;br /&gt;
svn up&lt;br /&gt;
&lt;br /&gt;
# This will remove the log file if necessary.&lt;br /&gt;
if [ -e &amp;quot;$log&amp;quot; ]&lt;br /&gt;
then&lt;br /&gt;
   rm $log&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Get the last revision.&lt;br /&gt;
read lastRev &amp;lt; $revision&lt;br /&gt;
&lt;br /&gt;
# Get the current revision.&lt;br /&gt;
thisRev=$(svn info | grep &amp;quot;Revision&amp;quot; | awk {&amp;#039;print $2&amp;#039;})&lt;br /&gt;
&lt;br /&gt;
# If the revisions are not the same, add one to the lastRev.&lt;br /&gt;
# This is so I don&amp;#039;t have to see svn log twice for that revision.&lt;br /&gt;
if [ $lastRev -lt $thisRev ]&lt;br /&gt;
then&lt;br /&gt;
	lastRev=$( expr $lastRev + 1 )&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Generate the log from the revisions.&lt;br /&gt;
echo -e &amp;quot;svn log $lastRev:$thisRev\n&amp;quot; &amp;gt; $log&lt;br /&gt;
svn log --diff -r $lastRev:$thisRev &amp;gt;&amp;gt; $log&lt;br /&gt;
nano -v $log&lt;br /&gt;
&lt;br /&gt;
# Put the new revision into the file.&lt;br /&gt;
echo $thisRev &amp;gt; $revision&lt;br /&gt;
&lt;br /&gt;
# Compile blender.&lt;br /&gt;
$build&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Blender Merge (blender_merge.sh) ====&lt;br /&gt;
&lt;br /&gt;
This script merges the latest trunk into my branch. It will also allow me to add to the commit message if I want to.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# Set variables.&lt;br /&gt;
&lt;br /&gt;
# Don&amp;#039;t change this one. It is the URL for the trunk.&lt;br /&gt;
trunk=&amp;#039;https://svn.blender.org/svnroot/bf-blender/trunk/blender&amp;#039;&lt;br /&gt;
&lt;br /&gt;
# Change this one to the URL of the branch you are working on.&lt;br /&gt;
branch=&amp;#039;https://svn.blender.org/svnroot/bf-blender/branches/soc-2013-cycles_mblur&amp;#039;&lt;br /&gt;
&lt;br /&gt;
# Change this one to the directory ABOVE your blender source tree.&lt;br /&gt;
# I have this directory to hold my build tree, my GSoC files, etc.&lt;br /&gt;
# This assumes that the user does out-of-source builds (which are&lt;br /&gt;
# highly recommended).&lt;br /&gt;
ROOT=&amp;#039;/home/gavin/Code/blender-svn&amp;#039;&lt;br /&gt;
&lt;br /&gt;
# Change this one to the directory containing the source tree.&lt;br /&gt;
SRC=&amp;quot;$ROOT/blender&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# This is the directory where the build tree is stored. Notice&lt;br /&gt;
# that it is contained in the same directory as the source tree.&lt;br /&gt;
# Change this if needed.&lt;br /&gt;
BUILD=&amp;quot;$ROOT/build&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# This is the file that stores the number of the last revision that&lt;br /&gt;
# was merged into the branch. Change this if needed.&lt;br /&gt;
merge=&amp;quot;$ROOT/.merge&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# This is the file that the current revision number is&lt;br /&gt;
# written to. Change this if needed.&lt;br /&gt;
revision=&amp;quot;$ROOT/.rev&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# This is the location of the yesno script. I use this script to&lt;br /&gt;
# ask the user a yes/no question. Change this if needed.&lt;br /&gt;
yesno=&amp;#039;/home/gavin/Scripts/yesno.sh&amp;#039;&lt;br /&gt;
&lt;br /&gt;
# This sound plays when the merge is finished.&lt;br /&gt;
# Change to your preferred sound file.&lt;br /&gt;
sound=&amp;#039;/usr/share/sounds/ubuntu/stereo/dialog-question.ogg&amp;#039;&lt;br /&gt;
&lt;br /&gt;
# This is the file that stores the temporary file for the commit&lt;br /&gt;
# message. (When the user runs this script, they can add to the&lt;br /&gt;
# standard commit message. Change if needed.&lt;br /&gt;
FILE=&amp;quot;/tmp/svn_merge&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# This is the extra part of the commit message. Don&amp;#039;t change this.&lt;br /&gt;
message=&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# This sets the commit message intro. You can change this one if you want.&lt;br /&gt;
# You may want to keep $mergeRev and $curRev included in this. The first two&lt;br /&gt;
# variables will be replaced by $mergeRev and $curRev, respectively.&lt;br /&gt;
mergeStr=&amp;quot;&amp;lt;mergeRev&amp;gt;&amp;quot;&lt;br /&gt;
curStr=&amp;quot;&amp;lt;curRev&amp;gt;&amp;quot;&lt;br /&gt;
intro=&amp;quot;Merged trunk into branch. Includes r$mergeStr to r$curStr.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# This is where the actual script begins.&lt;br /&gt;
&lt;br /&gt;
# cd into the directory.&lt;br /&gt;
cd $SRC&lt;br /&gt;
&lt;br /&gt;
# Get the current revision, as well as the last revision we merged.&lt;br /&gt;
read curRev &amp;lt; $revision&lt;br /&gt;
read mergeRev &amp;lt; $merge&lt;br /&gt;
&lt;br /&gt;
# Switch back to branch.&lt;br /&gt;
echo -e &amp;quot;\nNow switching...\n&amp;quot;&lt;br /&gt;
svn switch $branch&lt;br /&gt;
&lt;br /&gt;
# Merge trunk&lt;br /&gt;
echo -e &amp;quot;\nNow merging...\n&amp;quot;&lt;br /&gt;
svn merge $trunk&lt;br /&gt;
&lt;br /&gt;
# Play an alert sound to let me know it&amp;#039;s done merging.&lt;br /&gt;
paplay $sound&lt;br /&gt;
&lt;br /&gt;
# Make sure the new revision is after the last merge.&lt;br /&gt;
# If so, add one to the last merge revision.&lt;br /&gt;
if [ $mergeRev -lt $curRev ]&lt;br /&gt;
then&lt;br /&gt;
	mergeRev=$( expr $mergeRev + 1 )&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Inserts the revision numbers in the intro to the commit message.&lt;br /&gt;
intro=$(echo -e ${intro//$mergeStr/$mergeRev})&lt;br /&gt;
intro=$(echo -e ${intro//$curStr/$curRev})&lt;br /&gt;
&lt;br /&gt;
# Allow the user to write a commit message.&lt;br /&gt;
if $yesno --timeout 30 --default no &amp;quot;Add to commit message [y/n]: &amp;quot;;&lt;br /&gt;
then&lt;br /&gt;
	echo -e &amp;quot;# Write your commit message below. (This line is ignored.)&amp;quot; &amp;gt; $FILE&lt;br /&gt;
	&lt;br /&gt;
	# This command makes it so you cannot have a commit&lt;br /&gt;
	# message go beyond 72 characters on one line.&lt;br /&gt;
	nano --tabstospaces --tabsize=4 --fill=72 +2,1 $FILE&lt;br /&gt;
	&lt;br /&gt;
	# Delete the first line in the file.&lt;br /&gt;
	sed -i 1d $FILE&lt;br /&gt;
	&lt;br /&gt;
	count=0&lt;br /&gt;
	while read line; do&lt;br /&gt;
		if [[ count -eq 0 ]];&lt;br /&gt;
		then&lt;br /&gt;
			message=&amp;quot;\n&amp;quot;$message&lt;br /&gt;
		fi&lt;br /&gt;
		message=$message&amp;quot;\n&amp;quot;$line&lt;br /&gt;
		let count+=1&lt;br /&gt;
	done &amp;lt; $FILE&lt;br /&gt;
&lt;br /&gt;
	# Commit.&lt;br /&gt;
	echo -e &amp;quot;\nNow committing...\n&amp;quot;&lt;br /&gt;
	echo -e &amp;quot;$intro$message&amp;quot; &amp;gt; $FILE&lt;br /&gt;
	svn commit -F $FILE&lt;br /&gt;
	&lt;br /&gt;
	# Delete the temp file.&lt;br /&gt;
	rm $FILE&lt;br /&gt;
else&lt;br /&gt;
	# Commit.&lt;br /&gt;
	svn commit -m $intro&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Put the new revision into the file.&lt;br /&gt;
echo $curRev &amp;gt; $merge&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Blender Release (blender_release.sh) ====&lt;br /&gt;
&lt;br /&gt;
This script compiles a release build for me. It will handle custom splashes (comment out the code for the custom splash if you don&amp;#039;t want it). It also copies all of the files to the install folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# Define a function to get the revision numbers.&lt;br /&gt;
get_revisions() {&lt;br /&gt;
&lt;br /&gt;
	echo -e &amp;quot;\nType the release revision number: &amp;quot;&lt;br /&gt;
	read revision&lt;br /&gt;
&lt;br /&gt;
	echo -e &amp;quot;\nType the addons revision number: &amp;quot;&lt;br /&gt;
	read addons&lt;br /&gt;
&lt;br /&gt;
	echo -e &amp;quot;\nType the locale revision number: &amp;quot;&lt;br /&gt;
	read locale&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# Set variables.&lt;br /&gt;
&lt;br /&gt;
# Don&amp;#039;t change this one. It is the URL for the trunk.&lt;br /&gt;
trunk=&amp;#039;https://svn.blender.org/svnroot/bf-blender/trunk/blender&amp;#039;&lt;br /&gt;
&lt;br /&gt;
# Change this one to the directory ABOVE your blender source tree.&lt;br /&gt;
# I have this directory to hold my build tree, my GSoC files, etc.&lt;br /&gt;
# This assumes that the user does out-of-source builds (which are&lt;br /&gt;
# highly recommended).&lt;br /&gt;
ROOT=&amp;#039;/home/gavin/Code/blender-svn&amp;#039;&lt;br /&gt;
&lt;br /&gt;
# Change this one to the directory containing the source tree.&lt;br /&gt;
SRC=&amp;quot;$ROOT/blender&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# This is the name of the file that contains the list of all of the&lt;br /&gt;
# releases that have been built. Change if needed.&lt;br /&gt;
RELEASE=&amp;quot;$ROOT/.release&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# This is the directory where the release build is stored. Notice&lt;br /&gt;
# that it is contained in the same directory as the source tree.&lt;br /&gt;
# Change this if needed.&lt;br /&gt;
BUILD=&amp;quot;$ROOT/release&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# This is the relative path to Blender&amp;#039;s splash image. This is in&lt;br /&gt;
# the source tree. (On my computer, the source tree is in the folder&lt;br /&gt;
# $SRC/blender. Change this one if needed.&lt;br /&gt;
# ONLY USE IF YOU WANT A CUSTOM SPLASH!&lt;br /&gt;
SPLASH=&amp;quot;$SRC/release/datafiles/splash.png&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# This is how many threads the user wants to use for building.&lt;br /&gt;
# Change this if needed.&lt;br /&gt;
THREADS=8&lt;br /&gt;
&lt;br /&gt;
# This sound plays when the merge is finished.&lt;br /&gt;
# Change to your preferred sound file.&lt;br /&gt;
sound=&amp;#039;/usr/share/sounds/ubuntu/stereo/dialog-question.ogg&amp;#039;&lt;br /&gt;
&lt;br /&gt;
# This is the location of the yesno script. I use this script to&lt;br /&gt;
# ask the user a yes/no question. Change this if needed.&lt;br /&gt;
yesno=&amp;#039;/home/gavin/Scripts/yesno.sh&amp;#039;&lt;br /&gt;
&lt;br /&gt;
# This is the directory where Blender will be installed.&lt;br /&gt;
# Change this if needed.&lt;br /&gt;
install=&amp;#039;/home/gavin/.blender&amp;#039;&lt;br /&gt;
&lt;br /&gt;
# This are for installing a custom splash. Don&amp;#039;t edit these.&lt;br /&gt;
# ONLY USE IF YOU WANT A CUSTOM SPLASH!&lt;br /&gt;
useSplash=1&lt;br /&gt;
editSplash=0&lt;br /&gt;
&lt;br /&gt;
# This is where the actual script begins.&lt;br /&gt;
&lt;br /&gt;
# Get into the blender root directory.&lt;br /&gt;
cd $SRC&lt;br /&gt;
&lt;br /&gt;
# Switch to trunk.&lt;br /&gt;
echo -e &amp;quot;\nSwitching to trunk...\n&amp;quot;&lt;br /&gt;
svn switch $trunk&lt;br /&gt;
&lt;br /&gt;
# Get all of the revision numbers.&lt;br /&gt;
&lt;br /&gt;
# If the user just presses enter, the script will build the latest release.&lt;br /&gt;
echo -e &amp;quot;\nLeave inputs blank for current settings.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# The version string is something like &amp;quot;2.67a&amp;quot;.&lt;br /&gt;
echo -e &amp;quot;\nType the version string:&amp;quot;&lt;br /&gt;
read version&lt;br /&gt;
&lt;br /&gt;
# If the user didn&amp;#039;t enter anything, just read from the .release file.&lt;br /&gt;
# Otherwise, write to the .release file.&lt;br /&gt;
if [ -z &amp;quot;$version&amp;quot; ] ;&lt;br /&gt;
then&lt;br /&gt;
&lt;br /&gt;
	# We do not need to edit the splash screen&lt;br /&gt;
	# because we are on the same version as last time.&lt;br /&gt;
	editSplash=0&lt;br /&gt;
&lt;br /&gt;
	version=$(cat $RELEASE | grep -m 1 &amp;quot;Version:&amp;quot; | awk {&amp;#039;print $2&amp;#039;})&lt;br /&gt;
&lt;br /&gt;
	echo -e &amp;quot;Using version &amp;quot;&amp;quot;$version&amp;quot;&amp;quot;.\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	if [ -z $revision ] ;&lt;br /&gt;
	then&lt;br /&gt;
		revision=$(cat $RELEASE | grep -m 1 &amp;quot;Revision:&amp;quot; | awk {&amp;#039;print $2&amp;#039;})&lt;br /&gt;
	fi&lt;br /&gt;
&lt;br /&gt;
	if [ -z $addons ];&lt;br /&gt;
	then&lt;br /&gt;
		addons=$(cat $RELEASE | grep -m 1 &amp;quot;Addons:&amp;quot; | awk {&amp;#039;print $2&amp;#039;})&lt;br /&gt;
	fi&lt;br /&gt;
&lt;br /&gt;
	if [ -z $locale ];&lt;br /&gt;
	then&lt;br /&gt;
		locale=$(cat $RELEASE | grep -m 1 &amp;quot;Locale:&amp;quot; | awk {&amp;#039;print $2&amp;#039;})&lt;br /&gt;
	fi&lt;br /&gt;
else&lt;br /&gt;
	&lt;br /&gt;
	# We need to edit the splash screen.&lt;br /&gt;
	editSplash=1&lt;br /&gt;
&lt;br /&gt;
	section=$(cat $RELEASE | grep &amp;quot;$version&amp;quot; -A3)&lt;br /&gt;
	&lt;br /&gt;
	if [ -z &amp;quot;$section&amp;quot; ] ;&lt;br /&gt;
	then&lt;br /&gt;
	&lt;br /&gt;
		get_revisions&lt;br /&gt;
	&lt;br /&gt;
		string=&amp;quot;Version:\t&amp;quot;$version&amp;quot; \nRevision:\t&amp;quot;$revision&amp;quot;\nAddons:\t\t&amp;quot;$addons&amp;quot;\nLocale:\t\t&amp;quot;$locale&amp;quot;\n&amp;quot;&lt;br /&gt;
		&lt;br /&gt;
		while read line; do &lt;br /&gt;
			if [ -n &amp;quot;$line&amp;quot; ];&lt;br /&gt;
			then&lt;br /&gt;
				if [[ $line == Version:* ]];&lt;br /&gt;
				then&lt;br /&gt;
					line=&amp;quot;\n&amp;quot;$line&lt;br /&gt;
				fi&lt;br /&gt;
				string=$string$line&amp;quot;\n&amp;quot;&lt;br /&gt;
			fi&lt;br /&gt;
		done &amp;lt; $RELEASE&lt;br /&gt;
		&lt;br /&gt;
		echo -e &amp;quot;$string&amp;quot; | tee $RELEASE&lt;br /&gt;
	else&lt;br /&gt;
	&lt;br /&gt;
		if [ -z &amp;quot;$revision&amp;quot; ] ;&lt;br /&gt;
		then&lt;br /&gt;
			revision=$( echo $section | grep -m 1 &amp;quot;Revision:&amp;quot; | awk {&amp;#039;print $4&amp;#039;})&lt;br /&gt;
		fi&lt;br /&gt;
&lt;br /&gt;
		if [ -z $addons ] ;&lt;br /&gt;
		then&lt;br /&gt;
			addons=$( echo $section | grep -m 1 &amp;quot;Addons:&amp;quot; | awk {&amp;#039;print $6&amp;#039;})&lt;br /&gt;
		fi&lt;br /&gt;
&lt;br /&gt;
		if [ -z $locale ];&lt;br /&gt;
		then&lt;br /&gt;
			locale=$( echo $section | grep -m 1 &amp;quot;Locale:&amp;quot; | awk {&amp;#039;print $8&amp;#039;})&lt;br /&gt;
		fi&lt;br /&gt;
	fi&lt;br /&gt;
fi&lt;br /&gt;
	&lt;br /&gt;
# Update svn to the revision numbers.&lt;br /&gt;
svn switch $trunk&lt;br /&gt;
svn update -r $revision --ignore-externals&lt;br /&gt;
svn update release/scripts/addons -r $addons&lt;br /&gt;
svn update addons_contrib -r $addons&lt;br /&gt;
svn update release/datafiles/locale -r $locale&lt;br /&gt;
&lt;br /&gt;
# Go to the root directory.&lt;br /&gt;
cd $ROOT&lt;br /&gt;
&lt;br /&gt;
# ONLY USE IF YOU WANT A CUSTOM SPLASH!&lt;br /&gt;
# Play a sound to let me know it&amp;#039;s waiting.&lt;br /&gt;
paplay $sound&lt;br /&gt;
if $yesno --timeout 30 --default yes &amp;quot;Use your own release splash [y/n]: &amp;quot;;&lt;br /&gt;
then&lt;br /&gt;
	echo -e &amp;quot;\nUsing custom splash...\n&amp;quot;&lt;br /&gt;
else&lt;br /&gt;
    editSplash=0&lt;br /&gt;
    useSplash=0&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# ONLY USE IF YOU WANT A CUSTOM SPLASH!&lt;br /&gt;
if [ $editSplash -eq 1 ];&lt;br /&gt;
then&lt;br /&gt;
&lt;br /&gt;
	# Change the splash to reflect the new version.&lt;br /&gt;
	gimp ./splash_template.xcf&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# ONLY USE IF YOU WANT A CUSTOM SPLASH!&lt;br /&gt;
if [ $useSplash -eq 1 ];&lt;br /&gt;
then&lt;br /&gt;
&lt;br /&gt;
	# Move the actual splash out and put our splash in.&lt;br /&gt;
	mv -f $SPLASH ./current.png&lt;br /&gt;
	cp ./splash.png $SPLASH&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Remove the directory where we install blender.&lt;br /&gt;
rm -r $install&lt;br /&gt;
&lt;br /&gt;
# Build the release.&lt;br /&gt;
cd $BUILD&lt;br /&gt;
cmake $SRC&lt;br /&gt;
make install -j$THREADS&lt;br /&gt;
&lt;br /&gt;
# ONLY USE IF YOU WANT A CUSTOM SPLASH!&lt;br /&gt;
if [ $useSplash -eq 1 ];&lt;br /&gt;
then&lt;br /&gt;
	# Put the real splash back.&lt;br /&gt;
	cd $ROOT&lt;br /&gt;
	rm $SPLASH&lt;br /&gt;
	mv -f ./current.png $SPLASH&lt;br /&gt;
	svn revert $SPLASH&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Move the compiled release to the install directory.&lt;br /&gt;
echo -e &amp;quot;\nInstalling Blender...\n&amp;quot;&lt;br /&gt;
cp -r $BUILD/bin $install&lt;br /&gt;
&lt;br /&gt;
# Play a sound to let me know it&amp;#039;s done building.&lt;br /&gt;
paplay $sound&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Svn Diff (svd.sh) ====&lt;br /&gt;
&lt;br /&gt;
This script runs an svn diff, and it stores it in a patch. The patch name can be specified.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# Use: svd [diff_name]&lt;br /&gt;
&lt;br /&gt;
# Set variables.&lt;br /&gt;
&lt;br /&gt;
# This is the string that will be used to display the help.&lt;br /&gt;
# You probably don&amp;#039;t want to change it.&lt;br /&gt;
helpString=&amp;#039;help&amp;#039;&lt;br /&gt;
&lt;br /&gt;
# This is the directory of the source tree.&lt;br /&gt;
# You will need to change this one to match yours.&lt;br /&gt;
SRC=&amp;#039;/home/gavin/Code/blender-svn/blender&amp;#039;&lt;br /&gt;
file=&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
# Display help or set the patch name according to user&amp;#039;s preference.&lt;br /&gt;
if [ $1 ] ;&lt;br /&gt;
then&lt;br /&gt;
	if [ $1 = $helpString ] ;&lt;br /&gt;
	then&lt;br /&gt;
		echo -e &amp;quot;\nUsage: svd [name of patch]\n&amp;quot;&lt;br /&gt;
		exit&lt;br /&gt;
	else&lt;br /&gt;
		file=&amp;quot;../$1.diff&amp;quot;&lt;br /&gt;
	fi&lt;br /&gt;
else&lt;br /&gt;
   file=&amp;quot;../patch.diff&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# If file exists, delete it.&lt;br /&gt;
cd $SRC&lt;br /&gt;
if [ -e &amp;quot;$file&amp;quot; ]&lt;br /&gt;
then&lt;br /&gt;
   rm $file&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Generate the patch.&lt;br /&gt;
svn diff &amp;gt; $file&lt;br /&gt;
&lt;br /&gt;
# View the patch.&lt;br /&gt;
nano -v $file&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bash Aliases ===&lt;br /&gt;
&lt;br /&gt;
These are the aliases I use in day-to-day development. They refer to the scripts above as well as some other things.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Run my release build of Blender.&lt;br /&gt;
alias blender=&amp;#039;/home/gavin/.blender/blender&amp;#039;&lt;br /&gt;
&lt;br /&gt;
# Run my debug (development) build of BLender.&lt;br /&gt;
alias blend=&amp;#039;/home/gavin/Code/blender-svn/build/bin/blender&amp;#039;&lt;br /&gt;
&lt;br /&gt;
# Run my blender_builder script, which compiles Blender.&lt;br /&gt;
alias blenb=&amp;#039;/home/gavin/Scripts/blender/blender_builder.sh&amp;#039;&lt;br /&gt;
&lt;br /&gt;
# Runs my blender_builder script, automatically&lt;br /&gt;
# running Blender after instead of asking.&lt;br /&gt;
alias blenby=&amp;#039;/home/gavin/Scripts/blender/blender_builder.sh --yesrun&amp;#039;&lt;br /&gt;
&lt;br /&gt;
# Runs my blender_updater script, which updates trunk to the latest revision.&lt;br /&gt;
alias blenu=&amp;#039;/home/gavin/Scripts/blender/blender_updater.sh&amp;#039;&lt;br /&gt;
&lt;br /&gt;
# Runs my blender_release script, which compiles a release build and installs it.&lt;br /&gt;
alias blenr=&amp;#039;/home/gavin/Scripts/blender/blender_release.sh&amp;#039;&lt;br /&gt;
&lt;br /&gt;
# Runs my blender_merge script, which merges trunk into my branch.&lt;br /&gt;
alias blenm=&amp;#039;/home/gavin/Scripts/blender/blender_merge.sh&amp;#039;&lt;br /&gt;
&lt;br /&gt;
# Runs my svd script, which runs an svn diff.&lt;br /&gt;
alias svd=&amp;#039;/home/gavin/Scripts/blender/svd.sh&amp;#039;&lt;br /&gt;
&lt;br /&gt;
# Changes into my ROOT directory.&lt;br /&gt;
alias bdir=&amp;#039;cd /home/gavin/Code/blender-svn/&amp;#039;&lt;br /&gt;
&lt;br /&gt;
# Changes into my build directory.&lt;br /&gt;
alias budir=&amp;#039;cd /home/gavin/Code/blender-svn/build&amp;#039;&lt;br /&gt;
&lt;br /&gt;
# Changes into my source directory.&lt;br /&gt;
alias bldir=&amp;#039;cd /home/gavin/Code/blender-svn/blender&amp;#039;&lt;br /&gt;
&lt;br /&gt;
# Changes into the Cycles directory.&lt;br /&gt;
alias cydir=&amp;#039;cd /home/gavin/Code/blender-svn/blender/intern/cycles&amp;#039;&lt;br /&gt;
&lt;br /&gt;
# Changes into my release build directory.&lt;br /&gt;
alias redir=&amp;#039;cd /home/gavin/Code/blender-svn/release&amp;#039;&lt;br /&gt;
&lt;br /&gt;
# Switches to trunk.&lt;br /&gt;
alias strunk=&amp;#039;cd /home/gavin/Code/blender-svn/blender; svn switch https://svn.blender.org/svnroot/bf-blender/trunk/blender&amp;#039;&lt;br /&gt;
&lt;br /&gt;
# Switches to my branch.&lt;br /&gt;
alias smblur=&amp;#039;cd /home/gavin/Code/blender-svn/blender; svn switch https://svn.blender.org/svnroot/bf-blender/branches/soc-2013-cycles_mblur&amp;#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>wiki&gt;Gdh</name></author>
		
	</entry>
</feed>