summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2012-06-25 13:07:57 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2012-06-25 13:07:57 -0700
commit41baae87ce4e24f296acc7f2448e3ad94e5cc1db (patch)
tree0a211405bf7c3665b456685c0429f6ab86731029
parentfcb055e3a58d50352e7c3f84fe42b8c71268b3b8 (diff)
downloadvyos-cloud-init-41baae87ce4e24f296acc7f2448e3ad94e5cc1db.tar.gz
vyos-cloud-init-41baae87ce4e24f296acc7f2448e3ad94e5cc1db.zip
Continue working on getting a specfile generated.
-rwxr-xr-xpackages/brpm44
1 files changed, 43 insertions, 1 deletions
diff --git a/packages/brpm b/packages/brpm
index 829303ea..f2c3dac4 100755
--- a/packages/brpm
+++ b/packages/brpm
@@ -1,3 +1,45 @@
-#!/bin/sh
+#!/usr/bin/python
+# vi: ts=4 expandtab
+import os
+import subprocess
+import sys
+import tempfile
+import re
+import tempita
+
+# This is more just for running from the bin folder so that
+# cloud-init binary can find the cloudinit module
+possible_topdir = os.path.normpath(os.path.join(os.path.abspath(
+ sys.argv[0]), os.pardir, os.pardir))
+if os.path.exists(os.path.join(possible_topdir, "cloudinit", "__init__.py")):
+ sys.path.insert(0, possible_topdir)
+
+PWD = os.getcwd()
+
+def info(msg):
+ sys.stderr.write("INFO: %s\n" % (msg))
+
+
+def warn(msg):
+ sys.stderr.write("WARNING: %s\n" % (msg))
+
+
+def main():
+ if not os.path.isfile(os.path.join(PWD, 'brpm.tmpl')):
+ warn("Can not find required template file 'brpm.tmpl'")
+ return 1
+ if not os.path.isfile(os.path.join(os.pardir, 'setup.py')):
+ warn("Can not find required root 'setup.py' file")
+ return 1
+
+ cmd = [os.path.join(os.pardir, 'tools', 'read-version')]
+ version = subprocess.check_Call(cmd)
+
+
+ return 0
+
+
+if __name__ == '__main__':
+ sys.exit(main())