Replace string of a file with a string of another file for matches using grep,sed,awk

I have a file comp.pkglist which mention package version and release . In 'version change' and 'release change' line there are two versions 'old' and 'new' Version Change: --> Release Change: -->

cat comp.pkglist 
Package list:  nss-util-devel-3.28.4-1.el6_9.x86_64 
Version Change: 3.28.4 --> 3.36.0 
Release Change: 1.el6_9 --> 1.el6 

Package list:   tzdata-2018e-3.el6.noarch 
Version Change: 2018e --> 2018g 
Release Change: 3.el6 --> 1.el6

for every package name I need to search in /tmp directory and replace it`s version from old version to new version and old release to new release:

grep -ri -n tzdata /tmp/. 
/tmp/core.pkglist:578:package tzdata                  2018e 3.el6    arch noarch  

sed -i '578s/2018e/2018g/' /tmp/core.pkglist // To replace '2018e by 2018g in 578th line.

How can I make it work for all packages in the comp.pkglist file to replace it`s old version to new version and old release to new release in any file under the directory /tmp.

The script should :
1) Run a loop with inputs as the name of the package in the comp.pkglist.
2) It should then grep for that package name in the /tmp directory to know which file contains the package.

grep -ri -n tzdata /tmp/. /tmp/core.pkglist:578:package tzdata                  2018e 3.el6    arch noarch

3) Then it should replace old version/old release of the same package with new version.

 sed -i '578s/2018e/2018g/' /tmp/core.pkglist

After reading your request several times I have a hard time precisely understanding what you need. Amongst other questions it's unclear what be

  • the point you're stuck at with your attempts to a solution, and what you want changed.

  • the structure of files under /tmp.

  • the structure of entries to be modified.