You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@ambari.apache.org by Di Li <di...@ca.ibm.com> on 2016/12/08 19:42:18 UTC

Review Request 54543: AMBARI-19140 Ambari Server symbolic links has double // when root dir is just /

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/54543/
-----------------------------------------------------------

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


Re: Review Request 54543: AMBARI-19140 Ambari Server symbolic links has double // when root dir is just /

Posted by Andrew Onischuk <ao...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/54543/#review158757
-----------------------------------------------------------




ambari-server/conf/unix/install-helper.sh (line 22)
<https://reviews.apache.org/r/54543/#comment229563>

    Can we rename this to ROOT_DIR_PATH. So it is more clear what is this variable.


- Andrew Onischuk


On Dec. 9, 2016, 6:41 p.m., Di Li wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/54543/
> -----------------------------------------------------------
> 
> (Updated Dec. 9, 2016, 6:41 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
> 
>


Re: Review Request 54543: AMBARI-19140 Ambari Server symbolic links has double // when root dir is just /

Posted by Andrew Onischuk <ao...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/54543/#review158988
-----------------------------------------------------------


Ship it!




Ship It!

- Andrew Onischuk


On Dec. 12, 2016, 7:58 p.m., Di Li wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/54543/
> -----------------------------------------------------------
> 
> (Updated Dec. 12, 2016, 7:58 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
> 
>


Re: Review Request 54543: AMBARI-19140 Ambari Server symbolic links has double // when root dir is just /

Posted by Di Li <di...@ca.ibm.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/54543/
-----------------------------------------------------------

(Updated Dec. 12, 2016, 7:58 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 (updated)
-----

  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


Re: Review Request 54543: AMBARI-19140 Ambari Server symbolic links has double // when root dir is just /

Posted by Di Li <di...@ca.ibm.com>.

> On Dec. 10, 2016, 12:56 p.m., Andrew Onischuk wrote:
> > ambari-server/conf/unix/install-helper.sh, line 21
> > <https://reviews.apache.org/r/54543/diff/2/?file=1581160#file1581160line21>
> >
> >     DIR_PATH="$ROOT"
> >     ROOT=`echo "${RPM_INSTALL_PREFIX}" | sed 's|/$||g'`
> >     
> >     Would this work for you, while being simpler than if-else?
> 
> Andrew Onischuk wrote:
>     meant this:
>     
>     
>     DIR_PATH="${RPM_INSTALL_PREFIX}"
>     ROOT=`echo "${RPM_INSTALL_PREFIX}" | sed 's|/$||g'`

Hello Andrew,

yes, the two lines approach works for my situation, I updated the patch accordingly.

Thanks.


- Di


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/54543/#review158755
-----------------------------------------------------------


On Dec. 12, 2016, 7:58 p.m., Di Li wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/54543/
> -----------------------------------------------------------
> 
> (Updated Dec. 12, 2016, 7:58 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
> 
>


Re: Review Request 54543: AMBARI-19140 Ambari Server symbolic links has double // when root dir is just /

Posted by Andrew Onischuk <ao...@hortonworks.com>.

> On Dec. 10, 2016, 12:56 p.m., Andrew Onischuk wrote:
> > ambari-server/conf/unix/install-helper.sh, line 21
> > <https://reviews.apache.org/r/54543/diff/2/?file=1581160#file1581160line21>
> >
> >     DIR_PATH="$ROOT"
> >     ROOT=`echo "${RPM_INSTALL_PREFIX}" | sed 's|/$||g'`
> >     
> >     Would this work for you, while being simpler than if-else?

meant this:


DIR_PATH="${RPM_INSTALL_PREFIX}"
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/#review158755
-----------------------------------------------------------


On Dec. 9, 2016, 6:41 p.m., Di Li wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/54543/
> -----------------------------------------------------------
> 
> (Updated Dec. 9, 2016, 6:41 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
> 
>


Re: Review Request 54543: AMBARI-19140 Ambari Server symbolic links has double // when root dir is just /

Posted by Andrew Onischuk <ao...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/54543/#review158755
-----------------------------------------------------------




ambari-server/conf/unix/install-helper.sh (line 21)
<https://reviews.apache.org/r/54543/#comment229561>

    DIR_PATH="$ROOT"
    ROOT=`echo "${RPM_INSTALL_PREFIX}" | sed 's|/$||g'`
    
    Would this work for you, while being simpler than if-else?


- Andrew Onischuk


On Dec. 9, 2016, 6:41 p.m., Di Li wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/54543/
> -----------------------------------------------------------
> 
> (Updated Dec. 9, 2016, 6:41 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
> 
>


Re: Review Request 54543: AMBARI-19140 Ambari Server symbolic links has double // when root dir is just /

Posted by Di Li <di...@ca.ibm.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/54543/
-----------------------------------------------------------

(Updated Dec. 9, 2016, 6:41 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 (updated)
-----

  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


Re: Review Request 54543: AMBARI-19140 Ambari Server symbolic links has double // when root dir is just /

Posted by Tim Thorpe <tt...@ca.ibm.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/54543/#review158558
-----------------------------------------------------------


Ship it!




Ship It!

- Tim Thorpe


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
> 
>


Re: Review Request 54543: AMBARI-19140 Ambari Server symbolic links has double // when root dir is just /

Posted by Andrew Onischuk <ao...@hortonworks.com>.

> 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
> 
>


Re: Review Request 54543: AMBARI-19140 Ambari Server symbolic links has double // when root dir is just /

Posted by Andrew Onischuk <ao...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/54543/#review158667
-----------------------------------------------------------




ambari-server/src/main/package/rpm/preinstall.sh (line 16)
<https://reviews.apache.org/r/54543/#comment229470>

    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


- Andrew Onischuk


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
> 
>