Add temporal file option to repo-checker.pl

This commit is contained in:
Alberto Planas 2013-09-04 10:33:48 +02:00
parent 6c6072b4fe
commit f54001eba9

View File

@ -15,6 +15,7 @@ import re
import shelve
import shutil
import subprocess
import tempfile
from urllib import quote_plus
import urllib2
from xml.etree import cElementTree as ET
@ -930,7 +931,12 @@ def _check_repo_group(self, id_, reqs, opts):
if not fn in downloads:
os.unlink(fn)
civs = "LC_ALL=C perl /suse/coolo/checker/repo-checker.pl '%s' '%s' 2>&1" % (destdir, ','.join(toignore))
# Create a temporal file for the params
params_file = tempfile.NamedTemporaryFile(deleted=False)
params_file.write('\n'.join(toignore))
params_file.close()
civs = "LC_ALL=C perl /suse/coolo/checker/repo-checker.pl '%s' -f %s 2>&1" % (destdir, params_file.name)
os.unlink(params_file.name)
#exit(1)
p = subprocess.Popen(civs, shell=True, stdout=subprocess.PIPE, close_fds=True)
#ret = os.waitpid(p.pid, 0)[1]