From: Huanhuan Li Date: Mon, 3 Mar 2014 07:03:11 +0000 (+0800) Subject: Fix zypp fail to download packages X-Git-Tag: 0.24~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7ec2306f2cb28cd7a070c1632397b956bb1ea4b4;p=tools%2Fmic.git Fix zypp fail to download packages If we changed all configuration in '/etc/mic/mic.conf' to other dirs like '/home/build/xx' instead of '/var/tmp/xx', mic wouldn't mount or create '/var/tmp' any more, then it would result in zypp can't download packages, becuase zypp will use '/var/tmp' to build cache as default Fixes: #1623 Change-Id: I6f69c4a6f9655f70d3cbfa6670756255bca171a4 --- diff --git a/plugins/backend/zypppkgmgr.py b/plugins/backend/zypppkgmgr.py index 604e3e9..87b33b3 100644 --- a/plugins/backend/zypppkgmgr.py +++ b/plugins/backend/zypppkgmgr.py @@ -79,6 +79,8 @@ class Zypp(BackendPlugin): self.has_prov_query = True self.install_debuginfo = False + # this can't be changed, it is used by zypp + self.tmp_file_path = '/var/tmp' def doFileLogSetup(self, uid, logfile): # don't do the file log for the livecd as it can lead to open fds @@ -117,6 +119,10 @@ class Zypp(BackendPlugin): def setup(self): self._cleanupRpmdbLocks(self.instroot) + # '/var/tmp' is used by zypp to build cache, so make sure + # if it exists + if not os.path.exists(self.tmp_file_path ): + os.makedirs(self.tmp_file_path) def whatObsolete(self, pkg): query = zypp.PoolQuery()