| From: | Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com> | 
|---|---|
| To: | Mikael Kjellström <mikael(dot)kjellstrom(at)mksoft(dot)nu>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, buildfarm-members(at)postgresql(dot)org | 
| Subject: | Re: [buildfarm-members] BuildFarm client release 4.19 | 
| Date: | 2017-05-01 19:10:32 | 
| Message-ID: | 8763b0f6-12ac-9a87-df2b-6dd4e5d27c98@2ndQuadrant.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | buildfarm-members pgsql-hackers | 
On 05/01/2017 03:00 PM, Mikael Kjellström wrote:
>
> On 2017-05-01 20:56, Andrew Dunstan wrote:
>> OK, coming up with a more comprehensive fix.
>
> Ok.
>
>> The obvious workaround for now is to create the directory and dont zap
>> it or its parents. You should only have to do it once (per branch)
>
> Yes, I know.  That is what I have been doing so far.  But if you want
> to rerun a branch from scratch it's much easier to just do:
>
> rm -rf buildroot/HEAD
> or
> rm -rf buildroot/REL9_6_STABLE
>
> and then the buildfarm script should do the right thing and create all
> the directories that it needs.
>
Not sure I understand what "rerun a branch" from scratch means. If you
zap the branch directory you lose all its state. That's generally a bad
thing.
Anyway, this patch should fix it for all uses. It creates the directory
if it doesn't exist.
    diff --git a/PGBuild/Utils.pm b/PGBuild/Utils.pm
    index 91c1362..175eaa7 100644
    --- a/PGBuild/Utils.pm
    +++ b/PGBuild/Utils.pm
    @@ -14,6 +14,8 @@ See accompanying License file for license details
     use strict;
     use warnings;
     
    +use File::Path;
    +
     use Exporter   ();
     our (@ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
     
    @@ -30,8 +32,9 @@ use vars qw($VERSION); $VERSION = 'REL_4.19';
     sub run_log
     {
         my $command = shift;
    -    my $file=
    -     
    "$main::branch_root/$main::st_prefix$main::logdirname/lastcomand.log";
    +   my $filedir =
    "$main::branch_root/$main::st_prefix$main::logdirname";
    +   mkpath($filedir);
    +   my $file= "$filedir/lastcomand.log";
         unlink $file;
         system("$command > $file 2>&1");
         my @loglines;
cheers
andrew
-- 
Andrew Dunstan                https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Mikael Kjellström | 2017-05-01 19:19:44 | Re: [buildfarm-members] BuildFarm client release 4.19 | 
| Previous Message | Mikael Kjellström | 2017-05-01 19:00:38 | Re: [buildfarm-members] BuildFarm client release 4.19 | 
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Andres Freund | 2017-05-01 19:14:19 | Re: snapbuild woes | 
| Previous Message | Peter Geoghegan | 2017-05-01 19:04:13 | Re: Logical replication in the same cluster |