On Fri, 12 Jun 2009 09:45:27 -0700
Mark Knecht <markkne...@gmail.com> wrote:

> I've wanted a way to do something like this for a long time. One
> problem with the way portage works with ( I guess) rsync or whatever
> it uses is that when someone decides to remove a package from portage
> that I'm currently using syncing removes it from my system also.
> Unfortunately before I do the sync I have no idea it has been removed
> so I don't know that it's going to get taken off my system. Once it
> does I can go find a copy and put it in a personal overlay but that
> requires I do the work after the damage is done. It would be nice if
> there was a message ahead of time that told me certain packages were
> going to be removed, etc., before it was actually done, but I
> understand from previous conversations that syncing doesn't work that
> way.

But why not?

  alias emerge-sync='rm -Rf /usr/portage.bak && mv /usr/portage{,.bak} \
    && emerge --sync"

and to make.conf goes:

  PORTAGE_RSYNC_OPTS="--link-dest=/usr/portage.bak $PORTAGE_RSYNC_OPTS"

And there you go: hardlinked new tree w/ old one easily accessible.
Note that it won't take much more time or bandwith or space than syncing
on top of the older tree, since same check will see that the files
in .bak dir and remote tree are identical and will just create another
hardlink to the same file.
And you're free to dispose of any dir with "rm -Rf" when you see fit.

Simple three-line no-brainer script will help you keep 10, 100, 1000 or
however many trees you like, occupying just a few MB more than a single
tree.

Furthermore, if you want to keep a hundred-year history of this tree,
just say something like this:

  cd /usr/portage
  echo -e "local\ndistfiles\npackages" > .gitignore
  git init
  git add .
  git commit -a -m "portage bump"

  alias emerge-sync='cd /usr/portage && git add . \
    && git commit -a -m "portage bump" && emerge --sync'

and there you go, you'll never loose even a single bit of ebuild, no
matter how many times a day you keep syncing.
And .git storage will keep storage requiments of the whole thing to
minimum, keeping each change in the single place, compressing them,
etc...

Git-foo is too cryptic? There are few dozens of other VCS, of, for that
matter, ways to keep track of changes: snapshots, fs like venti/fossil,
rdup, even cp/tar.

Guess funtoo project is also worth mention in such context since it
uses git instead of rsync out-of-the-box.


> This has come up numerous times for me on older hardware where, for
> instance, maybe some on-board graphics chip only works with older ATI
> drivers, and that ATI driver only works with older kernels. By the
> time sync is done I've lost the code for what my system is running,
> and unfortunately there's no messages that this is happening when I'm
> doing the sync so maybe I only figure it out a few weeks later and
> then have to mess around building an overlay using the attic.

No dev can ever satisfy every requiment of everyone if they are too
lazy to lift a finger to type a line or two themselves.


-- 
Mike Kazantsev // fraggod.net

Attachment: signature.asc
Description: PGP signature

Reply via email to