[augeas-devel] augeas: master - Support version pins in apt_preferences

David Lutterkort lutter at fedoraproject.org
Tue Nov 24 17:10:11 UTC 2009


Gitweb:        http://git.fedorahosted.org/git/augeas.git?p=augeas.git;a=commitdiff;h=74e4aca7fa06e823ad9a03d05972da2bfca4c244
Commit:        74e4aca7fa06e823ad9a03d05972da2bfca4c244
Parent:        6e9f15aec6b3bcb111aec64a5eddec6b3a6e1152
Author:        Matt Palmer <mpalmer at hezmatt.org>
AuthorDate:    Mon Nov 23 05:07:13 2009 +1100
Committer:     David Lutterkort <lutter at redhat.com>
CommitterDate: Tue Nov 24 09:03:08 2009 -0800

Support version pins in apt_preferences

---
 lenses/aptpreferences.aug            |    5 ++++-
 lenses/tests/test_aptpreferences.aug |   14 +++++++++++---
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/lenses/aptpreferences.aug b/lenses/aptpreferences.aug
index dc0498b..dd04595 100644
--- a/lenses/aptpreferences.aug
+++ b/lenses/aptpreferences.aug
@@ -27,7 +27,10 @@ module AptPreferences =
                 | key_value "o"
                 | key_value "v"
 
-   let pin = [ key "Pin" . colon . value_to_spc . spc . pin_keys . ( comma . pin_keys )*. eol ]
+   let pin_options = store /(origin|release)/ . spc . pin_keys . ( comma . pin_keys )*
+   let version_pin = store /version/ . [ label "version" . spc . store /[^ \t\n]+/ ]
+
+   let pin = [ key "Pin" . colon . (pin_options | version_pin) . eol ]
 
    let entries = simple_entry "Explanation"
                | simple_entry "Package"
diff --git a/lenses/tests/test_aptpreferences.aug b/lenses/tests/test_aptpreferences.aug
index 307610f..0a7f248 100644
--- a/lenses/tests/test_aptpreferences.aug
+++ b/lenses/tests/test_aptpreferences.aug
@@ -9,6 +9,10 @@ Explanation: My packages are the most prioritary
 Package: *
 Pin: release l=Raphink, v=3.0
 Pin-Priority: 700
+
+Package: liferea-data
+Pin: version 1.4.26-4
+Pin-Priority: 600
 "
 
     test AptPreferences.lns get conf =
@@ -18,12 +22,16 @@ Pin-Priority: 700
           { "Pin"          = "release"
               { "a" = "backports" } }
           { "Pin-Priority" = "100" } }
-       {}
        { "2"
           { "Explanation"  = "My packages are the most prioritary" }
           { "Package"      = "*" }
           { "Pin"          = "release"
               { "l" = "Raphink" }
-	      { "v" = "3.0"     } }
+              { "v" = "3.0"     } }
           { "Pin-Priority" = "700" } }
-
+       {}
+       { "3"
+          { "Package"      = "liferea-data" }
+          { "Pin"          = "version"
+              { "version" = "1.4.26-4" } }
+          { "Pin-Priority" = "600" } }




More information about the augeas-devel mailing list