Ashley Dixon wrote: > Hi gentoo-user, > > Following the recent conversation started by Meino, I have decided to convert > my > package.* files to directory structures. For all but one, this has > proven > tedious, but relatively painless. My package.use file is another story: at > over > three-hundred lines, the thought of manually converting this to a > directory > structure does not attract me. > > Are there any tools in Portage to help with this, or must I resort to writing > a > shell script ? > > For example, considering the following lines in my flat package.use: > > media-video/openshot printsupport > sys-apps/util-linux tty-helpers > > I want to take this file and create a directory structure: > > media-video/openshot, containing "media-video/openshot printsupport" > sys-apps/util-linux, containing "sys-apps/util-linux tty-helpers" > > How can this be done ? > Thanks. >
Well, as some here know, I do things differently. My knowledge on scripting and those types of commands is basic, if that. A while back I had one file for everything but I wanted to split some off and have a few files for certain groups of packages, using what is updated in groups as a guide. This is what I ended up with. Output of tree. root@fireball / # tree /etc/portage/package.accept_keywords/ /etc/portage/package.accept_keywords/ ├── dev-qt ├── kde-apps ├── kde-frameworks ├── kde-misc ├── kde-plasma └── package.keywords 0 directories, 6 files root@fireball / # The reason I did this, if a upgrade goes bad for say kde-apps, I can move the kde-apps file out of that directory and emerge will downgrade to the last stable version. How I did that? Well, I went to a console and used cat and grep. Example. cat /etc/portage/package.accept_keywords/package.keywords | grep kde-apps That would list all the matches on the konsole. I then copied those to a new file for kde-apps. Since those tended to be grouped together, I then removed those entries from the old file. I rinse and repeat that several times until I got the one file to be targeted with several files. One could likely use echo to put those in a file automatically but I was chicken. :/ You may find a better way, certainly there has to be one, after all, this is ME, but that may give you ideas. There is likely a lot of ways to do this. You get someone who has a better grasp of those awk and sed commands, the possibilities get huge real fast. Me, I'm still learning about grep. I got cat pretty much figured out. ;-) Hope that helps or leads to a better way. Please share if you do find a better way tho. May help someone else in the future. Dale :-) :-)