On Sun, Jul 16, 2017 at 03:34:07AM +0200, Klemens Nanni wrote:
> $_l is not used and picking the latest archive versions is of no use
> if /usr/lib cannot be written to.
> 
> This patch applies cleanly before my next one but not vice versa.
> 
> Feedback? OK?

_l is only unused after your second patch :)

hoisting the remount over picking the library version makes sense,
but you should keep it after the "echo -n 'reordering libraries:'"

> 
> Index: rc
> ===================================================================
> RCS file: /cvs/src/etc/rc,v
> retrieving revision 1.507
> diff -u -p -r1.507 rc
> --- rc        4 Jul 2017 19:02:11 -0000       1.507
> +++ rc        16 Jul 2017 01:25:27 -0000
> @@ -158,7 +158,7 @@ make_keys() {
>  
>  # Re-link libraries, placing the objects in a random order.
>  reorder_libs() {
> -     local _dkdev _l _liba _libas _mp _tmpdir _remount=false _error=false
> +     local _dkdev _liba _libas _mp _tmpdir _remount=false _error=false
>  
>       [[ $library_aslr == NO ]] && return
>  
> @@ -168,6 +168,16 @@ reorder_libs() {
>       # Skip if /usr/lib is on a nfs mounted filesystem.
>       [[ $_mp == *' type nfs '* ]] && return
>  

        echo -n 'reordering libraries:'

> +     # Remount read-write, if /usr/lib is on a read-only ffs filesystem.
> +     if [[ $_mp == *' type ffs '*'read-only'* ]]; then
> +             if mount -u -w $_dkdev; then
> +                     _remount=true
> +             else
> +                     echo ' failed.'
> +                     return
> +             fi
> +     fi
> +
>       echo -n 'reordering libraries:'

delete this

>  
>       # Only choose the latest version of the libraries.
> @@ -178,16 +188,6 @@ reorder_libs() {
>               done
>               _libas="$_libas $_liba"
>       done
> -
> -     # Remount read-write, if /usr/lib is on a read-only ffs filesystem.
> -     if [[ $_mp == *' type ffs '*'read-only'* ]]; then
> -             if mount -u -w $_dkdev; then
> -                     _remount=true
> -             else
> -                     echo ' failed.'
> -                     return
> -             fi
> -     fi
>  
>       for _liba in $_libas; do
>               _tmpdir=$(mktemp -dq /tmp/_librebuild.XXXXXXXXXXXX) && (
> 

Reply via email to