#!/usr/bin/python #---------------------------------------------------- # Version: 0.1.0 # Author: Florian "Bluewind" Pritz # # 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()