Skip to content

Commit

Permalink
Updates to tutorial for packages
Browse files Browse the repository at this point in the history
  • Loading branch information
jhclark committed Apr 8, 2012
1 parent d2673d5 commit 3106322
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
4 changes: 1 addition & 3 deletions syntax/tutorial/2-packages/1-disk.tape
Expand Up @@ -12,11 +12,9 @@ package moses :: .versioner=disk .url="http://moses.svn.sourceforge.net/svnroot/
make -j16
}

# TODO: Use proper rsync args
# TODO: Disk versioner cannot support updating to a particular revision...
versioner disk :: url rev {
action checkout > dir {
rsync $url $dir
cp $url $dir
}
action repo_version > version {
find $url -type f -printf '%TY-%Tm-%Td_%TT %p\n' | sort | awk 'END{print $1}' > $version
Expand Down
11 changes: 6 additions & 5 deletions syntax/tutorial/2-packages/2-git.tape
Expand Up @@ -9,7 +9,7 @@ task lunchtime : lunchpy {
}

# * Build commands are only called when versioner indicates a new version
package lunchpy :: .versioner=git .url="https://github.com/mjdenkowski/lunchpy.git" {
package lunchpy :: .versioner=git .url="git://github.com/mjdenkowski/lunchpy.git" .ref=HEAD {
# We don't actually need to compile anything for python code,
# but for the sake of example we'll make this program run a bit faster
python -m compileall .
Expand All @@ -24,15 +24,16 @@ package lunchpy :: .versioner=git .url="https://github.com/mjdenkowski/lunchpy.g
# * All other commands are run inside $dir
# * As we will see with inline branches, specializations such as checkout and update
# inherit all of their parent's parameters so that update has visibility of $url and $rev
versioner git :: url rev {
versioner git :: url ref {
action checkout > dir {
git clone $url $dir
}
action repo_version > version {
git ls-remote origin HEAD | cut -f1 > $version
git ls-remote $url $ref | cut -f1 > $version
}
# Used to confirm version after update/install
action local_version > version date {
# TODO: Can we do without this? Just check repo version as we checkout? (potential race condition)
# Used to confirm version after checkout
action local_version > version date {
git rev-parse HEAD > $version
git log -1 | awk '/^Date/{$1=""; print}' > $date
}
Expand Down

0 comments on commit 3106322

Please sign in to comment.