Retrieve and restore execution permissions on unpack

Retrieve permissions from zip info property, check if
any execution bit is set, gives everyone execution rights
if any is set.
Please check latest commit : I added some comments explaining the magic numbers
On 26 Sep 2014, at 13:36, Rob Blau <notifications@github.com> wrote:

> In python/tank/deploy/zipfilehelper.py:
> 
> > @@ -47,11 +47,20 @@ def _process_item(zip_obj, item_path, targetpath):
> >          target_obj = open(targetpath, "wb")
> >          target_obj.write(zip_obj.read(item_path))
> >          target_obj.close()
> > -        
> > -    return targetpath
> > +        # Restore permissions on the extracted file
> > +        # Took bits and bobs from here :
> > +        # http://bugs.python.org/file34893/issue15795_test_and_doc_fixes.patch
> > +        zip_info = zip_obj.getinfo(item_path)
> > +        # Only preserve execution bits: --x--x--x
> > +        # if one is set, give execution rights to everyone
> > +        mode = zip_info.external_attr >> 16 & 0x49
> Would be nice to comment on the magic numbers here.
> 
> —
> Reply to this email directly or view it on GitHub.
>