GNOME Bugzilla – Bug 654872
Delete no longer shipped files at install time
Last modified: 2011-10-11 15:59:10 UTC
Many very difficult to debug build problems arise when a component at some point in time ships a file (like a shared library), then later switches to not shipping it, but the file remains in the jhbuild root. This patch adjusts jhbuild to finally take advantage of the manifests we have in the packagedb thanks to using make install DESTDIR. I unified some work being done in 'jhbuild uninstall' with the install process in a new 'fileutils.py'.
Created attachment 192215 [details] [review] Delete no longer shipped files at install time
Review of attachment 192215 [details] [review]: Thank you for the patch. I am getting the following failure: jhbuild tinderbox Traceback (most recent call last):
+ Trace 228268
jhbuild.main.main(sys.argv[1:])
rc = jhbuild.commands.run(command, config, args, help=lambda: print_help(parser))
return cmd.execute(config, args, help)
return self.run(config, options, args, help)
return build.build()
error, altphases = module.run_phase(self, phase)
method(buildscript)
self.process_install(buildscript, self.get_revision())
buildscript.moduleset.packagedb.add(self.name, revision or '', absolute_new_contents)
self.entries[package].manifest = self._accumulate_dirtree_contents(destdir)
I think this would be a very nice improvement.
Created attachment 197827 [details] [review] Delete no longer shipped files at install time Rebased on top of bug 312910
Created attachment 197899 [details] [review] Delete no longer shipped files at install time Rebased to master
Review of attachment 197899 [details] [review]: Another important benifit is the removal of the previous library files, making $prefix/lib/ much cleaner. Two unimportant comments. ::: jhbuild/modtypes/__init__.py @@ +293,3 @@ raise CommandError(_("Module failed to install into DESTDIR %(dest)r") % {'dest': broken_name}) + else: + absolute_new_contents = map(lambda x: '/' + x, new_contents) I'd favour list comprehensions over map/lambda, not important. @@ +306,3 @@ + logging.info(_('Deleted: %(file)r') % { 'file': path, }) + elif error_string is None: + pass In my checks this condition happens at the moment because directories were stored in the manifest files, are there other possible situations? (would a comment explaining those be helpful?)
Attachment 197899 [details] pushed as 9dcbb9a - Delete no longer shipped files at install time
(In reply to comment #6) > > In my checks this condition happens at the moment because directories were > stored in the manifest files, are there other possible situations? (would a > comment explaining those be helpful?) Yeah in the old manifests we stored all directories leading up to the install path. As a side effect this patch stops adding them. You will see harmless e.g. "12 leftover files" after applying this patch - those are the directories for the prefix. We don't delete them.