[sugar] [PATCH] Bundlebuilder use manifest, fix_manifest function
Jameson "Chema" Quinn
jquinn
Fri Jun 6 19:25:18 EDT 2008
Changes:
bundle.py
Added zip-agnostic _is_file() method to bundle class; used in activitybundle
for checking MANIFEST without unpacking
activitybundle.py
Moved basic logic for processing MANIFEST, including list_files, to
activitybundle.py ; this is necessary for checking when installing a bundle.
moved dependencies on activity registry and env to inline imports in
relevant methods; some bundle tasks should be doable with just these three
files. (This is doing only half of the job, the other half would be falling
back to importing the other modules not as submodules).
some simple globbing in list_files for ignored files, to allow ignoring
*.pyc.
reads manifest into a list of lines; then replaces invalid lines in place
with blank lines. This allows fix_manifest in bundlebuilder to leave all
existing files on same MANIFEST line number, which will help with diffs
later.
separate unpack from install (= unpack + register). Unpack checks for valid
MANIFEST but is set to only complain, not throw exceptions, by default, to
give folks time to clean up.
bundlebuilder.py:
fix_manifest function rewrites MANIFEST file.
SourcePackager.get_files calls out to git to get file names, or falls back
to MANIFEST otherwise.
On Fri, Jun 6, 2008 at 1:24 PM, Marco Pesenti Gritti <mpgritti at gmail.com>
wrote:
> On Fri, Jun 6, 2008 at 6:13 PM, Jameson Chema Quinn
> <jquinn at cs.oberlin.edu> wrote:
> > Note: this patch does not expose the fix_manifest function when running
> > bundlebuilder as a script. That would be a 2 or 3 line patch, seperately.
>
> Some initial notes:
>
> * Please run pylint on the changed files. You can use
> sugar-jhbuild/scripts/data/pylintrc. That will catch several problems
> and nitpicks that I'd ask you to fix anyway.
> * I dont understand all the
> warnings.warn(MalformedBundleException(...)). What's the purpose of
> those. Shouldn't they be real exceptions? What's the advantage of
> using the warnings module over logging.warning?
> * I'm not sure what you are using dest_dir for, but it looks like it
> should be part of Config.
> * Why are you moving the activity and env imports inline.
>
> As we discussed in irc, it would be good to split up patches. But
> anyway in the case of big patches like this, containing unrelated
> changes is good to provide a list of the changes you made and the
> reason you made them (can you provide such list when you resubmit the
> patch with pylint fixed? Thanks!).
>
> Marco
> _______________________________________________
> Sugar mailing list
> Sugar at lists.laptop.org
> http://lists.laptop.org/listinfo/sugar
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.laptop.org/pipermail/sugar/attachments/20080606/9b06c19d/attachment-0001.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bundleMANIFEST.patch
Type: text/x-diff
Size: 15196 bytes
Desc: not available
Url : http://lists.laptop.org/pipermail/sugar/attachments/20080606/9b06c19d/attachment-0001.patch
More information about the Sugar-devel
mailing list