--- mkaptbox.orig 2011-10-30 22:53:00.000000000 +0400 +++ mkaptbox 2012-02-03 14:43:51.801962399 +0400 @@ -133,22 +133,22 @@ repo="$(readlink -fv -- "$repo")" # does aptbox exist yet? -if [ -e aptbox -o -L aptbox ]; then +if [ -e $aptbox -o -L $aptbox ]; then [ -n "$force" ] || fatal "remove $aptbox first." - [ -d aptbox ] || fatal "$aptbox: invalid pathname." + [ -d $aptbox ] || fatal "$aptbox: invalid pathname." # empty dir? - if rmdir -- aptbox 2>/dev/null; then - mkdir -m700 $verbose -- aptbox >&2 - cd aptbox + if rmdir -- $aptbox 2>/dev/null; then + mkdir -m700 $verbose -- $aptbox >&2 + cd $aptbox else - cd aptbox + cd $aptbox [ -d ./etc/apt -a -d ./var/lib/rpm ] || fatal "$aptbox: doesn't look valid." fi else - mkdir -m700 $verbose -- aptbox >&2 - cd aptbox + mkdir -m700 $verbose -- $aptbox >&2 + cd $aptbox fi verbose "Changed working directory to \`$aptbox'." @@ -201,15 +201,15 @@ # create aptbox version of ~/.rpmrc if necessary. aptbox_home= -rpm_showrc="$(rpm --showrc)" -current_arch="$(printf %s "$rpm_showrc" |sed -ne 's/^install arch[[:space:]]*:[[:space:]]*\([^[:space:]]\+\).*/\1/p')" +rpm_showrc="rpm --showrc" +current_arch="$(eval "$rpm_showrc" |sed -ne 's/^install arch[[:space:]]*:[[:space:]]*\([^[:space:]]\+\).*/\1/p')" [ -n "$current_arch" ] || current_arch="$(uname -m)" [ "$current_arch" != "${target:-$def_target}" ] && alternate_arch=1 || alternate_arch= if [ -n "$alternate_arch" ] && - ! printf %s "$rpm_showrc" | + ! eval "$rpm_showrc" | LC_ALL=C grep -qs "^compatible archs[[:space:]]*:.*\<${target:-$def_target}\>"; then aptbox_home="$aptbox/home/user" for f in "$HOME/.rpmrc" "$HOME/.rpmmacros"; do