Repository scripts

Only for BUBBA|SERVER

What is this?

Although the bubba uses Excito specific repositories, nothing is stopping you from using the Debian ones. The problem with these packages is that they may require user input and therefor aren't suited for automatic installation like the one you get from the Bubba web interface. This means that you must restore the links to the Excito repository before you start an upgrade or things may go wrong.

Below you will find two scripts I wrote to make it easier to change what repository is being used. One of them is meant to be run as a cron job, and will check what repository is currently being active and restore it to the Excito repository if it is pointing at anything else. It will only restore the links if no user is logged on to bubba. This is to prevent it from restoring the links when you're logged on and actually want it to point at another repo.

Installation

First of all, make a copy of the original sources.list (the one which only points at Excito). Name this copy sources.excito. Now make a new copy and name it sources.debian. Edit this file and enable the debian repositories by removing the leading '#' on the lines containing the debian repositories. Next, remove the file sources.list. Our script will make a soft link named that will point at the sources-file we want to use.

Download repository scripts

  • Released: Feb 9, 2008.

Download the archive and extract it. Copy the set_repo file to /usr/bin, and restore_repo to /etc/cron.hourly. This will make it run once every hour.

Using the script

To change repository you need to become root and type set_repo debian. This will change the soft link to point at sources.debian and this repository will become active. When executing this script it will remove the soft link and create a new one that points at sources.debian. It will also call apt-get to synchronize the package index with the new repository. If you for some reason don't want it to synchronize, add a '-n' before the repository (eg. set_repo -n debian).

To change it back, type set_repo excito. Should you forget this, the script restore_repo, started by cron, will restore it for you the next time it is run. Note however that you must be logged off, actually no one must be logged on, for the script to actually change anything. If any user is logged on, the file is left unchanged. This is to prevent it from changing the links while you're logged on and possibly want them to point at another repository.