[Pkg-puppet-devel] [SCM] Packaging of Facter for debian branch, upstream, updated. 51bcebe38cab6088c901f1006339bbe40a36d161

James Turnbull james at lovedthanlost.net
Wed Aug 18 05:55:46 UTC 2010


The following commit has been merged in the upstream branch:
commit 97879f9f576484b54fde41326a87129a1fe4f8b6
Author: Bostjan Skufca <bostjan at a2o.si>
Date:   Fri Jan 8 09:49:28 2010 +0100

    Added support for Slackware in operatingsystem and operatingsystemrelease

diff --git a/lib/facter/operatingsystem.rb b/lib/facter/operatingsystem.rb
index 335003a..d909fba 100644
--- a/lib/facter/operatingsystem.rb
+++ b/lib/facter/operatingsystem.rb
@@ -48,6 +48,8 @@ Facter.add(:operatingsystem) do
             else
                 "SuSE"
             end
+	elsif FileTest.exists?("/etc/slackware-version")
+	    "Slackware"
         end
     end
 end
diff --git a/lib/facter/operatingsystemrelease.rb b/lib/facter/operatingsystemrelease.rb
index 358496a..91f40a7 100644
--- a/lib/facter/operatingsystemrelease.rb
+++ b/lib/facter/operatingsystemrelease.rb
@@ -60,5 +60,15 @@ Facter.add(:operatingsystemrelease) do
 end
 
 Facter.add(:operatingsystemrelease) do
+    confine :operatingsystem => %w{Slackware}
+    setcode do
+        release = Facter::Util::Resolution.exec('cat /etc/slackware-version')
+        if release =~ /Slackware ([0-9.]+)/
+            $1
+        end
+    end
+end
+
+Facter.add(:operatingsystemrelease) do
     setcode do Facter[:kernelrelease].value end
 end

-- 
Packaging of Facter for debian



More information about the Pkg-puppet-devel mailing list