Skip to content

Commit

Permalink
csmock: make kfp work for project-koku-koku-cbe5e5c3355c1e140aa1cca73…
Browse files Browse the repository at this point in the history
…77aebe09d8d8466

Make the code obtaining package name recognize a full-size SHA1 hash
encoded in lowercase as the `version` part, too.

Reported-by: Tapas Jena
Reported-by: Juan Perez de Algaba Sierra
Closes: #168
  • Loading branch information
kdudka committed May 21, 2024
1 parent 46ceee0 commit 23493fe
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions py/csmock
Original file line number Diff line number Diff line change
Expand Up @@ -987,8 +987,10 @@ exceeds the specified limit (defaults to 1024).")
else:
props.nvr = re.sub("\\.tar$", "", re.sub("\\.[^.]*$", "", srpm_base))

# cut off the -version-release or -version suffix to obtain package name
props.pkg = re.sub("-[v]?[0-9][^-]*(-[0-9][^-]*)?$", "", props.nvr)
# cut off the `-version-release` or `-version` suffix to obtain package name where `version` can be
# a number optionally prefixed by `v` or a full-size SHA1 hash encoded in lowercase as, for example,
# in `project-koku-koku-cbe5e5c3355c1e140aa1cca7377aebe09d8d8466`
props.pkg = re.sub("-(([v]?[0-9][^-]*)|([0-9a-f]{40}))(-[0-9][^-]*)?$", "", props.nvr)

# resolve name of the file/dir we are going to store the results to
if args.output is None:
Expand Down

0 comments on commit 23493fe

Please sign in to comment.