Merge lp:~mikemc/ubuntuone-windows-installer/package-everything into lp:ubuntuone-windows-installer
| Status: | Merged | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Approved by: | Manuel de la Peña on 2012-07-26 | ||||||||||||
| Approved revision: | 134 | ||||||||||||
| Merged at revision: | 127 | ||||||||||||
| Proposed branch: | lp:~mikemc/ubuntuone-windows-installer/package-everything | ||||||||||||
| Merge into: | lp:ubuntuone-windows-installer | ||||||||||||
| Diff against target: |
462 lines (+253/-92) 1 file modified
scripts/setup-mac.py (+253/-92) |
||||||||||||
| To merge this branch: | bzr merge lp:~mikemc/ubuntuone-windows-installer/package-everything | ||||||||||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Manuel de la Peña (community) | Approve on 2012-07-26 | ||
| Alejandro J. Cura (community) | 2012-07-18 | Approve on 2012-07-18 | |
|
Review via email:
|
|||
Commit Message
- Package all helper apps, use symlinks to share resources (LP: #1025342)
Description of the Change
- Package all helper apps, use symlinks to share resources (LP: #1025342)
This also includes a couple other changes, including some code cleanup.
NOTE to testers:
The script currently expects to be run from a branch of ubuntuone-
That is fixed, but saved for a future merge.
To run with successful feelings, you need PYTHONPATH to include:
- a built copy of lp:~diego.sarmentero/+junk/python-macfsevents
- current trunk dirspec
- the same directory as setup-mac.py (to get conf.py)
- current trunk of ubuntu-sso-client, ubuntuone-client, and ubuntuone-
You will also need to run setup-mac using the buildout python.
To run the resulting executable, you can do the following:
% XDG_DATA_
However, with current trunk of storage-protocol as of this writing, you will see errors trying to find the SSL certs in /etc/ssl. See bug #1025950 for progress on that issue.
| Brian Curtin (brian.curtin) wrote : | # |
- 130. By Mike McCracken on 2012-07-18
-
style fix and comment-out the right unused executable
| Manuel de la Peña (mandel) wrote : | # |
Some stupid comments:
Is there a errno in a constant to be user here:
98 + if errno != 2:
is better than simply using 2, right?
What happens in '.py' is already present, we might as well test for it just in case:
157 + mainscript = os.path.join("bin", exename + ".py")
Shall we just remove the following:
189 + #NOTE: Disabled because this is not used as of 07/18/2012.
190 + # sso_ssl_app_path = do_setup(True,
191 + # "com.ubuntu.
192 + # "ubuntu-
Does it really give any required info for the next maintainers?
In the following:
406 + # copy everything in resources that isn't include, lib, or *.app:
407 + resources_to_copy = [p for p in helper_
408 + p not in ['include', 'lib']]
409 +
410 + for rsrc_name in resources_to_copy:
411 + shutil.
412 + os.path.
413 +
414 + # link to resources/include and resources/lib from the main bundle:
415 + resources_to_link = [os.path.
416 + for p in ['include', 'lib']]
['include', 'lib'] are the include and resources, would it be a good idea to make it a constants so that we don't have to chance it in the code. That way, if we have too add other strings we just have to modify it in a single place. Maybe the 'Resources' stirng is also a good candidate for a constant.
In the following:
337 + if len(dynload_paths) != 1:
338 + raise Exception("can't expand ", dynload_glob)
maybe len(dynload_paths) < 1 or len(dynload_paths) == 0, I don't exactly know if we should fail also if the length is bigger.
Besides the above I ran the script and everything seems to be ok.
- 131. By Mike McCracken on 2012-07-25
-
Use errno constant for readability
- 132. By Mike McCracken on 2012-07-25
-
Add constant for Resources/lib and Resources/include
- 133. By Mike McCracken on 2012-07-25
-
Remove unused packaging code for sso-ssl-
certificate- qt - 134. By Mike McCracken on 2012-07-25
-
Improve error messages for globbing
| Mike McCracken (mikemc) wrote : | # |
> Some stupid comments:
>
> Is there a errno in a constant to be user here:
>
> 98 + if errno != 2:
>
> is better than simply using 2, right?
Good point - I forgot about the errno module.
I've changed it to check against errno.ENOENT.
> What happens in '.py' is already present, we might as well test for it just in
> case:
>
> 157 + mainscript = os.path.join("bin", exename + ".py")
The bin/exename.py file is written as part of the prepare step, see line 210 (of the file).
In the line you quoted, it could be there (and about to get overwritten) or not there (and that's OK).
If the file isn't there and you run 'python setup-mac.py py2app' instead of 'python setup-mac.py prepare py2app', you will get a pretty readable error from py2app about it.
It's not simple for us to check it here, though, because it might be OK for it to be missing - if we are going to do the prepare step and it's the first time we're calling setup() on this run of the script.
I've left it as-is, let me know if you think it should do more.
> Shall we just remove the following:
>
> 189 + #NOTE: Disabled because this is not used as of 07/18/2012.
> 190 + # sso_ssl_app_path = do_setup(True,
> 191 + # "com.ubuntu.
> 192 + # "ubuntu-
>
> Does it really give any required info for the next maintainers?
Not really, removed.
> In the following:
>
> 406 + # copy everything in resources that isn't include, lib, or *.app:
> 407 + resources_to_copy = [p for p in helper_
> 408 + p not in ['include', 'lib']]
> 409 +
> 410 + for rsrc_name in resources_to_copy:
> 411 + shutil.
> 412 + os.path.
> 413 +
> 414 + # link to resources/include and resources/lib from the main bundle:
> 415 + resources_to_link = [os.path.
> 416 + for p in ['include', 'lib']]
>
> ['include', 'lib'] are the include and resources, would it be a good idea to
> make it a constants so that we don't have to chance it in the code. That way,
> if we have too add other strings we just have to modify it in a single place.
Agreed. I've made that change.
> Maybe the 'Resources' stirng is also a good candidate for a constant.
I didn't do this, because "Resources" will never change.
> In the following:
>
> 337 + if len(dynload_paths) != 1:
> 338 + raise Exception("can't expand ", dynload_glob)
>
> maybe len(dynload_paths) < 1 or len(dynload_paths) == 0, I don't exactly know
> if we should fail also if the length is bigger.
We should fail if the length is bigger, because then we don't know which one to use.
Maybe we'll end up packaging modules from multiple python versions at some point and then we'll need to make more changes to handle copying stuff from each of them. For now this code should break if it's != 1, though.
However, it could use a more descriptive error message. I've changed that.
> Besides the above I ran the script and everything seems to be ok.
Great!

I'll leave the actual approval to someone who has knowledge of the deeper Mac things in here, so just entering as a comment for now, but on the surface nothing jumps out as being incorrect as just general Python code.
99 + print "WARNING: got OSError %r in rmtree(%r)." \ join(INSTALL_ DIR, "lib"))
100 + % (e, os.path.
Could you wrap this in parentheses rather than using the '\' line continuation?