#7 Fix -b (branch) flag in show_possible_srpms.sh
Opened 10 months ago by paulsd. Modified 8 months ago
https://git.centos.org/forks/paulsd/centos-git-common.git master  into  master

Fix {dist} macro regex to support stream RPMs with + in {dist}
Paul Donohue • 8 months ago  
Fix AUTHOR used for `show_possible_srpms.sh -r`
Paul Donohue • 8 months ago  
Fix -b (branch) flag in show_possible_srpms.sh
Paul Donohue • 10 months ago  
return_disttag.sh
file modified
+3 -3

@@ -124,15 +124,15 @@

  mydist="XXXjsdf9ur7qlkasdh4gygXXX"

  test_nvr=$(build_with_dist_scl "SPECS/${SPEC}" ${mydist})

  

- test_nodist=$(echo ${test_nvr} | sed -e 's/-[a-zA-Z0-9\.]*$//')

- git_nodist=$(echo ${git_nvr} | sed -e 's/-[a-zA-Z0-9\._]*$//')

+ test_nodist=$(echo ${test_nvr} | sed -e 's/-[a-zA-Z0-9.+]*$//')

+ git_nodist=$(echo ${git_nvr} | sed -e 's/-[a-zA-Z0-9.+_]*$//')

  

  if [[ "${git_nodist}" != "${test_nodist}" ]]; then

      warn "Warning: ${git_nvr} != ${test_nvr}"

      warn "Warning: Trying as a Software Collection"

      scl=$(echo ${git_nodist} |sed -e "s/-${test_nodist}//")

      test_nvr=$(build_with_dist_scl "SPECS/${SPEC}" ${mydist} ${scl})

-     test_nodist=$(echo ${test_nvr} | sed -e 's/-[a-zA-Z0-9\.]*$//')

+     test_nodist=$(echo ${test_nvr} | sed -e 's/-[a-zA-Z0-9.+]*$//')

  fi

  

  if [[ "${git_nodist}" != "${test_nodist}" ]]; then

show_possible_srpms.sh
file modified
+16 -13

@@ -37,7 +37,8 @@

  

  #####################################################################

  

- RHELAUTHOR="CentOS Buildsys <bugs@centos.org>"

+ # regex that matches "CentOS Sources" or "CentOS Buildsys"

+ RHELAUTHOR="CentOS \(Sources\|Buildsys\) <bugs@centos.org>"

  

  RHELONLY=0

  QUIET=0

@@ -97,11 +98,7 @@

      exit 1

  fi

  

- # commit message contains white space, set IFS to \n

- IFS='

- '

- 

- LOGARGS="--pretty=%H|\%s"

+ LOGARGS="--pretty='%H|%s'"

  if [[ ${RHELONLY} -eq 1 ]]; then

      LOGARGS="${LOGARGS} --author='${RHELAUTHOR}'"

  fi

@@ -110,29 +107,35 @@

      LOGARGS="${LOGARGS} ${BRANCH}"

  fi

  

- loglist=$(git log ${LOGARGS} |grep import)

+ loglist="$(eval "git log ${LOGARGS}" | grep import)"

  if [[ $? -ne 0 ]]; then

      exit 1

  fi

  

+ # split loglist on newline

+ splitloglist()

+ {

+     local IFS=$'\n'

+     loglist=($loglist)

+ }

+ splitloglist

+ 

  # flag for if nothing is found

  FOUND=False

- for entry in $loglist; do

+ for entry in "${loglist[@]}"; do

      FOUND=True

  

-     pkg=$(echo ${entry} | cut -d' ' -f2)

+     pkg=$(echo "${entry}" | cut -d' ' -f2)

      # strip .src.rpm if present

      nvr="${pkg%.src.rpm}"

      if [[ ${WITHCOMMITHASH} -eq 1 ]]; then

-         shasum=$(echo ${entry} | cut -d'|' -f1)

+         shasum=$(echo "${entry}" | cut -d'|' -f1)

          echo "${shasum}:${nvr}.src.rpm"

      else

          echo "${nvr}.src.rpm"

      fi

  done

  

- if [ "${FOUND}" != "True" ]

- then

+ if [ "${FOUND}" != "True" ]; then

      warn "No SRPMs found"

  fi

- 

no initial comment

IFS was affecting the expansion of LOGARGS in the git command

1 new commit added

  • Fix {dist} macro regex to support stream RPMs with + in {dist}
10 months ago

Added another commit to handle stream RPMs, like httpd-2.4.37-30.module+el8.3.0+7001+0766b9e7

rebased onto 253cbac

8 months ago