summaryrefslogtreecommitdiffstats
path: root/a
diff options
context:
space:
mode:
authorFlorian Pritz <f-p@gmx.at>2009-05-21 23:43:26 +0200
committerFlorian Pritz <f-p@gmx.at>2009-05-21 23:43:26 +0200
commit2a41845a52cb2763160ba415b163d493d278c5cf (patch)
tree9543050c47ec5382d15d78308a637d0ff2255ce2 /a
parenteb55b0c3880705be8684a4da02b78368e0448b84 (diff)
downloadbin-2a41845a52cb2763160ba415b163d493d278c5cf.tar.gz
bin-2a41845a52cb2763160ba415b163d493d278c5cf.tar.xz
new archive script
Diffstat (limited to 'a')
-rw-r--r--a33
1 files changed, 33 insertions, 0 deletions
diff --git a/a b/a
new file mode 100644
index 0000000..6ec8e7d
--- /dev/null
+++ b/a
@@ -0,0 +1,33 @@
+#!/usr/bin/python
+#----------------------------------------------------
+# Version: 0.1.0
+# Author: Florian "Bluewind" Pritz <f-p@gmx.at>
+#
+# Copyright (C) 2009 Florian Pritz
+#
+# Licensed under GNU General Public License v3
+# (see COPYING for full license text)
+#----------------------------------------------------
+# got bored and a.sh has some problems with spaces
+#----------------------------------------------------
+
+import sys
+import tarfile
+
+def main():
+ if len(sys.argv) == 1:
+ sys.stderr.write("No files specified!\n")
+ sys.exit(1)
+
+ tarname = sys.argv[1] + ".tar.gz"
+
+ tar = tarfile.open(tarname, "w|gz")
+ for name in sys.argv[1:]:
+ try:
+ tar.add(name)
+ except OSError:
+ sys.stderr.write("No such file or directory: '%s'\n" % name)
+ tar.close()
+
+if __name__ == '__main__':
+ main()