#12 Improve bundled deps script
Closed a month ago by alexsaezm. Opened 3 years ago by losuler.
rpms/ losuler/golang rawhide  into  rawhide

file modified
+11 -4
@@ -1,4 +1,4 @@ 

- #! /bin/bash

+ #!/bin/bash

  # Copyright (C) 2021 Jakub Čajka jcajka@redhat.com

  #

  # This program is free software; you can redistribute it and/or
@@ -16,8 +16,15 @@ 

  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

  

  provides=""

+ 

  for bundle in $(find -name modules.txt); do

- provides="$provides\n$(cat "$bundle" | grep "^# " | grep -v "# explicit" | sed -r s/"^#.* => "// | sed -r "s/# //" | sed -r "s:(.*) v(.*):Provides\: bundled(golang(\1)) = \2:")"

+     provides="$provides\n$(cat "$bundle" |

+         grep "^# " |

+         grep -v "# explicit" |

+         sed -r s/"^#.* => "// |

+         sed -r "s/# //" |

+         sed -r "s:(.*) v(.*):Provides\: bundled(golang(\1)) = \2:")"

  done

- #TODO replace - with . in version per packaging guidelines

- echo -e "$provides" | sort -u

+ 

+ echo -e "$provides" | sort -u |

+     sed -r "s/([0-9]+\.[0-9]+\.[0-9]+)-([pre]*[0-9\.]*)-([a-zA-Z0-9]+)/\1\.\2\.\3/g"

I was using this script today (thanks for writing it) so I added what was mentioned in the TODO (replacing - with . in the version field). This made an already long line even longer so I moved it to multiple lines so it was easier to read and edit.

1 new commit added

  • Fix sed shouldn't include URLs
3 years ago

2 new commits added

  • Fix accommodate for pre-release versions (e.g. vX.Y.Z-pre)
  • Fix accommodate for versions with a suffix (e.g. vX.Y.Z-0)
3 years ago

I just realized that I fixed this issue myself several months ago, and I didn't see this PR when I did it. My bad for the late response. I only fixed the replacing - with . so I cherry-picked your change that splits the oneliner in one line and add it to rawhide. Thanks for the PR!

Pull-Request has been closed by alexsaezm

a month ago
Metadata