Permalink
Browse files

More info when running the recipe

  • Loading branch information...
1 parent 3c1e25e commit 6c4d9db364c231f045dcdbc29a38b12c111f96cc Alvaro Saurin committed Mar 25, 2013
Showing with 14 additions and 11 deletions.
  1. +11 −7 as/recipe/frozenpkg/frozen.py
  2. +2 −3 as/recipe/frozenpkg/frozenrpm.py
  3. +1 −1 setup.py
@@ -62,7 +62,7 @@ def _create_venv(self, root_dir):
root_dir,
]
- logger.debug('Launching "%s"' % (" ".join(virtualenv)))
+ logger.info('Creating virtualenv by launching "%s".' % (" ".join(virtualenv)))
job = subprocess.Popen(virtualenv,
stdout = subprocess.PIPE,
stderr = subprocess.STDOUT)
@@ -94,6 +94,7 @@ def _copy_eggs (self, root_dir):
[self.buildout['buildout']['develop-eggs-directory'], self.buildout['buildout']['eggs-directory']]
)
+ logger.info('Installing eggs in virtualenv.')
for dist in ws:
if any([re.match(pattern, dist.location) for pattern in SKIP_EGGS]):
## skip the eggs in SKIP_EGGS
@@ -134,6 +135,7 @@ def _copy_outputs(self, root_dir):
Copies the outputs from parts
:param root_dir: the root directory where to copy things
"""
+ logger.info('Copying outputs.')
buildout_dir = self.buildout['buildout']['directory']
for part in self.buildout['buildout']['parts'].split():
try:
@@ -142,7 +144,7 @@ def _copy_outputs(self, root_dir):
rel_dir = os.path.relpath(output, buildout_dir)
dest_dir = os.path.join(root_dir, os.path.dirname(rel_dir))
- logger.debug('Copying %s -> %s' % (rel_dir, dest_dir))
+ logger.debug('... "%s" -> "%s"' % (rel_dir, dest_dir))
if not os.path.exists(dest_dir):
os.makedirs(dest_dir)
shutil.copy2(output, dest_dir)
@@ -169,6 +171,7 @@ def _copy_extra_files (self, root_dir, install_prefix):
for r in self.options.get('extra-copies', self.name).split('\n')
if r.strip()]
+ logger.info('Copying extras.')
for copy_line in extra_copies:
try:
src, dest = [b.strip() for b in copy_line.split("->")]
@@ -181,21 +184,21 @@ def _copy_extra_files (self, root_dir, install_prefix):
full_path_dest = os.path.normpath(os.path.join(buildroot, dest))
for src_el in glob.glob(src):
- logger.debug('Copying %s' % src_el)
+ logger.debug('... copying "%s".' % src_el)
try:
if os.path.isdir(src_el):
shutil.copytree(src_el, full_path_dest)
else:
# maybe the destination is a directory: then we have to
# create it at the target too...
if dest.endswith('/') and not os.path.exists(full_path_dest):
- logger.debug('... creating %s directory' % dest)
+ logger.debug('... creating "%s" directory.' % dest)
os.makedirs(full_path_dest)
shutil.copy(src_el, full_path_dest)
except Exception, e:
- logger.debug('ERROR: when copying %s to %s' % (src_el, full_path_dest))
+ logger.debug('ERROR: when copying "%s" to "%s"' % (src_el, full_path_dest))
return pythonpath
@@ -211,7 +214,7 @@ def _prepare_venv(self, root_dir):
root_dir,
]
- logger.debug('Launching "%s"' % (" ".join(virtualenv)))
+ logger.info('Making virtualenv relocatable with "%s".' % (" ".join(virtualenv)))
job = subprocess.Popen(virtualenv,
stdout = subprocess.PIPE,
stderr = subprocess.STDOUT)
@@ -222,14 +225,15 @@ def _prepare_venv(self, root_dir):
sys.exit(1)
local_dir = os.path.join(root_dir, "local")
- logger.debug('Removing"%s"' % local_dir)
+ logger.debug('Removing "%s".' % local_dir)
shutil.rmtree(local_dir)
def _create_tar (self, root_dir, filename, compress = False):
"""
Create a tar file from the virtualenv
"""
+ logger.info('Creating tar file.')
import tarfile
with tarfile.open(filename, 'w' if not compress else 'w:gz', dereference = True) as t:
for name in glob.glob(os.path.join(root_dir, '*')):
@@ -173,7 +173,6 @@ def install (self):
tar_filename = os.path.join(top_rpmbuild_dir, "SOURCES", pkg_name + ".tar")
tar_filename = self._create_tar(buildroot_topdir, tar_filename)
-
# launch rpmbuild
command = [
"rpmbuild",
@@ -183,12 +182,12 @@ def install (self):
"-ta", tar_filename,
]
- logger.debug('Launching "%s"' % ' '.join(command))
+ logger.info('Launching "%s".' % ' '.join(command))
job = subprocess.Popen(command, stdout = subprocess.PIPE, stderr = subprocess.STDOUT)
stdout, _ = job.communicate()
if job.returncode != 0:
- logger.critical('could not build the RPM')
+ logger.critical('could not build the RPM.')
print stdout
return []
View
@@ -4,7 +4,7 @@
import os
-__VERSION__ = '0.2.17'
+__VERSION__ = '0.2.18'
#def read(*rnames):

0 comments on commit 6c4d9db

Please sign in to comment.