summaryrefslogtreecommitdiffstats
path: root/abs/core/LinHES-config/mv_software.py
blob: 20b355ec076eed6c2d566c532b5fb3706a272217 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# -*- coding: utf-8 -*-
import logging, mv_common
import os, re

def setup_software(systemconfig, data_config):
    if  mv_common.read_config(mv_common.module_config,"software")  == False  :
        logging.info("____Skipping of software, config disabled____")
        return

    logging.info("____Start of Software install____")
    postfix=''
    if data_config.SYSTEMTYPE == "MythVantage":
      #look for the installed prefix
      cmd="pacman -Q mythtv-release-fixes"
      rc = mv_common.runcmd(cmd)
      if rc == 0:
        postfix = "-release-fixes"
      else:
        postfix = "-svn"
      #This section is for MythVantage OS, not LINHES
      default_disabled = ("mytharchive", "mythbrowser", "mythnews",
                          "mythgame",  "mythweather", "mythzoneminder","mythnetvision" )

      default_installed=("mythgallery", "mythmusic")
      other_pkg=("miro", "mednafen", "romdb", "xine", "dvdcss", "webmin" , "fuppes", "foldingathome", "mythappletrailers", "mythstream", "mupen64")
    else:
      default_disabled = ("mytharchive",
                          "mythbrowser",
                          "mythnews",
                          "mythgame",
                          "mythweather",
                          "mythzoneminder",
                          "mythnetvision" )

      default_installed=("mythgallery",
                         "mythmusic")
      other_pkg=("romdb",
                 "snes9x",
                 "fceux",
                 "mame",
                 "mednafen",
                 "mupen64",
                 "dolphinemu",
                 "xe",
                 "mythappletrailers",
                 "miro",
                 "webonlinhes",
                 "huludesktop",
                 "dvdcss",
                 "foldingathome")


    for pkg in default_disabled:
        pkgname=pkg+postfix
        try:
            if systemconfig[pkg] == "1":
                mv_common.pacinstall(pkgname)
            else:
                mv_common.pacremove(pkgname)
        except:
            logging.debug("  ERROR-- %s is not defined", pkg)

    for pkg in default_installed:
        pkgname=pkg+postfix
        try:
            if systemconfig[pkg] == "0":
                mv_common.pacremove(pkgname)
            else:
                mv_common.pacinstall(pkgname)
        except:
            logging.debug("  ERROR-- %s is not defined", pkg)

    for pkg in other_pkg:
        try:
            if systemconfig[pkg] == "1":
                mv_common.pacinstall(pkg)
            elif systemconfig[pkg] == "0":
                mv_common.pacremove(pkg)
        except:
            logging.debug("   ERROR-- %s is not defined", pkg)
    logging.info("__End Software\n ")