From f46b2a9a5a2434430506e93e1aec41aaef87beb2 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Wed, 23 Mar 2011 17:39:28 +0100 Subject: [PATCH] no longer need check-apt-repository Signed-off-by: Steven Armstrong --- .../type/__apt_ppa/files/check-apt-repository | 42 ------------------- conf/type/__apt_ppa/manifest | 6 +-- 2 files changed, 1 insertion(+), 47 deletions(-) delete mode 100755 conf/type/__apt_ppa/files/check-apt-repository diff --git a/conf/type/__apt_ppa/files/check-apt-repository b/conf/type/__apt_ppa/files/check-apt-repository deleted file mode 100755 index 4f4252c1..00000000 --- a/conf/type/__apt_ppa/files/check-apt-repository +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env python -# -# Check if the given apt repository is installed or not. -# Exit with: -# 0: if it is installed -# 1: if not -# 2: on error -# - -import sys -from aptsources import distro, sourceslist -from softwareproperties import ppa - - -def is_repository_installed(repository): - #print 'repository:', repository - codename = distro.get_distro().codename - #print 'codename:', codename - (line, file) = ppa.expand_ppa_line(repository.strip(), codename) - #print 'line:', line - #print 'file:', file - sources_list = sourceslist.SourcesList() - source_entry = sourceslist.SourceEntry(line, file) - - if source_entry in sources_list: - #print 'yes' - return True - else: - #print 'no' - return False - -if __name__ == '__main__': - if (len(sys.argv) != 2): - print 'Error: need a repository as argument' - sys.exit(2) - #repository = 'ppa:freenx-team' - repository = sys.argv[1] - if is_repository_installed(repository): - sys.exit(0) - else: - sys.exit(1) - diff --git a/conf/type/__apt_ppa/manifest b/conf/type/__apt_ppa/manifest index a97ced75..d5df9e23 100755 --- a/conf/type/__apt_ppa/manifest +++ b/conf/type/__apt_ppa/manifest @@ -18,14 +18,10 @@ # along with cdist. If not, see . # +name="$__object_id" __package python-software-properties --state installed -require="__package/python-software-properties" \ - __file /usr/local/bin/check-apt-repository \ - --source "$__type/files/check-apt-repository" \ - --mode 0755 - require="__package/python-software-properties" \ __file /usr/local/bin/remove-apt-repository \ --source "$__type/files/remove-apt-repository" \