| … | |
… | |
| 69 | elif parts[0] == "sym": |
69 | elif parts[0] == "sym": |
| 70 | entries.append(" ".join(parts[1:4])) |
70 | entries.append(" ".join(parts[1:4])) |
| 71 | entries.sort() |
71 | entries.sort() |
| 72 | return entries |
72 | return entries |
| 73 | |
73 | |
|
|
74 | def update_counter(self): |
|
|
75 | try: |
|
|
76 | counter_f = open(self._chroot_dir + "/var/cache/edb/counter", "r") |
|
|
77 | counter = int(counter_f.readline().strip()) |
|
|
78 | counter_f.close() |
|
|
79 | except: |
|
|
80 | counter = 0 |
|
|
81 | counter += 1 |
|
|
82 | counter_f = open(self._chroot_dir + "/var/cache/edb/counter", "w") |
|
|
83 | counter_f.write(str(counter)) |
|
|
84 | counter_f.close() |
|
|
85 | return counter |
|
|
86 | |
| 74 | def copy_pkg_to_chroot(self, package, use_root=False, ignore_missing=False): |
87 | def copy_pkg_to_chroot(self, package, use_root=False, ignore_missing=False): |
| 75 | symlinks = { '/bin': '/mnt/livecd/bin/', '/boot': '/mnt/livecd/boot/', '/lib': '/mnt/livecd/lib/', |
88 | symlinks = { '/bin': '/mnt/livecd/bin/', '/boot': '/mnt/livecd/boot/', '/lib': '/mnt/livecd/lib/', |
| 76 | '/opt': '/mnt/livecd/opt/', '/sbin': '/mnt/livecd/sbin/', '/usr': '/mnt/livecd/usr/', |
89 | '/opt': '/mnt/livecd/opt/', '/sbin': '/mnt/livecd/sbin/', '/usr': '/mnt/livecd/usr/', |
| 77 | '/etc/gconf': '/usr/livecd/gconf/' } |
90 | '/etc/gconf': '/usr/livecd/gconf/' } |
| 78 | |
91 | |
| … | |
… | |
| 129 | |
142 | |
| 130 | # Copy the vdb entry for the package from the LiveCD to the chroot |
143 | # Copy the vdb entry for the package from the LiveCD to the chroot |
| 131 | if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): copying vdb entry for " + package) |
144 | if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): copying vdb entry for " + package) |
| 132 | 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)): |
145 | 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)): |
| 133 | raise GLIException("CopyPackageToChrootError", 'fatal', 'copy_pkg_to_chroot', "Could not copy vdb entry for " + package) |
146 | raise GLIException("CopyPackageToChrootError", 'fatal', 'copy_pkg_to_chroot', "Could not copy vdb entry for " + package) |
|
|
147 | |
|
|
148 | # Update COUNTER |
|
|
149 | try: |
|
|
150 | if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): calling update_counter() to get updated COUNTER value for " + package) |
|
|
151 | counter = self.update_counter() |
|
|
152 | if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): updating COUNTER value in vdb entry for " + package) |
|
|
153 | counter_f = open(self._chroot_dir + "/var/db/pkg/" + package + "/COUNTER", "w") |
|
|
154 | counter_f.write(str(counter)) |
|
|
155 | counter_f.close() |
|
|
156 | except: |
|
|
157 | raise GLIException("CopyPackageToChrootError", 'fatal', 'copy_pkg_to_chroot', "Could not update COUNTER for " + package) |
| 134 | |
158 | |
| 135 | # Create the image dir in the chroot |
159 | # Create the image dir in the chroot |
| 136 | if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): running 'mkdir -p " + self._chroot_dir + image_dir + "'") |
160 | if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): running 'mkdir -p " + self._chroot_dir + image_dir + "'") |
| 137 | if not GLIUtility.exitsuccess(GLIUtility.spawn("mkdir -p " + self._chroot_dir + image_dir, logfile=self._compile_logfile, append_log=True)): |
161 | if not GLIUtility.exitsuccess(GLIUtility.spawn("mkdir -p " + self._chroot_dir + image_dir, logfile=self._compile_logfile, append_log=True)): |
| 138 | raise GLIException("CopyPackageToChrootError", 'fatal', 'copy_pkg_to_chroot', "Could not create image dir for " + package) |
162 | raise GLIException("CopyPackageToChrootError", 'fatal', 'copy_pkg_to_chroot', "Could not create image dir for " + package) |