--- debderiver +++ debderiver_patch6_2.py @@ -183,15 +183,6 @@ self._updates.append(upd) def _do(self, command): - """Execute a reprepro command.""" - - # TODO: replace this function with _do2, i.e. use subprocess - # instead of os.system. - - os.system(' '.join(('reprepro --noskipold -Vb', self._base_path, - command))) - - def _do2(self, command): """Execute a reprepro command with feedback.""" return subprocess.Popen(['reprepro', '--noskipold', '-Vb', @@ -206,7 +197,7 @@ if os.path.isfile(p): ext = f.split('.')[-1].lower() if ext in ('deb', 'dsc', 'udeb'): - self._do(' '.join(('include' + ext, suite, p))) + self._do(['include' + ext, suite, p]) def _include_thirdparty(self): """Recursively include third-party packages.""" @@ -241,9 +232,9 @@ command = ['-T', 'dsc', 'listfilter', dist.codename, '($Source (==' + src_pkg + '), $Version (% *' + self._op_sys.name.lower() + '*))'] - if not self._do2(command): + if not self._do(command): # Package version is not ours, it can be deleted. - self._do(' '.join(('removesrc', dist.codename, src_pkg))) + self._do(['removesrc', dist.codename, src_pkg]) def _write_configuration(self): if os.path.isdir(self._conf_path): @@ -350,8 +341,8 @@ """Update the repository.""" self._purge_purge_lists() - self._do('update') - self._do('processincoming all') + self._do(['update']) + self._do(['processincoming', 'all']) self._include_thirdparty()