shared-repo-unpack: fix mv calls

As the mv commands use a filename wildcard we need to tell check_call to
execute through the shell so that the wildcard is expanded, rather than
treat as a file name.

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
This commit is contained in:
Joshua Lock 2018-01-24 22:18:14 +00:00
parent 2591cb364b
commit 28cf55e5ab

View File

@ -42,9 +42,11 @@ with open(repojson) as f:
if os.path.exists(targetdir) and len(os.listdir(targetdir)):
trashdest = trashdir + "/" + target + "/" + str(int(time.time())) + '-' + str(random.randrange(100, 100000, 2))
utils.mkdir(trashdest)
subprocess.check_call(['mv', targetdir + '/*', trashdest])
subprocess.check_call('mv ' + targetdir + '/* ' + trashdest,
shell=True)
if len(os.listdir(targetdir)):
subprocess.check_call(['mv', targetdir +'/.[!.]*', trashdest])
subprocess.check_call('mv ' + targetdir + '/.[!.]* ' + trashdest,
shell=True)
for repo in sorted(repos.keys()):
if repo not in needrepos: