System Model

A new update mechanism called “system model” is added. In this model, a file called /etc/conary/system-model describes what should be installed on the system. This file is modified by certain conary update commands, and can also be edited with a text editor. The system model allows a system to be updated relative to a search path that includes groups as well as labels, leading to more coherent sets of updated packages. It also allows re-starting updates with transient failures; the filename /etc/conary/ is reserved for storing the system target state during an update operation.

The system model mode is intended to become the normal update mode for Conary-based systems in the future. It works by creating a set oftroves that define the system, and then moving the system to that defi‐nition. It is conceptually similar to building a group into a reposi‐tory and then migrating to that group. Significant differencesinclude:

  • In a group, all trove references are absolute, but in a model,you can choose whether references are absolute. Migrating to aspecific version of a group will always move the system to theexact set of packages referenced, but re-applying a system modelwill update troves that are not pinned down to a specific ver‐sion.
  • There is no group name for the set of troves.
  • There is no version for the set of troves. (The version opera‐tion in a system model does not provide conary versioning.)
  • Path and version conflicts are not checked when assembling theset of troves. (No group policy is run at all.) This meansthat path and version conflicts will be found only whileinstalling the packages.

A system model that installs only a single group will functionsimilar to migrate mode. The most obvious difference is that migratemode honors variations in byDefault settings in the system database(that is, an optional component of the trove(s) migrated to that hasbeen installed on the system will still be installed after the migrateoperation finishes), whereas a system model update honors those changesonly if they are represented in the model itself.

Whenever you specify an "update" or "install" command with a label, Conary will look up the latest package and put an explicit reference to that version in the /etc/conary/system-model file.

   # conary rq --labels at fl:2 at fl:2/2.8.4-0.3-1
   # conary update at fl:2
   # grep xchat /etc/conary/system-model
   update at fl:2/2.8.4-0.3-1

Note that Conary itself looked up the "2.8.4-0.3-1" and added it to the model.

This means that when you are doing development, you can do:

   $ cvc ci foo
       <build at fl:2-devel>
   # conary update at fl:2-devel

Now, the latest version of foo that you just built will be on your system.

This means that you no longer need to use a "search" line for every package outside groups that you want to update in a stable way. So most users will need only one or two search lines at the beginning of your model. If you have something like this:

   search at rpl:2/0.6.9-7-0.1
   search at rpl:2/1.01-2-0.1
   search at rpl:2/2.8-1-0.1
   update exif exiftags jhead

You will want to change it (with a text editor, this change is not automated) to something like:

   update at rpl:2/0.6.9-7-0.1 at rpl:2/1.01-2-0.1 at rpl:2/2.8-1-0.1

When you run the "conary updateall" command, all trove reference that include a version (not just a label) will update to the latest version.

The genmodel script has been updated not to generate the extra search lines when creating new model files.

Simpler model files

Conary now tries to simplify the models that it writes, which should make them easier to understand and faster to run -- and also fix a bug. It will do this only if it confirms that the simplification doesn't change the way the system is defined.

Previously, if you ran"conary update foo bar" followed by "conary erase foo", you would have the following two lines in your /etc/conary/system-model file:

   update foo bar
   erase foo

Now, if "foo" is on the system only because of that update line, it will change those two lines to:

   update bar

It will do that only if it results in the exact same set of packages installed. (Conary rebuilds the entire simplified model and compares it to the unsimplified model, and if they don't match, it just gives up.) It does not try over and over to simplify until the model has been reduced to its essense, but it is intended do at least some reasonable simplifications introduced by the current command.

One very important simplification is that it should notice when updating one locally-built changeset (you will see local at local:COOK in the system-model file) supercedes another, and it should remove the reference to the outdated version. Previously, thate action would succeed, but the next conary update/erase/sync action after that would fail trying to look up the earlier version. This should be fixed.

Pinned versions in models

While it is nice that conary easily snapshots versions by default, what if you want a specific version NOT to change?

You can now specify a version that you do not want Conary to change when running the "conary updateall" command: use a "==" instead of a "=". This is considered an advanced capability and isn't available at the command line; the only way to do this is with a text editor.

   install group-gnome-dist
   # I never want to update tightvnc from this specific version,
   # even when I run updateall
   # I like mkj's version of xchat, and I want new versions when I run
   # "conary updateall" after mkj has built a new version
   install Genshi pypdf

Next Foresight Linux iso will have system model enabled as default. All iso files that are made after 29/03/2011 has system-model as default. If you want to run it today in Foresight, open Terminal and write this command:

Terminal.png sudo /usr/share/conary/genmodel

After its done, you can edit the file:

Terminal.png sudo gedit /etc/conary/system-model

The System-model can look like:

# This file is an attempt to describe an existing system.
# It is intended to describe the "meaning" of the installed system.
# After this file is installed as /etc/conary/system-model any
# following conary update/install/erase operations will be done
# by modifying this file, then building a representation of the
# new desired state of your local system described in the modified
# file, and then updating your system to that new state.
# It is reasonable to edit this file with a text editor.
# Conary will preserve whole-line comments (like this one)
# when it edits this file, so you may use comments to describe
# the purpose of your modifications.
# After you edit this file, run the command
#   conary sync
# This command will move your system to the state you have
# described by your edits to this file, or will tell you
# about errors you have introduced so that you can fix them.
# The "install" and "update" lines are relative only to things
# mentioned earlier in this model, not relative to what has been
# previously installed on your system.
# Some of the troves on this system are not represented in the
# following model, most likely because they appear to have been
# included only to satisfy dependencies.  Please review the
# following data and edit the system model to represent the
# troves that you wish to have installed on your system.
# The following additional operations would be needed to make the
# system match the model, and would be applied to the system by 
# a "conary sync" operation:
#     Install lftp=3.7.11-0.1-1
search '[is: x86]'
search '[~!bootstrap,~buildtests,~!cross,desktop,~!dom0,~!domU,~!gcc.core,~grub.static,ipv6,~kernel.debugdata,krb,ldap,pam,readline,ssl,tcl,tk,~!vmware,~!xen is: x86(i486,i586,i686,sse,sse2) x86_64]'
install group-gnome-dist-devel
install python-inotify:python
update chromium
update thunderbird
update filezilla
update fribid
update nvidia nvidia-kernel
update virtualbox-ose virtualbox-guest
update wine

The file is kinda obvious, if i want to delete something, then remove that line. Then run sync command. This also mean you can easily clone your system with another computer by using same System-model file.

Remove or add lines, and then run

Terminal.png sudo conary sync 

to make the changes. Real easy to see what's installed in your system and make changes.


Terminal.png conary search *name*

Only works with system-model enabled.

If you already have the file: /etc/conary/system-model Then you already have system-model activated.

When installing or updating your system, you still use sudo conary updateall or sudo conary update ***