summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFathi Boudra <fabo@debian.org>2012-04-22 15:44:33 +0300
committerFathi Boudra <fabo@debian.org>2012-04-22 15:44:33 +0300
commit23e2ba017e5b81b6887c4db3879df848bc467456 (patch)
tree7721d5fc6ff909076e9d7163af5989b0d8aeae71
parent1a359c87a1cf2332603110b102ee503bd9981223 (diff)
downloadsnowball-binary-update-23e2ba017e5b81b6887c4db3879df848bc467456.tar.gz
Add ppa-source-entry script: append source entry to hwpack configuration.
-rwxr-xr-xppa-source-entry.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/ppa-source-entry.py b/ppa-source-entry.py
new file mode 100755
index 0000000..8b37517
--- /dev/null
+++ b/ppa-source-entry.py
@@ -0,0 +1,26 @@
+#!/usr/bin/python
+
+import os
+import sys
+
+def main():
+ ppa = os.environ.get("PPA", "Undefined")
+ if ppa == "Undefined":
+ sys.exit("PPA is not defined.")
+ else:
+ ppa_file = os.path.join('/var/run/linaro-ppa', ppa)
+ f = open(ppa_file)
+ sources_entry = f.read().strip()
+ f.close()
+
+ hwpack = os.environ.get("HWPACK", "Undefined")
+ if hwpack == "Undefined":
+ sys.exit("Hardware pack is not defined.")
+ else:
+ hwpack_file = os.path.join('hwpacks', hwpack)
+ f = open(hwpack_file, "a")
+ f.write(sources_entry)
+ f.close()
+
+if __name__ == "__main__":
+ main()