Dec 30, 2008

Recovering from a deleted /etc

Last night I inadvertently deleted /etc and had to recover my system which was still running, and for my own sanity avoid downtime. Everything was still running when I realized what had happened so without logging out most things would continue to if I didn't stop them.

I run a mix of stable and unstable. If you are on one or the other you will probably be able to simply extract /etc from a recent tarball, I tried doing this from drobbins builds but it was ineffective. After some other attempts I extracted a whole stable tarball from last weeks build. This allowed me to be able to compile with portage (which wasn't working with just /etc). I then had to systematically rebuild system, fixing problems as I came upon them, ultimately I had to rebuild gcc twice because I use -march=core2 which is not available in the current stable gcc. several packages wouldn't emerge even at this point so I had to use emerge --resume --skipfirst a couple of times. One of the bigger problem was the world file (where all packages I've added are listed) was lost. it's made things a bit more complicated that simply doing an emerge -aveDbk world once system was fixed.

I could have easily resolved this had I been using buildpkg. instead this is taking hours to clean up and rebuilding everything to restore all lost /etc files. Fortunately I didn't lose any of my settings because I keep /etc files I modify backed up in a git repository hosted by github.

Dec 21, 2008

sync target support

Here I explain why emerge --sync should return to it's original sync form.

I think emerge sync should have the ability to have a target. Currently emerge --sync has a target of the SYNC variable in make.conf or the default hardcoded. However, git support is being added to portage. git is a very powerful tool, and the Funtoo project uses it to manage it's full portage tree. git doesn't work like rsync, it's not so straight forward as rsync uri, which is effectively what emerge sync is doing. git supports branches. The current implementation of git in portage effectively does git pull ... which is great... you know if you pull from the default.

I don't, and I'm not sure I'd always want to, it'd be great to be able to change tree's on the fly with a more distributed model. If I want to test funtoo without pulling it's tree into mine I could emerge sync funtoo funtoo.org, or I could switch to gentoo by doing an emerge sync rsync://rsync.gentoo.org/gentoo-portage and none of this will change the default or require configuring in make.conf.

Biggest reason to do this is branches though. what if I have a development branch and I need to test something... I, in theory should be able to change the branch quickly. with git I will have to cd to PORTDIR then run checkout. with portages current implementation I'll have to reconfigure some of git and then do a sync. However, if I were able to add a target to it I could easily do emerge sync origin development or emerge sync origin master.

The SYNC variable and maybe some GIT_BRANCH variable could still define defaults while adding a target would make development and testing easier for developers and testers respectively.

--sync should be sync

emerge sync never should have become emerge --sync, of course 2 years ago I thought it was the right thing, it isn't though, live and learn. sync is currently an argument with the syntax of an option.



What's the difference?

An argument is what the command, or executable operates on. Some examples

cp file0 file1 copies file0 to file1.

ls list the current working directory

ls dir0 lists directory dir0



Right, so how is --sync an argument and not an option?

Options effect how commands operate on arguments. For example

cp file0 file1 will overwrite file1 if it exists.

cp --interactive file0 file1 will prompt to overwrite if file1 exists.

ls -R will list any files and directories off the current working directory recursively.

ls -R dir0 will list any files and directories off dir0 recursively.



I still don't understand why sync isn't an option, it isn't a file so wouldn't it be an option?

Well that's basically what I used to think, not a file not an argument. It's not true to understand better I suggest picking up a version control system (e.g. svn) and seeing how you can have arguments that aren't files. Example

svn checkout -r 1346 checkout revision 1346

See the -r switch is an option that operates on the checkout argument to the svn command.



Starting to get it...

--sync currently doesn't affect any target, doesn't change a thing but isn't a 'default' either (some options are just there for explicitness and are in effect unless another option is there.

Dec 19, 2008

types of use flags

Ok so I have yet another idea for portage and other portage like package managers. actually this is probably more aimed at EAPI. Different types of USE flags. The 2 I'm thinking of off the top of my head could be described as volatile and non-volatile. Basically a use flag marked volatile means a package needs to be recompiled if it gets changed one marked non-volatile most likely just pulls in another dependency or copies files such as documentation. I'm sure this feature could have lots of uses I'm not thinking of.

Dec 12, 2008

Download Book, The Ruining of a Good Feature

1-3 Months ago Safari Books finally started allowing you to download full books in pdf. It used to be that you had to download chapters of books in pdf. This was annoying even if you had tokens to do it. Tokens are Safari Books way of making sure we aren't pirating en masse, you get 5 tokens a month and can only keep 3 months worth. So now we can download full books how nice? right?

Well it would be except the only books you can download without buying more tokens are pocket references, those cost 6 tokens, so over 1 months worth. Most books are 16 tokens and I think I saw an 18 token one. I'm sorry but this is just GREEDY, I currently pay $439.99 a year for this service, isn't that enough for me to be able to download 4 books a year?

I probably wouldn't be complaining about this if they allowed you to keep all unspent tokens, I have about 2 years worth now. I actually asked for that.


We would like to inform you that according to Safari terms of service, we will not be able to reinstate the unused tokens.


No, of course not, and I knew that when I asked, but it didn't hurt to ask, or point out that I've used virtually no tokens over 2 years of subscription.

Well O'reilly since I find that this is just pure greed, I won't be renewing my subscription.

Maybe I'm wrong? you know to think that I shouldn't have to pay extra to download a few normal books? what do you think?

Dec 11, 2008

Regen2 development has officially begun

That's right I'm putting my money where my mouth is. It's small but the first 2 packages when into the regen2 tree this morning. They are MySQL 5.1.30 which was added because the gentoo maintainer refused to add it do to instability. I agree that it is unstable, but we have ~M Hard Masked packages for that reason. It has been added as ~M. The other app added is qsynergy, the ebuild was already on portage and I know it to be good so I added it to the tree, I'll probably stabilize it in a few weeks.

Since Regen2 is a fork of Funtoo you can enjoy all the benefits of Funtoo's changes in my tree, and I will try to get mine accepted into Funtoo.

In the future I will be building stable Regen2 tarballs, although only stage3's.