|
Lines 133-154
Link Here
|
| 133 |
repo="$(readlink -fv -- "$repo")" |
133 |
repo="$(readlink -fv -- "$repo")" |
| 134 |
|
134 |
|
| 135 |
# does aptbox exist yet? |
135 |
# does aptbox exist yet? |
| 136 |
if [ -e aptbox -o -L aptbox ]; then |
136 |
if [ -e $aptbox -o -L $aptbox ]; then |
| 137 |
[ -n "$force" ] || fatal "remove $aptbox first." |
137 |
[ -n "$force" ] || fatal "remove $aptbox first." |
| 138 |
[ -d aptbox ] || fatal "$aptbox: invalid pathname." |
138 |
[ -d $aptbox ] || fatal "$aptbox: invalid pathname." |
| 139 |
|
139 |
|
| 140 |
# empty dir? |
140 |
# empty dir? |
| 141 |
if rmdir -- aptbox 2>/dev/null; then |
141 |
if rmdir -- $aptbox 2>/dev/null; then |
| 142 |
mkdir -m700 $verbose -- aptbox >&2 |
142 |
mkdir -m700 $verbose -- $aptbox >&2 |
| 143 |
cd aptbox |
143 |
cd $aptbox |
| 144 |
else |
144 |
else |
| 145 |
cd aptbox |
145 |
cd $aptbox |
| 146 |
[ -d ./etc/apt -a -d ./var/lib/rpm ] || |
146 |
[ -d ./etc/apt -a -d ./var/lib/rpm ] || |
| 147 |
fatal "$aptbox: doesn't look valid." |
147 |
fatal "$aptbox: doesn't look valid." |
| 148 |
fi |
148 |
fi |
| 149 |
else |
149 |
else |
| 150 |
mkdir -m700 $verbose -- aptbox >&2 |
150 |
mkdir -m700 $verbose -- $aptbox >&2 |
| 151 |
cd aptbox |
151 |
cd $aptbox |
| 152 |
fi |
152 |
fi |
| 153 |
|
153 |
|
| 154 |
verbose "Changed working directory to \`$aptbox'." |
154 |
verbose "Changed working directory to \`$aptbox'." |
|
Lines 201-215
Link Here
|
| 201 |
|
201 |
|
| 202 |
# create aptbox version of ~/.rpmrc if necessary. |
202 |
# create aptbox version of ~/.rpmrc if necessary. |
| 203 |
aptbox_home= |
203 |
aptbox_home= |
| 204 |
rpm_showrc="$(rpm --showrc)" |
204 |
rpm_showrc="rpm --showrc" |
| 205 |
current_arch="$(printf %s "$rpm_showrc" |sed -ne 's/^install arch[[:space:]]*:[[:space:]]*\([^[:space:]]\+\).*/\1/p')" |
205 |
current_arch="$(eval "$rpm_showrc" |sed -ne 's/^install arch[[:space:]]*:[[:space:]]*\([^[:space:]]\+\).*/\1/p')" |
| 206 |
[ -n "$current_arch" ] || |
206 |
[ -n "$current_arch" ] || |
| 207 |
current_arch="$(uname -m)" |
207 |
current_arch="$(uname -m)" |
| 208 |
[ "$current_arch" != "${target:-$def_target}" ] && |
208 |
[ "$current_arch" != "${target:-$def_target}" ] && |
| 209 |
alternate_arch=1 || |
209 |
alternate_arch=1 || |
| 210 |
alternate_arch= |
210 |
alternate_arch= |
| 211 |
if [ -n "$alternate_arch" ] && |
211 |
if [ -n "$alternate_arch" ] && |
| 212 |
! printf %s "$rpm_showrc" | |
212 |
! eval "$rpm_showrc" | |
| 213 |
LC_ALL=C grep -qs "^compatible archs[[:space:]]*:.*\<${target:-$def_target}\>"; then |
213 |
LC_ALL=C grep -qs "^compatible archs[[:space:]]*:.*\<${target:-$def_target}\>"; then |
| 214 |
aptbox_home="$aptbox/home/user" |
214 |
aptbox_home="$aptbox/home/user" |
| 215 |
for f in "$HOME/.rpmrc" "$HOME/.rpmmacros"; do |
215 |
for f in "$HOME/.rpmrc" "$HOME/.rpmmacros"; do |