[Fedora-livecd-list] [PATCH 1/6] Set the build directory

Jeroen van Meeuwen kanarip at kanarip.com
Tue Aug 7 21:28:49 UTC 2007


Douglas McClendon wrote:
> Jeroen van Meeuwen wrote:
>> Jeremy Katz wrote:
>>> On Mon, 2007-08-06 at 23:21 +0200, Jeroen van Meeuwen wrote:
>>>> Jeremy Katz wrote:
>>>>> On Sun, 2007-08-05 at 20:24 +0200, Jeroen van Meeuwen wrote:
>>>>>> A patch to enable setting the build directory.
>>>>>>
>>>>>> This adds more flexibility for those who don't have as much space in
>>>>>> /var/tmp.
>>>>> If you don't have space in /var/tmp, just use
>>>>> --tmpdir=/some/other/dir/with/space.  Setting the build directory just
>>>>> sets people up for either a) deleting things they don't intend to
>>>>> or b)
>>>>> getting stale data in their build
>>>> Right, tmpdir does evade the i-do-not-have-enough-space-in-/var/tmp
>>>> issue. Push comes to shovel, I really don't need to set the
>>>> build_dir to
>>>> anything I can think of, rather then just use the
>>>> InstallationTarget.build_dir for any reference after I import
>>>> livecd-creator and create the extended InstallationTarget instance.
>>> This sounds a lot better to me...
>>>
>>>> I'm not sure though what you mean by a) and b) though. AFAICT these
>>>> would never just happen because build_dir === build_dir, regardless of
>>>> what you set it to, or how you set it.
> 
> 
>>> Okay, we don't actually do any removal, so you won't hit that.  But if
>>> you set a build_dir that already exists, then you're setting up for some
>>> "interesting" conditions.  By ensuring that it's a new mkdtemp'd dir, we
>>> can be certain that we own it, that it's unique, and that no one has
>>> done anything with it first
> 
> 
> Are you actually certain that you don't do any removal?
> 
>     def teardown(self):
>         if self.build_dir:
>             self.unmount()
>             shutil.rmtree(self.build_dir, ignore_errors = True)
> 

Right on.

There's an addition problem with having tempfile.mkdtemp(), and that is
that mounts can not easily be unmounted in a next run, if the creation
of live media fails in one way or the other. Having a "static"
build_dir, it can be used to check for existance, and be unmounted.
You'd not be running out of loop devices anymore. If the directory
already exists, the app complains and exits appropriately, or allows the
user to act upon it and save his data.

Kind regards,

Jeroen van Meeuwen
-kanarip




More information about the Fedora-livecd-list mailing list