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

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

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

Revision 1314 Revision 1338
3# This source code is distributed under the terms of version 2 of the GNU 3# This source code is distributed under the terms of version 2 of the GNU
4# General Public License as published by the Free Software Foundation, a copy 4# General Public License as published by the Free Software Foundation, a copy
5# of which can be found in the main directory of this project. 5# of which can be found in the main directory of this project.
6Gentoo Linux Installer 6Gentoo Linux Installer
7 7
8$Id: GLIPortage.py,v 1.48 2006/02/27 20:35:34 agaffney Exp $ 8$Id: GLIPortage.py,v 1.49 2006/03/05 03:06:44 agaffney Exp $
9""" 9"""
10 10
11import re 11import re
12import os 12import os
13import sys 13import sys
128 # Use tar to transfer files into IMAGE directory 128 # Use tar to transfer files into IMAGE directory
129 if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): running 'tar -cp --files-from=/tmp/tarfilelist --no-recursion 2>/dev/null | tar -C " + self._chroot_dir + image_dir + " -xp'") 129 if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): running 'tar -cp --files-from=/tmp/tarfilelist --no-recursion 2>/dev/null | tar -C " + self._chroot_dir + image_dir + " -xp'")
130 if not GLIUtility.exitsuccess(GLIUtility.spawn("tar -cp --files-from=/tmp/tarfilelist --no-recursion 2>/dev/null | tar -C " + self._chroot_dir + image_dir + " -xp", logfile=self._compile_logfile, append_log=True)): 130 if not GLIUtility.exitsuccess(GLIUtility.spawn("tar -cp --files-from=/tmp/tarfilelist --no-recursion 2>/dev/null | tar -C " + self._chroot_dir + image_dir + " -xp", logfile=self._compile_logfile, append_log=True)):
131 raise GLIException("CopyPackageToChrootError", 'fatal', 'copy_pkg_to_chroot', "Could not execute tar for " + package) 131 raise GLIException("CopyPackageToChrootError", 'fatal', 'copy_pkg_to_chroot', "Could not execute tar for " + package)
132 132
133 # Fix mode, uid, and gid of directories
134 if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): running find " + self._chroot_dir + image_dir + " -type d 2>/dev/null | sed -e 's:^" + self._chroot_dir + image_dir + "::' | grep -v '^$'")
135 dirlist = GLIUtility.spawn("find " + self._chroot_dir + image_dir + " -type d 2>/dev/null | sed -e 's:^" + self._chroot_dir + image_dir + "::' | grep -v '^$'", return_output=True)[1].strip().split("\n")
136 if not dirlist or dirlist[0] == "":
137 raise GLIException("CopyPackageToChrootError", 'fatal', 'copy_pkg_to_chroot', "directory list entry for " + package + "...this shouldn't happen!")
138 for dir in dirlist:
139 dirstat = os.stat(dir)
140 os.chown(self._chroot_dir + image_dir + dir, dirstat[4], dirstat[5])
141 os.chmod(self._chroot_dir + image_dir + dir, dirstat[0])
142
133# # More symlink crappiness hacks 143# # More symlink crappiness hacks
134# for symlink in symlinks: 144# for symlink in symlinks:
135## if GLIUtility.is_file(self._chroot_dir + image_dir + symlinks[symlink]): 145## if GLIUtility.is_file(self._chroot_dir + image_dir + symlinks[symlink]):
136# if os.path.islink(self._chroot_dir + image_dir + symlink): 146# if os.path.islink(self._chroot_dir + image_dir + symlink):
137# if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): fixing " + symlink + " symlink ickiness stuff in " + image_dir + " for " + package) 147# if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): fixing " + symlink + " symlink ickiness stuff in " + image_dir + " for " + package)
153 if not entries: 163 if not entries:
154 if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): no files for " + package + "...skipping copy from image dir to /") 164 if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): no files for " + package + "...skipping copy from image dir to /")
155 else: 165 else:
156 if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): copying files from " + image_dir + " to / for " + package) 166 if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): copying files from " + image_dir + " to / for " + package)
157# if not GLIUtility.exitsuccess(GLIUtility.spawn("cp -a " + self._chroot_dir + image_dir + "/* " + self._chroot_dir)): 167# if not GLIUtility.exitsuccess(GLIUtility.spawn("cp -a " + self._chroot_dir + image_dir + "/* " + self._chroot_dir)):
158 if not GLIUtility.exitsuccess(GLIUtility.spawn("tar -C " + self._chroot_dir + image_dir + "/ -c . | tar -C " + self._chroot_dir + "/ -x", logfile=self._compile_logfile, append_log=True)): 168 if not GLIUtility.exitsuccess(GLIUtility.spawn("tar -C " + self._chroot_dir + image_dir + "/ -cp . | tar -C " + self._chroot_dir + "/ -xp", logfile=self._compile_logfile, append_log=True)):
159 raise GLIException("CopyPackageToChrootError", 'fatal', 'copy_pkg_to_chroot', "Could not copy files from " + image_dir + " to / for " + package) 169 raise GLIException("CopyPackageToChrootError", 'fatal', 'copy_pkg_to_chroot', "Could not copy files from " + image_dir + " to / for " + package)
160 170
161 # Run pkg_postinst 171 # Run pkg_postinst
162 if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): running postinst for " + package) 172 if self._debug: self._logger.log("DEBUG: copy_pkg_to_chroot(): running postinst for " + package)
163 if not GLIUtility.exitsuccess(GLIUtility.spawn("env " + root_cmd + " PORTAGE_TMPDIR=" + portage_tmpdir + " ebuild " + vdb_dir + package + "/*.ebuild postinst", chroot=tmp_chroot_dir, logfile=self._compile_logfile, append_log=True)): 173 if not GLIUtility.exitsuccess(GLIUtility.spawn("env " + root_cmd + " PORTAGE_TMPDIR=" + portage_tmpdir + " ebuild " + vdb_dir + package + "/*.ebuild postinst", chroot=tmp_chroot_dir, logfile=self._compile_logfile, append_log=True)):

Legend:
Removed from v.1314  
changed lines
  Added in v.1338

  ViewVC Help
Powered by ViewVC 1.1.20