Skip to content

Commit

Permalink
Merge pull request #33 from xaque208/purge
Browse files Browse the repository at this point in the history
Purge unmanage repo configurations
  • Loading branch information
Zach Leslie committed Apr 22, 2014
2 parents c8d71e6 + e67ca99 commit 9f62b13
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions manifests/init.pp
Expand Up @@ -6,24 +6,36 @@
# make -C /usr/ports/ports-mgmg/pkg install clean

class pkgng (
$pkg_dbdir = $pkgng::params::pkg_dbdir,
$pkg_cachedir = $pkgng::params::pkg_cachedir,
$portsdir = $pkgng::params::portsdir,
$repos = {},
$pkg_dbdir = $pkgng::params::pkg_dbdir,
$pkg_cachedir = $pkgng::params::pkg_cachedir,
$portsdir = $pkgng::params::portsdir,
$purge_repos_d = false,
$repos = {},
) inherits pkgng::params {

# PkgNG versions before 1.1.4 use another method of defining repositories
if ! $pkgng_supported or versioncmp($pkgng_version, "1.1.4") < 0 {
fail("PKGng is either not supported on your system or it is too old")
}

file { "/usr/local/etc/pkg.conf":
file { '/usr/local/etc/pkg.conf':
content => "PKG_DBDIR: ${pkg_dbdir}\nPKG_CACHEDIR: ${pkg_cachedir}\nPORTSDIR: ${portsdir}\n",
notify => Exec['pkg update'],
}
# make sure repo config dir is present
file { ['/usr/local/etc/pkg', '/usr/local/etc/pkg/repos']:
file { '/usr/local/etc/pkg':
ensure => directory,
}
if $purge_repos_d == true or $purge_repos_d == 'true' {
File['/usr/local/etc/pkg/repos'] {
recurse => true,
purge => true,
}
}
file { '/usr/local/etc/pkg/repos':
ensure => directory,
}
Expand Down

0 comments on commit 9f62b13

Please sign in to comment.