Revision b5b7c2a136234774a0f0075eb14030faa5b101b0 authored by Ben Oberkfell on 26 March 2013, 20:28:19 UTC, committed by Ben Oberkfell on 26 March 2013, 20:28:24 UTC
Register a commit callback on the Oracle side to wait until Postgres has fully committed.

Intent is to reduce race conditions in instances where shell commands are called that create entities that are queried for right away.

For example, allocations.
1 parent 33f3fb0
Raw File
clean-debian-builds.pl
#!/usr/bin/env genome-perl
use strict;
use warnings;
use File::Basename;
chdir File::Basename::dirname(__FILE__);
my @dirs = (glob("*/debian/*"), glob("*/ubuntu-lucid/*"), glob("vendor/*/debian/*"), glob("vendor/*/ubuntu-lucid/*"));

@dirs = grep { 
        if (m{^(vendor/|)(.*)/(debian|ubuntu-lucid)/(.*)}) {
            if ($2 eq $4) {
                ($_);
            }
            else {
                #print "missed $_\n";
                ();
            }
        }
        else {
            die "odd: $_";
        }
    }
    @dirs;

if (@dirs == 0) {
    print "No directories with debian build cruft found under $ENV{PWD} (checkted for 'debian' and 'ubuntu-lucid').\n";
    exit;
}

print "Removing all data from these directories under $ENV{PWD}:\n\t",join("\n\t",@dirs),"\n\n";
print "Press ctr-c in 5 seconds if you don't want to do this...\n";

sleep 5;

for my $dir (@dirs) {
    my $cmd = "rm -rf '$dir'";
    print "RUN: $cmd\n";
    my $rv = system $cmd;
    $rv /= 256;
    if ($rv) {
        warn "error for $dir: $!";
        next;
    }
}

back to top