ltib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ltib] merge package and symlinks


From: Andrea Galbusera
Subject: [Ltib] merge package and symlinks
Date: Mon, 14 Dec 2009 09:16:33 +0100

Hi Stuart,

I faced the need to keep in sync a couple of ltib trees. This is a need
particularly for my merge dir. As a temporary solution, I'm trying to
make the merge dir of one tree a symlink to the corrisponding merge dir
of the other tree. That would prevent me from loosing updates of those
files.

Next step was to check if ltib was correctly detecting changes in the
files of the target dir. Since this was not working as I expected -
namely the merge package was not re-packaged even after applying changes
to merge files - I inspected a little bit ltib's code and found out the
following routine, which I suppose is responsible to detect changes:

sub check_merge_updates
{
    my ($pcf) = @_;
    my $spec = get_spec("merge");
    if( ! -w "$cf->{rfsbase}/etc/ltib-release") {
        touch($spec);
        return 1;
    }
    foreach my $dir ( $ENV{PLATFORM_PATH}, $ENV{TOP} ) {
        next unless -d "$dir/merge";
        local $_ = `find $dir/merge -newer $spec 2>/dev/null`;
        warn "newer than $spec: $_\n" if $_ && $verbose;
        touch($spec), last if $_;
    }
    return 1;
}

A change to the find command line was enough for me to make things
happen as expected. I added a trailing "/" to the path that is passed to
find and now the command is detecting changes even behind the symlink.

Namely I changed:
local $_ = `find $dir/merge -newer $spec 2>/dev/null`;
into:
local $_ = `find $dir/merge/ -newer $spec 2>/dev/null`;

By further reading find's manpage, I then noticed the -H command line
options that could bring a similar result (not verified yet).

I'd like to have a comment from you on this. 
First: do you see any bad side-effect in making merge dir a symlink at
all? If this is not evil, do you believe it could be useful to patch
ltib and allow it detect changes even in this case? My patch suggestion
could not be the best fix anyway... please comment!

T.I.A.
Regards,

Andrea





reply via email to

[Prev in Thread] Current Thread [Next in Thread]