Ticket #10982: 0001-Fix-hardwareProfile-to-work-with-MYTHCONFDIR-environ.patch

File 0001-Fix-hardwareProfile-to-work-with-MYTHCONFDIR-environ.patch, 1.6 KB (added by Lawrence Rust <lvr@…>, 12 years ago)
  • mythtv/programs/scripts/hardwareprofile/config.py

    From 334b110289f65dc07d815950e99733c673ce0c97 Mon Sep 17 00:00:00 2001
    From: Lawrence Rust <lvr@softsystem.co.uk>
    Date: Wed, 8 Aug 2012 14:56:33 +0200
    Subject: [PATCH] Fix hardwareProfile to work with MYTHCONFDIR environ
    
    When submitting a hardware profile, the UUID filenames are hardcoded
    under ~/.mythtv.  This fix honours the MYTHCONFDIR setting and
    allows the profile to be created in the correct directory.
    
    Signed-off-by: Lawrence Rust <lvr@softsystem.co.uk>
    ---
     mythtv/programs/scripts/hardwareprofile/config.py |   14 ++++++++++----
     1 files changed, 10 insertions(+), 4 deletions(-)
    
    diff --git a/mythtv/programs/scripts/hardwareprofile/config.py b/mythtv/programs/scripts/hardwareprofile/config.py
    index 89d468f..918256e 100644
    a b import os_detect 
    77SMOON_URL = "http://smolt.mythtv.org/"
    88SECURE = 0
    99from user import home
    10 HW_UUID = home + "/.mythtv/HardwareProfile/hw-uuid"
    11 PUB_UUID= home +  "/.mythtv/HardwareProfile/pub-uuid"
    12 UUID_DB = home + '/.mythtv/HardwareProfile/uuiddb.cfg'
    13 ADMIN_TOKEN = home +  "/.mythtv/HardwareProfile/smolt_token"
     10
     11try:
     12    mythconfdir = os.environ['MYTHCONFDIR']
     13except KeyError:
     14    mythconfdir = home + "/.mythtv"
     15
     16HW_UUID = mythconfdir + "/HardwareProfile/hw-uuid"
     17PUB_UUID= mythconfdir +  "/HardwareProfile/pub-uuid"
     18UUID_DB = mythconfdir + '/HardwareProfile/uuiddb.cfg'
     19ADMIN_TOKEN = mythconfdir +  "/HardwareProfile/smolt_token"
    1420
    1521
    1622#These are the defaults taken from the source code.