magnuma3 opened a new pull request, #1405:
URL: https://github.com/apache/bigtop/pull/1405
<!--
Thanks for sending a pull request!
1. If this is your first time, please read our contributor guidelines:
https://cwiki.apache.org/confluence/display/BIGTOP/How+to+Contribute
2. Make sure your PR title starts with JIRA issue id, e.g.,
'BIGTOP-3638: Your PR title ...'.
-->
### Description of PR
The hbase RPM creates versionless symlinks for jars using a sed pattern:
```
for i in `ls hbase*jar | grep -v tests.jar`
do
ln -s $i `echo $i | sed -n 's/\(.*\)\(-[0-9].*\)\(.jar\)/\1\3/p'`
done
```
The greedy \(.*\) makes the pattern strip only from the *last* "-<digit>"
occurrence. This breaks for version strings that contain an additional
"-<digit>" segment, e.g. a downstream/vendor version like 2.6.5-custom-1:
```
$ echo hbase-common-2.6.5-custom-1.jar | sed -n
's/\(.*\)\(-[0-9].*\)\(.jar\)/\1\3/p'
hbase-common-2.6.5-custom.jar
```
The expected link name is hbase-common.jar, but
hbase-common-2.6.5-custom.jar is created instead.
Fix: match against the known HBASE_VERSION explicitly instead of guessing
where the version starts:
```
for i in `ls hbase*jar | grep -v tests.jar`
do
if [[ $i =~ hbase-(.*)-${HBASE_VERSION}.jar ]]; then
name=${BASH_REMATCH[1]}
ln -s $i hbase-$name.jar
fi
done
```
### How was this patch tested?
### For code changes:
- [x] Does the title or this PR starts with the corresponding JIRA issue id
(e.g. 'BIGTOP-3638. Your PR title ...')?
- [ ] Make sure that newly added files do not have any licensing issues.
When in doubt refer to https://www.apache.org/licenses/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]