modules/packages/manifests/mozilla/py27_mercurial.pp
author Dustin J. Mitchell <dustin@mozilla.com>
Fri, 21 Jun 2013 16:58:15 -0400
changeset 804 6f7b4a33af2c2edfe4a0f5e1f41a8cb80e75e8c4
parent 610 cfb180f1c89cb5190e35acf32a1c4838a06ba175
child 879 d7b2dcaafceea065102cde04a97300763b24f78f
permissions -rw-r--r--
Bug 825056: only set .hg/hgrc after the clone; r=Callek (irc)

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
class packages::mozilla::py27_mercurial {

    $mercurial = "/tools/python27-mercurial/bin/hg"

    anchor {
        'packages::mozilla::py27_mercurial::begin': ;
        'packages::mozilla::py27_mercurial::end': ;
    }

    include packages::mozilla::python27

    case $::operatingsystem {
        CentOS: {
            Anchor['packages::mozilla::py27_mercurial::begin'] ->
            package {
                "mozilla-python27-mercurial":
                    ensure => latest,
                    require => Class['packages::mozilla::python27'];
            } -> Anchor['packages::mozilla::py27_mercurial::end']
        }
        Ubuntu: {
            include packages::mercurial
            file {
                ["/tools/python27-mercurial", "/tools/python27-mercurial/bin"]:
                    ensure => directory;
                $mercurial:
                    ensure => link,
                    target => "/usr/bin/hg";
            }
        }
        Darwin: {
            Anchor['packages::mozilla::py27_mercurial::begin'] ->
            packages::pkgdmg {
                python27-mercurial:
                    version => "2.5.4-1";
            } -> Anchor['packages::mozilla::py27_mercurial::end']
        }
        default: {
            fail("cannot install on $::operatingsystem")
        }
    }
}