Skip to content
This repository has been archived by the owner on Jun 15, 2020. It is now read-only.

Commit

Permalink
create_pkg: autodetect version.
Browse files Browse the repository at this point in the history
  • Loading branch information
vuori committed Dec 28, 2018
1 parent a42e8e8 commit 88ce207
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions create_pkg.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# weasel-pageant packaging script.
#
# Copyright 2017 Valtteri Vuorikoski
# Copyright 2017, 2018 Valtteri Vuorikoski
#
# This file is part of weasel-pageant, and is free software: you can
# redistribute it and/or modify it under the terms of the GNU General
Expand All @@ -11,8 +11,9 @@

import sys
import zipfile
import re

CURRENT_VERSION = '1.1'
CURRENT_VERSION = 'unknown'

try:
reltype = sys.argv[1]
Expand All @@ -23,6 +24,13 @@
print('usage: create_pkg release|debug', file=sys.stderr)
sys.exit(1)

# Autodetect version from the source
with open('linux/main.c', 'r') as fp:
for line in fp:
m = re.match(r'#define VERSION "([^"]+)', line)
if m:
CURRENT_VERSION = m.group(1)

manifest = [
'COPYING',
'COPYING.PuTTY',
Expand Down

0 comments on commit 88ce207

Please sign in to comment.