/[gli]/branches/overhaul/src/GLIPortage.py
Gentoo

Diff of /branches/overhaul/src/GLIPortage.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1760 Revision 1761
84 if not os.path.isdir(self._chroot_dir + "/var/cache"): 84 if not os.path.isdir(self._chroot_dir + "/var/cache"):
85 os.mkdir(self._chroot_dir + "/var/cache", mode=0755) 85 os.mkdir(self._chroot_dir + "/var/cache", mode=0755)
86 if not os.path.isdir(self._chroot_dir + "/var/cache/edb"): 86 if not os.path.isdir(self._chroot_dir + "/var/cache/edb"):
87 os.mkdir(self._chroot_dir + "/var/cache/edb", mode=0775) 87 os.mkdir(self._chroot_dir + "/var/cache/edb", mode=0775)
88 # chown to root:portage 88 # chown to root:portage
89 try:
89 counter_f = open(self._chroot_dir + "/var/cache/edb/counter", "w") 90 counter_f = open(self._chroot_dir + "/var/cache/edb/counter", "w")
90 counter_f.write(str(counter)) 91 counter_f.write(str(counter))
91 counter_f.close() 92 counter_f.close()
93 except:
94 raise GLIException("UpdateCounterError", 'fatal', 'update_counter', "could not write new counter value")
92 return counter 95 return counter
93 96
94 def copy_pkg_to_chroot(self, package, use_root=False, ignore_missing=False): 97 def copy_pkg_to_chroot(self, package, use_root=False, ignore_missing=False):
95 symlinks = { '/bin': '/mnt/livecd/bin/', '/boot': '/mnt/livecd/boot/', '/lib': '/mnt/livecd/lib/', 98 symlinks = { '/bin': '/mnt/livecd/bin/', '/boot': '/mnt/livecd/boot/', '/lib': '/mnt/livecd/lib/',
96 '/opt': '/mnt/livecd/opt/', '/sbin': '/mnt/livecd/sbin/', '/usr': '/mnt/livecd/usr/', 99 '/opt': '/mnt/livecd/opt/', '/sbin': '/mnt/livecd/sbin/', '/usr': '/mnt/livecd/usr/',
151 if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): copying vdb entry for " + package) 154 if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): copying vdb entry for " + package)
152 if not GLIUtility.exitsuccess(GLIUtility.spawn("mkdir -p " + self._chroot_dir + "/var/db/pkg/" + package + " && cp -a /var/db/pkg/" + package + "/* " + self._chroot_dir + "/var/db/pkg/" + package, logfile=self._compile_logfile, append_log=True)): 155 if not GLIUtility.exitsuccess(GLIUtility.spawn("mkdir -p " + self._chroot_dir + "/var/db/pkg/" + package + " && cp -a /var/db/pkg/" + package + "/* " + self._chroot_dir + "/var/db/pkg/" + package, logfile=self._compile_logfile, append_log=True)):
153 raise GLIException("CopyPackageToChrootError", 'fatal', 'copy_pkg_to_chroot', "Could not copy vdb entry for " + package) 156 raise GLIException("CopyPackageToChrootError", 'fatal', 'copy_pkg_to_chroot', "Could not copy vdb entry for " + package)
154 157
155 # Update COUNTER 158 # Update COUNTER
159 if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): calling update_counter() to get updated COUNTER value for " + package)
160 counter = self.update_counter()
156 try: 161 try:
157 if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): calling update_counter() to get updated COUNTER value for " + package)
158 counter = self.update_counter()
159 if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): updating COUNTER value in vdb entry for " + package) 162 if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): updating COUNTER value (%s) in vdb entry for %s" % (self._chroot_dir + "/var/db/pkg/" + package + "/COUNTER", package))
160 counter_f = open(self._chroot_dir + "/var/db/pkg/" + package + "/COUNTER", "w") 163 counter_f = open(self._chroot_dir + "/var/db/pkg/" + package + "/COUNTER", "w")
161 counter_f.write(str(counter)) 164 counter_f.write(str(counter))
162 counter_f.close() 165 counter_f.close()
163 except: 166 except:
164 raise GLIException("CopyPackageToChrootError", 'fatal', 'copy_pkg_to_chroot', "Could not update COUNTER for " + package) 167 raise GLIException("CopyPackageToChrootError", 'fatal', 'copy_pkg_to_chroot', "Could not update COUNTER for " + package)

Legend:
Removed from v.1760  
changed lines
  Added in v.1761

  ViewVC Help
Powered by ViewVC 1.1.20