gnu-arch-users
[Top][All Lists]
Advanced

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

Re: [Gnu-arch-users] configs are too weakly coupled


From: John Arbash Meinel
Subject: Re: [Gnu-arch-users] configs are too weakly coupled
Date: Fri, 25 Feb 2005 13:29:53 -0600
User-agent: Mozilla Thunderbird 1.0 (Macintosh/20041206)

Tom Lord wrote:

Acked for the bug database.

As a straw-man, how about:

  % tla config-status CONFIGNAME

Report the existence of extra or missing required subtrees and
subtrees whose tree-version or patch-level is wrong.

  % tla set-aside-extra-subtrees CONFIGNAME

Move all subtrees that don't fit CONFIGNAME to a ./+saved-trees
subdir of the top-level dir of the tree.

  % tla restore-missing-subtrees CONFIGNAME

Fill the missing parts of a config in, taking trees from ./+saved-trees
if they are there.


Out of those, it should be possible to synthesize a very nice:

  % tla switch-config FROM TO

which is:

  % tla set-aside-extra-subtrees TO
  % tla set-restore-missing-subtrees FROM



  % tla in-each-config-subtree CONFIGNAME SUBCOMMAND [...]

As in:
                % tla in-each-config-subtree CONFIG replay

with options to save output and error output in files (in each
subtree), stop at the first error or run in all trees in spite
of any errors, etc.


-t



Sounds like a good method to me. The command names are a little bit
long, but the work that they do seems like what you need to make configs
more useable. Right now I have a project with just under 100
sub-projects, and management can be a little bit tricky.

Actually, one piece that is missing would be a conditional commit. So
that if I've done a lot of work, I could commit all of the separate
pieces. I can do a "tla in-each-config-subtree CONFIG changes" to
determine which trees have changed, but it would be nice to do a "tla
in-each-modified-config-subtree CONFIG commit -s 'Added feature foo'"

It's not terrible to do this in a wrapper script, something like

for d in `tla cat-config $1 | awk '{print $1}'`
do
   if tla changes -q -d "$d"; then
      echo "no change for $d"
   else
      tla commit -d "$d" -s "$2"
   fi
done

Having a conditional foreach in config could be generally useful,
though. But still, I suppose some things are very specific for your own
working area, which is where layered scripts come into play.

John
=:->

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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