> On Dec. 9, 2016, 11:45 a.m., Andrew Onischuk wrote:
> > ambari-server/src/main/package/rpm/preinstall.sh, line 16
> > <https://reviews.apache.org/r/54543/diff/1/?file=1579878#file1579878line16>
> >
> > Hello Di. Can you just sed it in one line? with sed 's|/$||g
> >
> > Like this:
> > ROOT=`echo "${RPM_INSTALL_PREFIX}" | sed 's|/$||g`
> >
> >
> > Example:
> > user@Empower:~$ echo '/' | sed 's|/$||g'
> >
> > user@Empower:~$ echo '/a/bc/' | sed 's|/$||g'
> > /a/bc
> > user@Empower:~$ echo '//' | sed 's|/$||g'
> > /
> > user@Empower:~$ echo '/ab' | sed 's|/$||g'
> > /ab
Blackquotes where not shown above. Meant this:
ROOT=`echo "${RPM_INSTALL_PREFIX}" | sed 's|/$||g'`
- Andrew
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/54543/#review158667
-----------------------------------------------------------
On Dec. 8, 2016, 7:42 p.m., Di Li wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/54543/
> -----------------------------------------------------------
>
> (Updated Dec. 8, 2016, 7:42 p.m.)
>
>
> Review request for Ambari, Andrew Onischuk and Tim Thorpe.
>
>
> Bugs: AMBARI-19140
> https://issues.apache.org/jira/browse/AMBARI-19140
>
>
> Repository: ambari
>
>
> Description
> -------
>
> Notice the "//" in the symbolic link , where it could have been trimmed to be
> just one leading "/"
>
> [root]# ll /usr/sbin/ambari-server
> lrwxrwxrwx 1 root root 26 Dec 5 11:27 /usr/sbin/ambari-server ->
> //etc/init.d/ambari-server
> [root]# clear
> [root]# ll
> total 20
> drwxrwxr-x 4 root root 8192 Dec 5 11:32 ambari_agent
> lrwxrwxrwx 1 root root 42 Dec 5 11:27 ambari_commons ->
> //usr/lib/ambari-server/lib/ambari_commons
> lrwxrwxrwx 1 root root 41 Dec 5 11:27 ambari_jinja2 ->
> //usr/lib/ambari-server/lib/ambari_jinja2
> drwxrwxr-x 2 root root 4096 Dec 5 11:28 ambari_server
> lrwxrwxrwx 1 root root 45 Dec 5 11:27 ambari_simplejson ->
> //usr/lib/ambari-server/lib/ambari_simplejson
> lrwxrwxrwx 1 root root 47 Dec 5 11:27 resource_management ->
> //usr/lib/ambari-server/lib/resource_management
> drwxr-xr-x 5 ams hadoop 83 Dec 6 09:26 resource_monitoring
>
>
> Diffs
> -----
>
> ambari-server/conf/unix/install-helper.sh 34ec0e9
> ambari-server/src/main/package/rpm/posttrans_server.sh a719cae
> ambari-server/src/main/package/rpm/preinstall.sh 524fea8
>
> Diff: https://reviews.apache.org/r/54543/diff/
>
>
> Testing
> -------
>
> build Ambari RPMs, install a trunk cluster with my own RPMs, verify the
> double "/"s are trimmed now.
>
>
> Thanks,
>
> Di Li
>
>