Wednesday, 27 February 2013

etckeeper and bzr explorer

In my previous blog post, I talked about using the etckeeper package for keeping the entire /etc directory under version control. In this post I'll talk about how to manually audit the changes to see what changes were made and also how to reverse those changes, using the "bzr explorer" program.

To do this, we need to install the "bzr-explorer" package. Once this is done, you have to start up the GUI as the root user:

sudo bzr explorer

NOTE: I initially tried starting it up as a non-root user and it was not able to load the repository.

Once we've got this open, we can go to the "Open an existing location" pane and select the "Open" button. Navigate to the "/etc" directory and click on "Choose". This will load up the repository in the explorer window.

Now, if someone has modified a file under /etc but hasn't committed it, the screen will look like the following:

From here, we can see what the differences made were and also choose whether to commit the new version to the repository.

If we wanted to alternatively see a log of all of the changes that had been made, after opening the /etc repository, we could hit the "Log" button to bring up a listing of all of the commits. From there, selecting any particular commit would bring up a Diff screen showing the changes which had been made:

If we had seen a change which we didn't want and needed to roll back, right-clicking on any previous version and selecting "Revert" is enough to change the file back to it's previous state and update the repository.