From: Pat Riehecky riehecky@fnal.gov
The previous return_disttag code expected a smaller number of '-' in the SCL name. This newer version now searches a bit more rationally.
I should have written it this way from the start....
Pat Riehecky (1): Updated for compat with devtoolset-3 software collection name
return_disttag.sh | 25 ++++++++++++------------- 1 files changed, 12 insertions(+), 13 deletions(-)
From: Pat Riehecky riehecky@fnal.gov
--- return_disttag.sh | 25 ++++++++++++------------- 1 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/return_disttag.sh b/return_disttag.sh index e846692..c92093a 100755 --- a/return_disttag.sh +++ b/return_disttag.sh @@ -122,37 +122,36 @@ SPEC=$(cd SPECS; ls *.spec)
#now get nvr from spec with placeholder dist mydist="XXXjsdf9ur7qlkasdh4gygXXX" -testnvr=$(build_with_dist_scl "SPECS/${SPEC}" ${mydist}) +test_nvr=$(build_with_dist_scl "SPECS/${SPEC}" ${mydist})
-git_name=$(echo ${git_nvr} | cut -d '-' -f 1) -test_name=$(echo ${testnvr} | cut -d '-' -f 1) - -if [[ "${git_name}" != "${test_name}" ]]; then - warn "Warning: ${git_name} != ${test_name}" +if [[ "${git_nvr}" != "${test_nvr}" ]]; then + warn "Warning: ${git_nvr} != ${test_nvr}" warn "Warning: Trying as a Software Collection" - testnvr=$(build_with_dist_scl "SPECS/${SPEC}" ${mydist} ${git_name}) + test_nodist=$(echo ${test_nvr} | sed -e 's/-[a-zA-Z0-9.]*$//') + git_nodist=$(echo ${git_nvr} | sed -e 's/-[a-zA-Z0-9.]*$//') + scl=$(echo ${git_nodist} |sed -e "s/-${test_nodist}//") + test_nvr=$(build_with_dist_scl "SPECS/${SPEC}" ${mydist} ${scl}) fi
-test_name=$(echo ${testnvr} | cut -d '-' -f 1) +git_name=$(echo ${git_nvr} | cut -d '-' -f 1) +test_name=$(echo ${test_nvr} | cut -d '-' -f 1) if [[ "${git_name}" != "${test_name}" ]]; then warn "Warning: ${git_name} != ${test_name}" echo "Warning: Couldn't match srpm name" >&2 exit 1 -else - scl=${git_name} fi
#use our placeholder dist to split the nvr -head=${testnvr%$mydist*} +head=${test_nvr%$mydist*}
-if [ ".$head" = ".$testnvr" ] +if [ ".$head" = ".$test_nvr" ] then #no dist tag echo "" exit fi
-tail=${testnvr#*$mydist} +tail=${test_nvr#*$mydist}
frag=${git_nvr#$head} dist=${frag%$tail}
From: Pat Riehecky riehecky@fnal.gov
helps when I build the correct patch set....
This implements the second half of the fix, knew that patch seemed incomplete.....
Pat Riehecky (1): updated into_srpm.sh with cleaner logic
into_srpm.sh | 33 ++++++++++++++++++++++----------- 1 files changed, 22 insertions(+), 11 deletions(-)
From: Pat Riehecky riehecky@fnal.gov
--- into_srpm.sh | 33 ++++++++++++++++++++++----------- 1 files changed, 22 insertions(+), 11 deletions(-)
diff --git a/into_srpm.sh b/into_srpm.sh index 922d899..5399dc9 100755 --- a/into_srpm.sh +++ b/into_srpm.sh @@ -174,35 +174,46 @@ fi
SPECFILE=$(cd SPECS; ls *.spec)
+# determine automatically unless we've got one set +if [[ "x${DIST}" == 'x' ]]; then + if [[ ${QUIET} -eq 1 ]]; then + DIST=$(return_disttag.sh -q) + else + DIST=$(return_disttag.sh) + fi +fi + # Determine if we are an SCL ISSCL=0 if [[ ${ALLOWSCL} -eq 1 ]]; then mytestsclname='DA39A3EE5E6B4B0D3255BFEF95601890AFD80709' - mysclcheck=$(rpm --define "dist el" --define "scl ${mytestsclname}" -q --specfile "SPECS/${SPECFILE}" --qf '%{n}-%{v}-%{r}\n' 2>/dev/null | head -n 1) + mysclcheck=$(rpm --define "dist ${DIST}" --define "scl ${mytestsclname}" -q --specfile "SPECS/${SPECFILE}" --qf '%{n}-%{v}-%{r}\n' 2>/dev/null | head -n 1) echo ${mysclcheck} | grep -q ${mytestsclname} if [[ $? -eq 0 ]]; then ISSCL=1 - SCLNAME=$(show_possible_srpms.sh | cut -d'-' -f1 | sort -u) + BASENAME=$(echo ${mysclcheck} | sed -e 's/DA39A3EE5E6B4B0D3255BFEF95601890AFD80709//') + RPMNAME=$(show_possible_srpms.sh | head -1) + SCLNAME=$(echo ${RPMNAME} | sed -e "s/${BASENAME}.src.rpm//") if [[ $(echo ${SCLNAME} | wc -l) -ne 1 ]]; then echo "$0 failed to determine unique SCL name" >&2 echo "Found:" >&2 echo "${SCLNAME}" >&2 fi + + scl_check=$(rpm --define "dist ${DIST}" --define "scl ${SCLNAME}" -q --specfile "SPECS/${SPECFILE}" --qf '%{n}-%{v}-%{r}.src.rpm\n' 2>/dev/null | head -n 1) + if [[ "${RPMNAME}" != "${scl_check}" ]]; then + echo "$0 failed to verify SCL name" >&2 + echo "Found:" >&2 + echo "${SCLNAME}" >&2 + echo "made: ${scl_check}" >&2 + echo "expected: ${RPMNAME}" >&2 + fi fi fi
# build our rpmopts list RPMOPTS="-bs --nodeps"
-# determine automatically unless we've got one set -if [[ "x${DIST}" == 'x' ]]; then - if [[ ${QUIET} -eq 1 ]]; then - DIST=$(return_disttag.sh -q) - else - DIST=$(return_disttag.sh) - fi -fi - # put it all together if [[ ${ISSCL} -eq 1 ]]; then rpmbuild --define "%_topdir `pwd`" ${RPMOPTS} --define "%dist ${DIST}" --define "%scl ${SCLNAME}" SPECS/${SPECFILE}
On 11/11/2014 04:42 PM, Pat Riehecky wrote:
From: Pat Riehecky riehecky@fnal.gov
helps when I build the correct patch set....
This implements the second half of the fix, knew that patch seemed incomplete.....
Pat Riehecky (1): updated into_srpm.sh with cleaner logic
into_srpm.sh | 33 ++++++++++++++++++++++----------- 1 files changed, 22 insertions(+), 11 deletions(-)
Pat,
With both patches applied for testing, this is what I get with an SCL using into_srpm.sh:
[jhughes@T520 php55-php]$ into_srpm.sh SOURCES/php-5.5.6-strip.tar.xz exists. skipping Warning: php55-php-5.5.6-13.el7 != php-5.5.6-13XXXjsdf9ur7qlkasdh4gygXXX Warning: Trying as a Software Collection Wrote: /home/jhughes/centos7-rpms/php55-php/SRPMS/php-5.5.6-13.el7.src.rpm
====== To me, it looks like it did not recognize it as an SCL .. the SRPM should have been:
php55-php-5.5.6-13.el7.src.rpm
Right? What am I missing. This is on an up2date c7 machine.
On 11/12/2014 02:42 AM, Johnny Hughes wrote:
On 11/11/2014 04:42 PM, Pat Riehecky wrote:
From: Pat Riehecky riehecky@fnal.gov
helps when I build the correct patch set....
This implements the second half of the fix, knew that patch seemed incomplete.....
Pat Riehecky (1): updated into_srpm.sh with cleaner logic
into_srpm.sh | 33 ++++++++++++++++++++++----------- 1 files changed, 22 insertions(+), 11 deletions(-)
Pat,
With both patches applied for testing, this is what I get with an SCL using into_srpm.sh:
[jhughes@T520 php55-php]$ into_srpm.sh SOURCES/php-5.5.6-strip.tar.xz exists. skipping Warning: php55-php-5.5.6-13.el7 != php-5.5.6-13XXXjsdf9ur7qlkasdh4gygXXX Warning: Trying as a Software Collection Wrote: /home/jhughes/centos7-rpms/php55-php/SRPMS/php-5.5.6-13.el7.src.rpm
====== To me, it looks like it did not recognize it as an SCL .. the SRPM should have been:
php55-php-5.5.6-13.el7.src.rpm
Right? What am I missing. This is on an up2date c7 machine.
You'll have to pass into_srpm.sh a '-s'
[riehecky@testify php55-php]# into_srpm.sh SOURCES/php-5.5.6-strip.tar.xz exists. skipping Warning: php55-php-5.5.6-13.el7 != php-5.5.6-13XXXjsdf9ur7qlkasdh4gygXXX Warning: Trying as a Software Collection Wrote: /tmp/php55-php/SRPMS/php-5.5.6-13.el7.src.rpm
[riehecky@testify php55-php]# into_srpm.sh -s SOURCES/php-5.5.6-strip.tar.xz exists. skipping Warning: php55-php-5.5.6-13.el7 != php-5.5.6-13XXXjsdf9ur7qlkasdh4gygXXX Warning: Trying as a Software Collection Wrote: /tmp/php55-php/SRPMS/php55-php-5.5.6-13.el7.src.rpm
The SCL logic is off by default, I've no objection to enabling it by default, but when I put it in I was aiming to not disrupt anyone's workflows with behavior changes. I'm not sure what the larger community's expectation is of this script, particularly given the optional parameters of SCL as a whole.
Pat
On 11/12/2014 08:26 AM, Pat Riehecky wrote:
On 11/12/2014 02:42 AM, Johnny Hughes wrote:
On 11/11/2014 04:42 PM, Pat Riehecky wrote:
From: Pat Riehecky riehecky@fnal.gov
helps when I build the correct patch set....
This implements the second half of the fix, knew that patch seemed incomplete.....
Pat Riehecky (1): updated into_srpm.sh with cleaner logic
into_srpm.sh | 33 ++++++++++++++++++++++----------- 1 files changed, 22 insertions(+), 11 deletions(-)
Pat,
With both patches applied for testing, this is what I get with an SCL using into_srpm.sh:
[jhughes@T520 php55-php]$ into_srpm.sh SOURCES/php-5.5.6-strip.tar.xz exists. skipping Warning: php55-php-5.5.6-13.el7 != php-5.5.6-13XXXjsdf9ur7qlkasdh4gygXXX Warning: Trying as a Software Collection Wrote: /home/jhughes/centos7-rpms/php55-php/SRPMS/php-5.5.6-13.el7.src.rpm
====== To me, it looks like it did not recognize it as an SCL .. the SRPM should have been:
php55-php-5.5.6-13.el7.src.rpm
Right? What am I missing. This is on an up2date c7 machine.
You'll have to pass into_srpm.sh a '-s'
[riehecky@testify php55-php]# into_srpm.sh SOURCES/php-5.5.6-strip.tar.xz exists. skipping Warning: php55-php-5.5.6-13.el7 != php-5.5.6-13XXXjsdf9ur7qlkasdh4gygXXX Warning: Trying as a Software Collection Wrote: /tmp/php55-php/SRPMS/php-5.5.6-13.el7.src.rpm
[riehecky@testify php55-php]# into_srpm.sh -s SOURCES/php-5.5.6-strip.tar.xz exists. skipping Warning: php55-php-5.5.6-13.el7 != php-5.5.6-13XXXjsdf9ur7qlkasdh4gygXXX Warning: Trying as a Software Collection Wrote: /tmp/php55-php/SRPMS/php55-php-5.5.6-13.el7.src.rpm
The SCL logic is off by default, I've no objection to enabling it by default, but when I put it in I was aiming to not disrupt anyone's workflows with behavior changes. I'm not sure what the larger community's expectation is of this script, particularly given the optional parameters of SCL as a whole.
Pat
that is perfect .. just wanted to make sure it was doing what we want.
I'll commit it now
On 11/07/2014 04:41 PM, Pat Riehecky wrote:
From: Pat Riehecky riehecky@fnal.gov
The previous return_disttag code expected a smaller number of '-' in the SCL name. This newer version now searches a bit more rationally.
I should have written it this way from the start....
Pat Riehecky (1): Updated for compat with devtoolset-3 software collection name
return_disttag.sh | 25 ++++++++++++------------- 1 files changed, 12 insertions(+), 13 deletions(-)
CentOS-devel mailing list CentOS-devel@centos.org http://lists.centos.org/mailman/listinfo/centos-devel
Pat,
This does not seem to work with me for into_srpm.sh
[jhughes@T520 php55-php]$ into_srpm.sh Warning: php55-php-5.5.6-13.el7 != php-5.5.6-13XXXjsdf9ur7qlkasdh4gygXXX Warning: Trying as a Software Collection Wrote: /home/jhughes/centos7-rpms/php55-php/SRPMS/php-5.5.6-13.el7.src.rpm
Does this need a newer scl-utils or something else installed?
On 11/08/2014 08:56 AM, Johnny Hughes wrote:
On 11/07/2014 04:41 PM, Pat Riehecky wrote:
From: Pat Riehecky riehecky@fnal.gov
The previous return_disttag code expected a smaller number of '-' in the SCL name. This newer version now searches a bit more rationally.
I should have written it this way from the start....
Pat Riehecky (1): Updated for compat with devtoolset-3 software collection name
return_disttag.sh | 25 ++++++++++++------------- 1 files changed, 12 insertions(+), 13 deletions(-)
CentOS-devel mailing list CentOS-devel@centos.org http://lists.centos.org/mailman/listinfo/centos-devel
Pat,
This does not seem to work with me for into_srpm.sh
[jhughes@T520 php55-php]$ into_srpm.sh Warning: php55-php-5.5.6-13.el7 != php-5.5.6-13XXXjsdf9ur7qlkasdh4gygXXX Warning: Trying as a Software Collection Wrote: /home/jhughes/centos7-rpms/php55-php/SRPMS/php-5.5.6-13.el7.src.rpm
Does this need a newer scl-utils or something else installed?
NOTE: I have the following installed and doing it on C7:
scl-utils-build-20130529-9.el7_0.x86_64 scl-utils-20130529-9.el7_0.x86_64
On 11/08/2014 09:00 AM, Johnny Hughes wrote:
On 11/08/2014 08:56 AM, Johnny Hughes wrote:
On 11/07/2014 04:41 PM, Pat Riehecky wrote:
From: Pat Riehecky riehecky@fnal.gov
The previous return_disttag code expected a smaller number of '-' in the SCL name. This newer version now searches a bit more rationally.
I should have written it this way from the start....
Pat Riehecky (1): Updated for compat with devtoolset-3 software collection name
return_disttag.sh | 25 ++++++++++++------------- 1 files changed, 12 insertions(+), 13 deletions(-)
CentOS-devel mailing list CentOS-devel@centos.org http://lists.centos.org/mailman/listinfo/centos-devel
Pat,
This does not seem to work with me for into_srpm.sh
[jhughes@T520 php55-php]$ into_srpm.sh Warning: php55-php-5.5.6-13.el7 != php-5.5.6-13XXXjsdf9ur7qlkasdh4gygXXX Warning: Trying as a Software Collection Wrote: /home/jhughes/centos7-rpms/php55-php/SRPMS/php-5.5.6-13.el7.src.rpm
Does this need a newer scl-utils or something else installed?
NOTE: I have the following installed and doing it on C7:
scl-utils-build-20130529-9.el7_0.x86_64 scl-utils-20130529-9.el7_0.x86_64
Blast, I'll have to re-factor it a bit. Ideally it should "just work" if you've any version of SCL utils. A specific version dependency just creates confusion.
On 11/10/2014 08:17 AM, Pat Riehecky wrote:
On 11/08/2014 09:00 AM, Johnny Hughes wrote:
On 11/08/2014 08:56 AM, Johnny Hughes wrote:
On 11/07/2014 04:41 PM, Pat Riehecky wrote:
From: Pat Riehecky riehecky@fnal.gov
The previous return_disttag code expected a smaller number of '-' in the SCL name. This newer version now searches a bit more rationally.
I should have written it this way from the start....
Pat Riehecky (1): Updated for compat with devtoolset-3 software collection name
return_disttag.sh | 25 ++++++++++++------------- 1 files changed, 12 insertions(+), 13 deletions(-)
CentOS-devel mailing list CentOS-devel@centos.org http://lists.centos.org/mailman/listinfo/centos-devel
Pat,
This does not seem to work with me for into_srpm.sh
[jhughes@T520 php55-php]$ into_srpm.sh Warning: php55-php-5.5.6-13.el7 != php-5.5.6-13XXXjsdf9ur7qlkasdh4gygXXX Warning: Trying as a Software Collection Wrote: /home/jhughes/centos7-rpms/php55-php/SRPMS/php-5.5.6-13.el7.src.rpm
Does this need a newer scl-utils or something else installed?
NOTE: I have the following installed and doing it on C7:
scl-utils-build-20130529-9.el7_0.x86_64 scl-utils-20130529-9.el7_0.x86_64
Blast, I'll have to re-factor it a bit. Ideally it should "just work" if you've any version of SCL utils. A specific version dependency just creates confusion.
It was a bad regex, new patch coming soon, disregard this one.
Pat
From: Pat Riehecky riehecky@fnal.gov
This version has a more accurate regex for seperation parsing in return_disttag.sh.
Tested with git.c.o repos: devtoolset-3-xml-commons-apis php55 php55-php php
For into_srpm.sh tests, don't forget '-s' to enable scl detection code.
Pat Riehecky (1): Updated for compat with devtoolset-3 software collection name
return_disttag.sh | 27 ++++++++++++++------------- 1 files changed, 14 insertions(+), 13 deletions(-)
From: Pat Riehecky riehecky@fnal.gov
--- return_disttag.sh | 27 ++++++++++++++------------- 1 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/return_disttag.sh b/return_disttag.sh index e846692..2c1e522 100755 --- a/return_disttag.sh +++ b/return_disttag.sh @@ -122,37 +122,38 @@ SPEC=$(cd SPECS; ls *.spec)
#now get nvr from spec with placeholder dist mydist="XXXjsdf9ur7qlkasdh4gygXXX" -testnvr=$(build_with_dist_scl "SPECS/${SPEC}" ${mydist}) +test_nvr=$(build_with_dist_scl "SPECS/${SPEC}" ${mydist})
-git_name=$(echo ${git_nvr} | cut -d '-' -f 1) -test_name=$(echo ${testnvr} | cut -d '-' -f 1) +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_name}" != "${test_name}" ]]; then - warn "Warning: ${git_name} != ${test_name}" +if [[ "${git_nodist}" != "${test_nodist}" ]]; then + warn "Warning: ${git_nvr} != ${test_nvr}" warn "Warning: Trying as a Software Collection" - testnvr=$(build_with_dist_scl "SPECS/${SPEC}" ${mydist} ${git_name}) + 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.]*$//') fi
-test_name=$(echo ${testnvr} | cut -d '-' -f 1) -if [[ "${git_name}" != "${test_name}" ]]; then +if [[ "${git_nodist}" != "${test_nodist}" ]]; then + git_name=$(echo ${git_nvr} | cut -d '-' -f 1) + test_name=$(echo ${test_nvr} | cut -d '-' -f 1) warn "Warning: ${git_name} != ${test_name}" echo "Warning: Couldn't match srpm name" >&2 exit 1 -else - scl=${git_name} fi
#use our placeholder dist to split the nvr -head=${testnvr%$mydist*} +head=${test_nvr%$mydist*}
-if [ ".$head" = ".$testnvr" ] +if [ ".$head" = ".$test_nvr" ] then #no dist tag echo "" exit fi
-tail=${testnvr#*$mydist} +tail=${test_nvr#*$mydist}
frag=${git_nvr#$head} dist=${frag%$tail}
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2014-11-10 15:43, Pat Riehecky wrote:
+test_nodist=$(echo ${test_nvr} | sed -e 's/-[a-zA-Z0-9.]*$//') +git_nodist=$(echo ${git_nvr} | sed -e 's/-[a-zA-Z0-9._]*$//')
Why not `test_nodist="${foo_nvr%-*}"`?
- git_name=$(echo ${git_nvr} | cut -d '-' -f 1) +
test_name=$(echo ${test_nvr} | cut -d '-' -f 1)
Why not `test_nodist="${foo_nvr%%-*}"`?
- -- AF24 6DE9 D1DF DFB8 3A74 A7AC F457 B7A3 5DF1 4240
On 11/11/2014 03:01 AM, Elias Persson wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2014-11-10 15:43, Pat Riehecky wrote:
+test_nodist=$(echo ${test_nvr} | sed -e 's/-[a-zA-Z0-9.]*$//') +git_nodist=$(echo ${git_nvr} | sed -e 's/-[a-zA-Z0-9._]*$//')
Why not `test_nodist="${foo_nvr%-*}"`?
- git_name=$(echo ${git_nvr} | cut -d '-' -f 1) +
test_name=$(echo ${test_nvr} | cut -d '-' -f 1)
Why not `test_nodist="${foo_nvr%%-*}"`?
Mostly personal preference, I've never found that syntax terribly self explanatory. For new users, that syntax is nearly impossible to search for online.
Pat
AF24 6DE9 D1DF DFB8 3A74 A7AC F457 B7A3 5DF1 4240 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2
iQIcBAEBAgAGBQJUYdBaAAoJEPRXt6Nd8UJALpMP/0O6skW1jgWFNl1T2zAtf67f MR9v3+9y2quMCxUAXOEAC4G7PeXV+VACgoHSwBqlkIB/2bLYxpXptMS2ezdnhWNI vncpYDcuxtbWWplSOsibVRQPq3H1xJyPCflVCyWn2fooRDhEfRR1imRUDmcQhw+E USdmKvdu6A1iPiHqF5A142Mxy2qWjGjWMksGM+E3XD8rql6pl4WieNMjNm6imNZn fdivJahc84Ba9TmXR8qsABBZKjq+UAwAyvXyB2Oho1+xntJh/hG0VvEfGSSGYxZd 3YAc+lnzRr7OB11kA0uXmFlnrrGzjTtzXJbnK8mcmINBGsC6ZQ9zR9Kjg0q96y3x 1ZJl841em7++lATKdjOOJMSN/2KUxi+rdCQEuZUi92MAAz2mCuBpcHf6KysVKkP1 4IhBBaooIolFLCTN8ZtDTjB5v18LhHQf55/q+vLnO8acgaxTWoT2iAFwA86x9KHm uaOxyI+miLRif+cOZhjoufPNg80iLzK+Qq2avz8+4YpzhFGsjNN0hyA3uJlRUzPV IZTLkdOMb2Ii41ijJWhskTJhidZ/Nz7zuszTQh8B11AVuEwoL3K8Md/yRQykmen0 jILucOgj/y31JN8vfoCHoqbGhOLwBgs2gRSYA8UVaZRyxIr2VOQcfVSD6U6Yeyix j85rCOpAu/OnP2LzVkjl =4ju+ -----END PGP SIGNATURE----- _______________________________________________ CentOS-devel mailing list CentOS-devel@centos.org http://lists.centos.org/mailman/listinfo/centos-devel