Created
June 30, 2014 15:23
-
-
Save ericfrederich/d5029d2dd4bf84551485 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from cleantar import single_prefix | |
import sys | |
import os | |
import time | |
single, msg = single_prefix(sys.argv[1]) | |
if single: | |
print 'tar file is clean; just one prefix; will untar',; sys.stdout.flush() | |
for i in range(5, 0, -1): | |
print i,; sys.stdout.flush() | |
time.sleep(1) | |
os.execv('/bin/tar', ['/bin/tar', '-xvf', sys.argv[1]]) | |
print "SHOULDN'T GET HERE" | |
sys.exit(1) | |
else: | |
print msg | |
print '... will not untar' | |
print 'if you really want to untar, run this...' | |
print 'tar -xvf "%s"' % sys.argv[1] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment