[Piuparts-devel] Bug#573904: Bug#573904: Bug#573904:

Holger Levsen holger at layer-acht.org
Wed Apr 21 10:12:03 UTC 2010


Hi Cleto,

On Dienstag, 20. April 2010, Cleto Martin Angelina wrote:
> >     tmpdir = tempfile.mkdtemp(dir=settings.tmpdir)
> > -    os.makedirs(os.path.join(tmpdir, name, 'DEBIAN'))
> > +    os.makedirs(os.path.join(tmpdir, name, 'DEBIAN'), mode = 0755)
> >     control = deb822.Deb822()
> >     control['Package'] = name
> >     control['Version'] = '0.invalid.0'
>
> I think the patch modification is wrong. IMO, you need to set umask to
> 0 because it is applied between the mode specified in os.makedirs
> function. You may also substract the umask value to 755, but I don't
> find any python function for getting umask value (without modify it
> previously). I have tested this patch with piuparts sid version and
> fails when current umask is, for example, 0270.

Ah. Makes sense :)

--- piuparts.py (revision 680)
+++ piuparts.py (working copy)
@@ -427,7 +427,9 @@
     # Inspired by pbuilder's pbuilder-satisfydepends-aptitude
 
     tmpdir = tempfile.mkdtemp(dir=settings.tmpdir)
+    old_umask = os.umask(0)
     os.makedirs(os.path.join(tmpdir, name, 'DEBIAN'), mode = 0755)
+    os.umask(old_umask)
     control = deb822.Deb822()
     control['Package'] = name
     control['Version'] = '0.invalid.0'

Is my current (commited) modification, though I'm unsure if resetting the 
umask to the previous value is really necessary...


cheers,
	Holger
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.alioth.debian.org/pipermail/piuparts-devel/attachments/20100421/75e8d16a/attachment.pgp>


More information about the Piuparts-devel mailing list