--- mga-gnome/trunk/mga-gnome 2012/02/26 20:12:05 3082 +++ mga-gnome/trunk/mga-gnome 2012/02/26 20:21:16 3083 @@ -326,10 +326,9 @@ @property def svn_author(self): if not hasattr(self, '_svn_author'): - p = subprocess.Popen(['svn', 'log', '-q', "--", self.path], stdout=subprocess.PIPE, close_fds=True) - contents = p.stdout.read().strip("\n").splitlines() - ecode = p.wait() - if ecode == 0: + try: + contents = subprocess.check_output(['svn', 'log', '-q', "--", self.path], close_fds=True).strip("\n").splitlines() + for line in contents: if ' | ' not in line: continue @@ -337,6 +336,8 @@ fields = line.split(' | ') if len(fields) >= 3: self._svn_author = fields[1] + except subprocess.CalledProcessError: + pass if not hasattr(self, '_svn_author'): return None @@ -363,11 +364,7 @@ def get_downstream_names(): re_file = re.compile(r'^(?P.*?)[_-](?:(?P([0-9]+[\.])*[0-9]+)-)?(?P([0-9]+[\.\-])*[0-9]+)\.(?P(?:tar\.|diff\.)?[a-z][a-z0-9]*)$') - p = subprocess.Popen(['urpmf', '--files', '.', "--media", MEDIA], stdout=subprocess.PIPE, close_fds=True) - contents = p.stdout.read().strip("\n").splitlines() - ecode = p.wait() - if ecode != 0: - sys.exit(1) + contents = subprocess.check_output(['urpmf', '--files', '.', "--media", MEDIA], close_fds=True).strip("\n").splitlines() FILES = {} TARBALLS = {} @@ -420,7 +417,7 @@ matches = upstream & set(downstream.keys()) for module in matches: - print "\n".join(downstream[module]) + print "\n".join(sorted(downstream[module])) def cmd_patches(options, parser): upstream = get_upstream_names()