June 22, 2008

Downgrading to the last stable GNOME version

Categories: FreeBSD, Sysadmin.

I decided to stop tracking the development version of GNOME and revert to the stable version available through the FreeBSD ports tree. I wanted to avoid dropping every single package and re-installing everything but the system from scratch, so I tried to handle too-much up-to-date packages and update them to the last stable version (ie. with a lower version number).

portversion can list outdated and too-much recent packages easily using the -l flag: portversion -l \> list all packages which version number is higher that what is available from the system's ports.

I started the downgrade by un-merging Marcus ports from my ports tree and syncing it with the current ports (Joe Marcus Clark provides marcusmerge, an utility for merging ports of development version of GNOME into your ports tree).

# marcusmerge -U
# cd /usr/ports && make update fetchindex
# portversion -l \>
at-spi                      >
banshee                     >
cairo                       >
cairomm                     >
cheese                      >
dasher                      >
deskbar-applet              >
eel                         >
eog                         >
epiphany-webkit             >
evince                      >
evolution                   >
evolution-data-server       >
evolution-exchange          >
file-roller                 >
gcalctool                   >
gconf2                      >
gdm                         >
gedit                       >
gimp-app                    >
gio-fam-backend             >
glib                        >
glibmm                      >
gnome-applets               >
gnome-control-center        >
gnome-desktop               >
gnome-games                 >
gnome-icon-theme            >
gnome-mag                   >
gnome-media                 >
gnome-menus                 >
gnome-panel                 >
gnome-power-manager         >
gnome-screensaver           >
gnome-session               >
gnome-settings-daemon       >
gnome-system-monitor        >
gnome-terminal              >
gnome-themes                >
gtk                         >
gtk-engines2                >
gtkhtml3                    >
gtkmm                       >
gucharmap                   >
gvfs                        >
intltool                    >
libbonobo                   >
libbonoboui                 >
libgdiplus                  >
libgnome                    >
libgnomekbd                 >
libgnomeui                  >
libgtksourceviewmm          >
libgtop                     >
libgweather                 >
libsoup                     >
libwnck                     >
libxklavier                 >
libxml++                    >
metacity                    >
mono                        >
mono-tools                  >
monodoc                     >
mousetweaks                 >
nautilus                    >
orca                        >
pango                       >
pixman                      >
poppler                     >
poppler-gtk                 >
py25-gnome-desktop          >
py25-poppler                >
sound-juicer                >
totem                       >
totem-pl-parser             >
vinagre                     >
webkit-gtk2                 >
yelp                        >
zenity                      >

portversion can even generate an update script for outdated packages, but it cannot generate downgrade scripts. Since it is does not provide computer-friendly output at the current version, I hacked it so that it can:

  1. Display more information that the package name (eg. zsh), that is:
    1. the package full-name, using the -L flag (eg. zsh-4.3.6_3);
    2. the package origin, using the -o flag (eg. shells/zsh).
  2. Only display packages that match a query, and not information about the up-do-dateness of the installed version, using the -Q flag.

Here is a the patch I used for having portversion behaving as expected:

--- /usr/local/sbin/portversion	2008-02-22 14:26:12.000000000 +0100
+++ bin/portversion	2008-06-20 14:32:10.000000000 +0200
@@ -50,6 +50,7 @@
 def init_global
   $command = 'portupgrade'
   $command_output = false
+  $display = :name
   $exclude_packages = []
   $ignore_moved = false
   $inv_limit_chars = nil
@@ -60,6 +61,7 @@
   $tempdir = ""
   $test_version = false
   $upward_recursive = false
+  $verbose_output = :default
 end
 
 def main(argv)
@@ -92,6 +94,10 @@
       $command = 'portupgrade ' + command_args
     }
 
+    opts.def_option("-F", "--fullname", "Display package full-name.") {
+      $display = :fullname
+    }
+
     opts.def_option("--ignore-moved",
 		    "Ignore MOVED file") {
       |$ignore_moved|
@@ -113,6 +119,10 @@
       end
     }
 
+    opts.def_option("-o", "--origin", "Display package origin instead of package name.") {
+      $display = :origin
+    }
+
     opts.def_option("-O", "--omit-check", "Omit sanity checks for dependencies.") {
       $sanity_check = false
     }
@@ -121,6 +131,10 @@
       |$noconfig|
     }
 
+    opts.def_option("-Q", "--quiet", "Only display package name") {
+      $verbose_output = :quiet
+    }
+
     opts.def_option("-r", "--recursive", "Check for all those depending on the given#{NEXTLINE}packages as well") {
       |$recursive|
     }
@@ -136,6 +150,7 @@
 
     opts.def_option("-v", "--verbose", "Be verbose") {
       |$verbose|
+      $verbose_output = :verbose
     }
 
     opts.def_option("-x", "--exclude=GLOB", "Exclude packages matching the specified glob#{NEXTLINE}pattern") {
@@ -339,16 +354,19 @@
 	held ? '# ' : '',
 	pkg.fullname
     else
-      if $verbose then
+	  case $verbose_output
+	  when :verbose then
 	printf "%-26s  %c  %s %s\n",
-	  pkg.fullname,
+	  pkg.send($display),
 	  sign,
 	  suggestion,
 	  (origin != pkg.origin) ? "(=> '#{origin}')" : ''
-      else
+	  when :default then
 	printf "%-26s  %c\n",
-	  pkg.name,
+	  pkg.send($display),
 	  sign
+	  when :quiet then
+	printf "%s\n", pkg.send($display)
       end
     end
   end

It was then possible to force the downgrade of all too-much up-to-date ports and every port depending on them:

# portupgrade -rf `portversion -FQl \>`

portupgrade hanged a while before starting to force upgrade of provided ports (probably the time to analyze a lot of times the same ports dependencies). After a few hours of compilation, I was back with a 2.22.2 GNOME desktop ;-).

I had 81 packages much more recent than what was provided by the official ports tree. portupgrade updated a total of 390 packages out of the 1308 installed on my system.

No Comments Yet

Comments RSS feed | Leave a Reply…

top