From 3f93433b0edadec425074251be67ac3adf446d78 Mon Sep 17 00:00:00 2001 From: Robert-André Mauchin Date: Mar 08 2018 17:17:58 +0000 Subject: Grab the correct first line in case of rpm output Signed-off-by: Robert-André Mauchin --- diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py index 74cdbfc..37259de 100644 --- a/pyrpkg/__init__.py +++ b/pyrpkg/__init__.py @@ -690,7 +690,7 @@ class Commands(object): # We make sure there is a space at the end of our query so that # we can split it later. When there are subpackages, we get a # listing for each subpackage. We only care about the first. - cmd.extend(['-q', '--qf', '"%{NAME} %{EPOCH} %{VERSION} %{RELEASE}??"', + cmd.extend(['-q', '--qf', '"??%{NAME} %{EPOCH} %{VERSION} %{RELEASE}??"', '--specfile', '"%s"' % os.path.join(self.path, self.spec)]) joined_cmd = ' '.join(cmd) try: @@ -712,7 +712,7 @@ class Commands(object): self.log.error(err) # Get just the output, then split it by ??, grab the first and split # again to get ver and rel - first_line_output = output.split('??')[0] + first_line_output = output.split('??')[1] parts = first_line_output.split() if len(parts) != 4: raise rpkgError('Could not get n-v-r-e from %r'