Fixing the argument handling with symlink support. - ns-tools - Namespace utilities to reuse Open Source packaging efforts.
       
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) LICENSE
       ---
 (DIR) commit cecf7ec16ba2637709ecab720a8fd190461f1577
 (DIR) parent 4f5ae8cc592b947f0674fc849a2fab2df422b966
 (HTM) Author: Christoph Lohmann <20h@r-36.net>
       Date:   Sun, 11 May 2014 16:56:38 +0200
       
       Fixing the argument handling with symlink support.
       
       Diffstat:
         bin/ns-chroot                       |       8 +++-----
       
       1 file changed, 3 insertions(+), 5 deletions(-)
       ---
 (DIR) diff --git a/bin/ns-chroot b/bin/ns-chroot
       @@ -6,14 +6,14 @@ dounprepare=0
        if [ "$basen" != "ns-chroot" ];
        tthen
                nsrootn="$basen"
       -        [ "$1" = "-u" ] && dounprepare=1 && shift 1
       +        [ $# -gt 1 ] && [ "$1" = "-u" ] && dounprepare=1 && shift 1
        else
                if [ $# -lt 1 ];
                then
                        printf "usage: %s [-u] ns [cmd]\n" "$(basename $0)" >&2
                        exit 1
                fi
       -        [ "$1" = "-u" ] && dounprepare=1 && shift 1
       +        [ $# -gt 1 ] && [ "$1" = "-u" ] && dounprepare=1 && shift 1
        
                nsrootn="$1"
                shift 1
       @@ -37,14 +37,12 @@ then
        else
                cmd="/bin/sh"
        fi
       -t[ $# -gt 1 ] && cmd="$2" && shift 1
       -shift 1
       +t[ $# -gt 0 ] && cmd="$1" && shift 1
        
        ns-prepare "$nsroot"
        t[ $? -gt 0 ] && exit 1
        
        export PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"
       -args="$@"
        if [ ! -d "${nsroot}${curdir}" ];
        tthen
                capchroot "$nsroot" $cmd -- "$@"