Bug 626858

Summary: set "arch" option in $HOME/.zypper.conf or via --config /path/zypper.conf - don't work
Product: [openSUSE] openSUSE 11.3 Reporter: Alex Savin <alexo.veto>
Component: libzyppAssignee: E-mail List <zypp-maintainers>
Status: RESOLVED INVALID QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None    
Version: Final   
Target Milestone: ---   
Hardware: Other   
OS: openSUSE 11.3   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Alex Savin 2010-07-29 22:12:02 UTC
User-Agent:       Opera/9.80 (X11; Linux i686; U; ru) Presto/2.6.30 Version/10.61

set "arch" option in  $HOME/.zypper.conf or via --config /path/zypper.conf  - don't work

but if change it in /etc/zypp/zypp.conf - it work

look at arch of downloaded file - in script below

Reproducible: Always

Steps to Reproduce:
#!/bin/bash
TDIR="`mktemp -d`"
mkdir -p $TDIR/etc/zypp/
if [[  "`uname --hardware-platform`" = "i386" ]] 
	then
	ARCH="x86_64"
else
	ARCH="i586"
fi

echo "[main]" > $TDIR/etc/zypp/zypp.conf
echo "arch = $ARCH" >> $TDIR/etc/zypp/zypp.conf

#also don't work
#echo "[main]" >  $HOME/.zypper.conf
#echo "arch = $ARCH" >> $HOME/.zypper.conf
#zypper="zypper --root $TDIR --no-gpg-checks "


zypper="zypper --root $TDIR --no-gpg-checks --config $TDIR/etc/zypp/zypp.conf "
#also don't work
#zypper="zypper --root $TDIR --no-gpg-checks --config /etc/zypp/zypp.conf "

$zypper addrepo http://download.opensuse.org/distribution/11.3/repo/oss/ oss
$zypper --non-interactive  install --download-only  filesystem
Actual Results:  




also, i think zypper should have option like "--arch"
Comment 1 Michael Andres 2010-07-30 13:17:51 UTC
(In reply to comment #0)
> set "arch" option in  $HOME/.zypper.conf or via --config /path/zypper.conf  -
> don't work

AFAIK zypper has no support for such an "arch" option. If you really want to fake the systems architecture, you need to do this in the zypp.conf (zypp! not zypper).

> but if change it in /etc/zypp/zypp.conf - it works

Yes, and you can use the ZYPP_CONF environment variable to change the location of the zypp.conf libztypp considers.


I don't know what you want to accomplish, but if you want to have a chroot using a different than your systems architecture (as far as this is possible):

$ mkdir -p /myroot/etc/zypp
$ cat <<EOF >/myroot/etc/zypp/zypp.conf
[main]
arch = s390
EOF
$ ZYPP_CONF=/myroot/etc/zypp/zypp.conf zypper --root /myroot --no-gpg-checks ...
Comment 2 Alex Savin 2010-08-01 18:06:08 UTC
big thanks for answer