Message from discussion
an archive-like task
Received: by 10.216.196.131 with SMTP id r3mr444470wen.7.1317198118002;
Wed, 28 Sep 2011 01:21:58 -0700 (PDT)
X-BeenThere: python-doit@googlegroups.com
Received: by 10.227.6.209 with SMTP id a17ls2457192wba.0.gmail; Wed, 28 Sep
2011 01:21:57 -0700 (PDT)
Received: by 10.227.24.2 with SMTP id t2mr781135wbb.0.1317198117582;
Wed, 28 Sep 2011 01:21:57 -0700 (PDT)
Received: by 10.227.24.2 with SMTP id t2mr781134wbb.0.1317198117565;
Wed, 28 Sep 2011 01:21:57 -0700 (PDT)
Return-Path: <prvs=125283fec1=Michael.Gliwin...@henderson-group.com>
Received: from mail.henderson-group.com (mail.henderson-group.com. [62.253.225.167])
by gmr-mx.google.com with ESMTP id d7si14368994wbp.2.2011.09.28.01.21.57;
Wed, 28 Sep 2011 01:21:57 -0700 (PDT)
Received-SPF: pass (google.com: best guess record for domain of prvs=125283fec1=Michael.Gliwin...@henderson-group.com designates 62.253.225.167 as permitted sender) client-ip=62.253.225.167;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of prvs=125283fec1=Michael.Gliwin...@henderson-group.com designates 62.253.225.167 as permitted sender) smtp.mail=prvs=125283fec1=Michael.Gliwin...@henderson-group.com
Received: from mail.henderson-group.com ([10.1.1.50])
by mail.henderson-group.com (8.14.1/8.14.1) with ESMTP id p8S8LpnU012809
for <python-doit@googlegroups.com>; Wed, 28 Sep 2011 09:21:51 +0100
Received: from HGEX01.Inside.John-Henderson.co.uk (unverified) by
mailsweeper.henderson-group.com (Clearswift SMTPRS 5.4.0) with ESMTP
id <T9fbbbfaef90a0101321...@mailsweeper.henderson-group.com> for
<python-doit@googlegroups.com>; Wed, 28 Sep 2011 09:21:41 +0100
Received: from hgis01.localnet ([145.0.20.18]) by
HGEX01.Inside.John-Henderson.co.uk with Microsoft
SMTPSVC(6.0.3790.4675); Wed, 28 Sep 2011 09:21:45 +0100
From: Michael Gliwinski <Michael.Gliwin...@henderson-group.com>
Organization: Henderson Group
To: python-doit@googlegroups.com
Subject: Re: an archive-like task
Date: Wed, 28 Sep 2011 09:24:31 +0100
User-Agent: KMail/1.13.6 (Linux/2.6.38-8-generic; KDE/4.6.4; x86_64; ; )
References: <201109271556.02967.Michael.Gliwin...@henderson-group.com>
<CAHSrCY0K5CODzrZfEOuyoFkzke95U8_XCVXjePT6ZtGuVzy...@mail.gmail.com>
In-Reply-To: <CAHSrCY0K5CODzrZfEOuyoFkzke95U8_XCVXjePT6ZtGuVzy...@mail.gmail.com>
MIME-Version: 1.0
Content-Type: Text/Plain; charset="iso-8859-15"
Content-Transfer-Encoding: 7bit
Message-Id: <201109280924.32011.Michael.Gliwin...@henderson-group.com>
X-OriginalArrivalTime: 28 Sep 2011 08:21:45.0386 (UTC)
FILETIME=[A8F298A0:01CC7DB7]
On Tuesday 27 Sep 2011 17:09:40 Eduardo Schettino wrote:
> # task that adds compiled file to lib
>
> > yield {
> >
> > 'name': 'lib:' + fn,
> > 'actions': ['# add to lib command'],
> > 'file_dep': [lib, target],
> > 'uptodate': [True],
> > # adding 'targets' on lib here can't work
> > }
> >
> > Any ideas how to prevent that last task from running if none of the deps
> > changed?
>
> I didnt understand 100% the logic of what you trying to do... but i guess
> the main problem is setting 'lib' as a file_dep on the last task.
>
> When lib doesnt exist is it required to run all add_to_lib tasks or the
> "create lib command" can create and add the initial compiled files?
Unfortunately the "create lib" command doesn't handle adding files, it just
creates the initial file and fails if it already exists.
...
> 1) you just need to make sure the lib file exist, this could be done by
> adding a dependency to the task that creates it.
Will this be enough to ensure "add to lib" tasks are run when the library file
is deleted?
> 2) 'uptodate': [True] # is useless in this case. you can remove it.
Indeed, that was just one of the things I tried to prevent the task from
executing each time, along with 'uptodate': [run_once]. BTW, is there any
difference?
> # task that adds compiled file to lib
> yield {
> 'name': 'lib:' + fn,
> 'actions': ['# add to lib command'],
> 'file_dep': [target],
> 'task_dep': ['compile_p:lib'],
> }
>
> this solves your problem?
Almost, it prevents the task from running each time, but if the library file
is deleted only the 'compile_p:lib' task is run (i.e. the individual "add to
lib" tasks for each compiled file are not).
Why is 'lib' a problem as a file_dep? Is it because the 'lib' file changes
after adding each file?
--
Michael Gliwinski
Henderson Group Information Services
9-11 Hightown Avenue, Newtownabby, BT36 4RT
Phone: 028 9034 3319
**********************************************************************************************
The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised.
If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful.
When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract.
If you have received this email in error please notify supp...@henderson-group.com
John Henderson (Holdings) Ltd
Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT.
Registered in Northern Ireland
Registration Number NI010588
Vat No.: 814 6399 12
*********************************************************************************