From ceaca209061826b61ff0550881ef357317115cd3 Mon Sep 17 00:00:00 2001 From: Matthew Booth Date: Jul 02 2010 08:51:12 +0000 Subject: Add lens for grub's device.map --- diff --git a/augeas-0.7.2-10-7ac49e29.patch b/augeas-0.7.2-10-7ac49e29.patch new file mode 100644 index 0000000..8064840 --- /dev/null +++ b/augeas-0.7.2-10-7ac49e29.patch @@ -0,0 +1,92 @@ +commit 7ac49e29cafbf579608560206f62580078197b2f +Author: Matthew Booth +Date: Mon Jun 28 15:24:50 2010 +0100 + + Device_map: new lens for grub's device.map + +diff --git a/lenses/device_map.aug b/lenses/device_map.aug +new file mode 100644 +index 0000000..090edd5 +--- /dev/null ++++ b/lenses/device_map.aug +@@ -0,0 +1,28 @@ ++(* Parsing grub's device.map *) ++ ++module Device_map = ++ autoload xfm ++ ++ let sep_tab = Sep.tab ++ let eol = Util.eol ++ let fspath = Rx.fspath ++ let del_str = Util.del_str ++ ++ let comment = Util.comment ++ let empty = Util.empty ++ ++ let dev_name = /(h|f|c)d[0-9]+(,[0-9a-zA-Z]+){0,2}/ ++ let dev_hex = /0x[0-9a-fA-F]+/ ++ let dev_dec = /[0-9]+/ ++ ++ let device = del_str "(" . key ( dev_name | dev_hex | dev_dec ) . del_str ")" ++ ++ let map = [ device . sep_tab . store fspath . eol ] ++ ++ let lns = ( empty | comment | map ) * ++ ++ let xfm = transform lns (incl "/boot/grub/device.map") ++ ++(* Local Variables: *) ++(* mode: caml *) ++(* End: *) +diff --git a/lenses/tests/test_device_map.aug b/lenses/tests/test_device_map.aug +new file mode 100644 +index 0000000..2a7810a +--- /dev/null ++++ b/lenses/tests/test_device_map.aug +@@ -0,0 +1,34 @@ ++module Test_device_map = ++ ++ let conf = "# this device map was generated by anaconda ++(fd0) /dev/fda ++(hd0) /dev/sda ++(cd0) /dev/cdrom ++(hd1,1) /dev/sdb1 ++(hd0,a) /dev/sda1 ++(0x80) /dev/sda ++(128) /dev/sda ++" ++ ++ test Device_map.lns get conf = ++ { "#comment" = "this device map was generated by anaconda" } ++ { "fd0" = "/dev/fda" } ++ { "hd0" = "/dev/sda" } ++ { "cd0" = "/dev/cdrom" } ++ { "hd1,1" = "/dev/sdb1" } ++ { "hd0,a" = "/dev/sda1" } ++ { "0x80" = "/dev/sda" } ++ { "128" = "/dev/sda" } ++ ++ test Device_map.lns put conf after ++ set "hd2,1" "/dev/sdb1" ++ = "# this device map was generated by anaconda ++(fd0) /dev/fda ++(hd0) /dev/sda ++(cd0) /dev/cdrom ++(hd1,1) /dev/sdb1 ++(hd0,a) /dev/sda1 ++(0x80) /dev/sda ++(128) /dev/sda ++(hd2,1)\t/dev/sdb1 ++" +diff --git a/tests/Makefile.am b/tests/Makefile.am +index 1e20743..3570c53 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -23,6 +23,7 @@ lens_tests = \ + lens-cron.sh \ + lens-darkice.sh \ + lens-debctrl.sh \ ++ lens-device_map.sh \ + lens-dhclient.sh \ + lens-dnsmasq.sh \ + lens-dpkg.sh \ diff --git a/augeas.spec b/augeas.spec index b45edd0..e093c10 100644 --- a/augeas.spec +++ b/augeas.spec @@ -1,6 +1,6 @@ Name: augeas Version: 0.7.2 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A library for changing configuration files Group: System Environment/Libraries @@ -19,6 +19,7 @@ Patch5: augeas-0.7.2-06-11b85805.patch Patch6: augeas-0.7.2-07-72c636de.patch Patch7: augeas-0.7.2-08-0695bdd0.patch Patch8: augeas-0.7.2-09-5ee81630.patch +Patch9: augeas-0.7.2-10-7ac49e29.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: readline-devel libselinux-devel @@ -64,6 +65,7 @@ The libraries for %{name}. %patch6 -p1 %patch7 -p1 %patch8 -p1 +%patch9 -p1 %build %configure --disable-static @@ -106,6 +108,9 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/pkgconfig/augeas.pc %changelog +* Fri Jul 2 2010 Matthew Booth - 0.7.2-3 +- Add lens for grub's device.map + * Tue Jun 29 2010 David Lutterkort - 0.7.2-2 - Patches based on upstream fix for BZ 600141