Skip to content

Commit

Permalink
Release 2014-08-01
Browse files Browse the repository at this point in the history
  • Loading branch information
willsowerbutts committed Aug 1, 2014
1 parent 7e454e0 commit cbed09e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ cpm.rom
cpmimage.c
remap.com
version.s
version.num
21 changes: 21 additions & 0 deletions mkrelease
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

CODE=unacpm-$(/bin/date +%Y-%m-%d)
TARGET=release/$CODE

if [ -d $TARGET ]; then
echo "Release $CODE already exists in $TARGET"
exit 1
fi

mkdir $TARGET $TARGET/compiled $TARGET/source
make clean
make all -j
cp *.?om bootdisk.bin $TARGET/compiled
make clean
cp * $TARGET/source
mv $TARGET/source/README.txt $TARGET/
mv $TARGET/source/LICENSE.txt $TARGET/
rm $TARGET/source/mkrelease
cd release
zip -9r ${CODE}.zip $CODE
12 changes: 8 additions & 4 deletions mkversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,26 @@ def run_command(cmd):
return out

date_str = datetime.datetime.now().strftime("%Y-%m-%d")
version_string = date_str

git_hash = None
if os.access('.git', os.F_OK):
# for my development versions
try:
git_hash = run_command(['git', 'rev-parse', 'HEAD']).strip()
git_diff = run_command(['git', 'diff', '--numstat']).strip()
git_hash = git_hash[:6]
if git_diff:
git_hash += '+'
version_string = '%s git %s' % (date_str, git_hash)
# write a file that is used by release versions
open("version.num", 'w').write(version_string)
except Exception, e:
print "Git failed or not installed: %s" % str(e)

if git_hash:
version_string = '%s git %s' % (date_str, git_hash)
else:
version_string = '%s' % (date_str,)
# for release versions
if os.access('version.num', os.R_OK):
version_string = open('version.num').read()

open("version.s", 'w').write(
"""; do not modify -- dynamically generated file
Expand Down

0 comments on commit cbed09e

Please sign in to comment.