Skip to content

Commit

Permalink
Always use base names when working with patches
Browse files Browse the repository at this point in the history
Signed-off-by: Nikola Forró <nforro@redhat.com>
  • Loading branch information
nforro committed Feb 7, 2020
1 parent eb45e58 commit 98b58aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rebasehelper/specfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ def _get_patch_strip_options(self, patches):
except ParseError:
continue
rest = [os.path.basename(a) for a in rest]
indexes = [p[1] for p in patches if p[0] in rest]
indexes = [p[1] for p in patches if os.path.basename(p[0]) in rest]
for idx in indexes:
if idx not in result or result[idx] < ns.p:
result[idx] = ns.p
Expand Down Expand Up @@ -435,7 +435,7 @@ def is_comment(line):
section = self.spec_content[tag.section_index]
if section is None:
continue
patch_name = self.get_raw_tag_value(tag.name) or ''
patch_name = os.path.basename(self.get_raw_tag_value(tag.name) or '')
if 'deleted' in patches:
patch_removed = [x for x in patches['deleted'] if patch_name in x]
else:
Expand Down

0 comments on commit 98b58aa

Please sign in to comment.