Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
problems upgrading old system try this.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
TheLexx
Tux's lil' helper
Tux's lil' helper


Joined: 04 Dec 2005
Posts: 137
Location: Austin Tx

PostPosted: Sat Oct 26, 2013 1:09 am    Post subject: problems upgrading old system try this. Reply with quote

disclaimerThis is the system that evolved as a result of me trying to upgrade Gentoo after it was "dusty" enough to make upgrading difficult. I am in no way suggesting you let your system get dusty on purpose. However I would suggest you try this before giving up completely and abandoning Gentoo all together. I have found that has helped my over the years and I am offering it as a way to give back to the Gentoo community

I started using Gentoo as my primary system around 2006 or 2007 after not upgrading for a while, I found that I needed to do a complete reinstall in 2010 and again in 2012. After dealing with trying to reinstall the same packages again, I developed a bash script which eventually evolved into my install/upgrade script I use to this day. I call the script "get-gentoo.sh".

I have found that not only can I use the script for a fresh install, I can also use it to help me out in those situations that "emerge --update --deep @world" does not work. The script is highly robust and will install/upgrade everything possible. This is accomplished by skipping the packages that do not emerge. After running the script, I am free to go back to the problematic packages and fix them or remove them if I feel that they are not worth the effort.

The script works by issuing a series of emerge commands each with a single target. It is easy to change the emerge flags for different situations you find yourself in. Well, it is easier to show you the script first then explain it. In this version, most of the"data section" has been removed. Anyone wishing to use get-gentoo.sh would need to create a new data section to match their needs. I would suggesting browsing the world file of their current/last Gentoo install. A full version of my current get-gentoo.sh script can be found at pastbin here.

Code:
 
### Use on platforms d-desktop,l-laptop,s-server,m-micro(test version)

Platform="d"

################################################
## Flags to change how the output looks       ##
################################################

Echo=true
#Echo=false

TermFlags="--color=n --nospinner" #view with emacs
#TermFlags="" #view with xterm

################################################
## Gentoo flags for early build and retrieval ##
################################################
#Flags="--noreplace"
#Flags="--noreplace --pretend"              #check progress
#Flags="--noreplace --fetchonly"            #download all you can
#Flags="--noreplace --pretend --fetchonly"  #make list to dload

################################################
## Gentoo flags for upgrading existing system ##
################################################

##Update using script deep
#Flags="--update --noreplace --deep"
Flags="--update --noreplace --deep --pretend" #check progress
#Flags="--update --noreplace --deep  --fetchonly"
#Flags="--update --noreplace --deep --fetchonly --pretend"

##Update using script shallow
#Flags="--update"
#Flags="--update --pretend"
#Flags="--update --pretend --fetchonly"
#Flags="--update --fetchonly"

function build {
    if [[ $1 =~ $Platform ]]; then
         if $Echo; then printf "\n\n\n**** %s\n" $2; fi
         emerge $Flags $TermFlags $2
    fi
}

################################################
## Example data section shortened             ##
################################################

### use the tag "##PROB-"  to describe why the package will not install
### use the tag "##DESC-"  to describe what the pachage does

### Revisit priority
#build  d     evolution  ##why does this need weather?

### get first
build  dlsm  automake-wrapper ##DESC-used to make lots of other stuff
build  dlsm  autoconf-wrapper ##DESC-used to make lots of other stuff
build  dlsm  nano
build  dls   awk

### Get early
build  dlsm  mirrorselect
build  dlsm  ccache ##DESC-compiler accelerator
#skip build  dls   app-misc/screen ##/usr/local install
build  dlsm  lsof  ##important root utilities
#skip build  dl    wvdial ## don't realy need this anymore
#skip build kismet  ##/usr/local install

### Software develment
build  dlsm  rcs ##DESC- also used by dispatch-conf
build  dlsm  gcc

### Non-X
build  dl    media-sound/mpc
build  dl    minicom
build  dl    ide-smart

### non-X Apps
build  dls   alpine ##PROB- useflag
build  dls   lynx

### non-X Games
build  dl    ascii-invaders
build  dl    moon-buggy

##Pre-X
build  d     dev-lang/tk ##DESC- GUI framework
build  dl    x11-libs/cairo ##DESC- vector graphics lib
build  dl    pycairo ##DESC- vector graphics lib

### Xorg X11 & drivers
build  dl    xorg-x11
build  dl    xf86-video-vesa
build  dl    xf86-video-ati
build  d     xf86-video-r128

### Xorg apps
build  dl    xterm
build  dl    xeyes

### Desktop
build  dl    fluxbox
build  d     enlightenment

### Old X
build  dl    xv
build  dl    xemacs
#skip build  dl    xchat ##dropping support /usr/local??

### New X stuff
build  d     imagemagick ##DESC- Used for many graphic apps
build  d     evolution

### browsers
build  d     firefox
#skip build  d     galeon obsolete

### office & graphics & X-programming
build  d     abiword
build  d     gimp

### smallest X-games
build  d     icebreaker

### Media players
build  dl    alsaplayer
build  d     mplayer

### midsize X-games
build  d     xgame ##DESC- games in a separate X session

### Voip
build  d     skype

### Big Games games ##over XXXK or lots of libs
build  d     pingus
build  d     bzflag
#skip build fish-fillets

################################################
## A place to put notes/todo/questions        ##
################################################

# Where can I use to play realplayer streams?
# What is a good  planetarium program?


The first thing you will notice is the variable "Platform" which allows you to select which platform you are installing on. Each platform has it's own list of packages. Next you will notice, there is a section to determine how the results look on screen.

Then comes the interesting part, this is where the user gets to select which flags to use with "emerge". This vastly effects what the script does. Setting "Flags" will determine if get-gentoo acts as an initial installer or as an upgrader or just a progress reporter. Get-gentoo may take over an hour to run even when it does not install or building anything. Because of this, I will often run it with the "pretend" flag set and the date piped to a file (or inside an Emacs shell). Examining the resultant, I can see which packages were successfully installed and which caused problems.

The next section is the only part with any real programming. It is the definition of the build function. The last section is the data section, it is broken down into a series of subsection. As previously stated, the data section has been abbreviated to just show the gist of what get-gentoo is supposed to do.

In a way the data section acts in the place of a world file. I like this because the script allows me to prioritize which installs/upgrades are attempted first. Packages with the fewest dependencies are first. When choosing the order, I also take into account how important to my life those packages are in my computing life. Get-gentoo is also nice because, I can skip a problematic package by simply commenting it out and making a note as to why. Comments is where I feel my script shines.

The first subsection is the "Revisit priority" this for when I am running get-gentoo over and over. Sometimes I just want to see how the difficulty packages are handled first. Any package here must also appear later on in it's assigned subsection, because the "Revisit priority" is often cleared out. The first few times I run this on a new system, this subsection will be blank.

The "Get first" subsection is where I put the stuff that I find essential to just figure out "what the heck is going on?". The "Get early" section is stuff I want to get soon that will make it easier to operate my computer in text mode. "Software development" contains many things really essential to Gentoo in general. Most are included in the stage3, but it's nice to ensure you are using the newest version available.

The next few sections contains niceties that do not require the installation of X11. The "pre-X" section is for things that are needed before X11 can be installed. In the early version of get-gentoo, I tried back in 2010, I was overwhelmed by the required packages for "emerge xorg-x11". I decided I needed a midway-point. So this subsection was born.

In the "Xorg X11 & drivers" subsection, I use separate builds for each driver. In my make.conf, I set VIDEO_CARDS to a null string so that I could emerge individual drivers (hay, it's my way, follow it or not it's up to you). After that comes the desktops, humm it's hard using X without one (but not impossible). As you see, I like oldschool desktops. "Old X" is my way of denoting stuff I was using on Unix back in the Nineteen-hundreds.

The next subsections are chosen by the way I group applications in my mind. I did try to put things things first if the had one or more of the flowing criteria (few dependencies, quick to compile, needed in real life, not a lot to download.)

As you can see, the entire data section was liberally sprinkles with comments. I tried to be consistent so that I can use simple searches in my text editor to locate things such as #skip and ##PROB-. I highly recommend consistency. Consistency in your comments allows you the ability to grep-out a list of packages that were skipped or not emerged because of problems. Many times if the output was going to an Emacs term, I would edit get-gentoo to note problems whilst it was running in the other window.

I would like to here your comments on whether you think that get-gentoo.sh could be a valuable addition to your maintenance of a Gentoo system, or if you think that my script is a wast of time and you take the love-it-or-leave it attitude when it comes to frequent Gentoo updates. I also Have some ideas on improving my script, but for now I think this post is long enough.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum