Permalink
Browse files

Remove Facter dependency

This commit duplicates the bare essentials from:

    lib/facter/operatingsystem.rb
  • Loading branch information...
1 parent 7fb2b72 commit ff2b2277dc4ad22624fe75ef30112f864752da63 @saj saj committed Sep 19, 2011
Showing with 13 additions and 6 deletions.
  1. +0 −3 README
  2. +1 −1 dist/debian/control
  3. +0 −1 dist/rpm/tingle.spec
  4. +12 −1 lib/tingle/common
View
3 README
@@ -46,11 +46,8 @@ availability monitoring system before rebooting.
## Installation requirements
-* Puppet Labs' [Facter][]
* yum-downloadonly (required only on CentOS and RHEL)
-[Facter]: http://www.puppetlabs.com/puppet/related-projects/facter/
-
## Build requirements
View
@@ -8,7 +8,7 @@ Homepage: https://github.com/anchor/tingle
Package: tingle
Architecture: all
-Depends: ${shlibs:Depends}, ${misc:Depends}, facter
+Depends: ${shlibs:Depends}, ${misc:Depends}
Description: A package updater for busy system administrators
.
tingle acts as a thin frontend to your operating system's native
View
@@ -10,7 +10,6 @@ Source0: https://github.com/downloads/anchor/tingle/tingle-%{version}.tar
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
-Requires: facter
# x64 anti-hack
%define _lib lib
View
@@ -139,7 +139,18 @@ log_warning() {
}
os_flavour() {
- /usr/bin/facter operatingsystem 2>/dev/null
+ if [ -e /etc/redhat-release ]; then
+ if grep -qi centos /etc/redhat-release ; then
+ echo "CentOS"
+ elif grep -qi scientific /etc/redhat-release ; then
+ echo "Scientific"
+ else
+ echo "RedHat"
+ fi
+ elif [ -e /etc/debian_version ]; then
+ # You're one of those Ubuntu users, are ye? See bug #19353.
+ echo "Debian"
+ fi
}
# All potentially disastrous automated processes need a killswitch

0 comments on commit ff2b227

Please sign in to comment.