diff options
Diffstat (limited to 'debian/patches/000_use_packaged_upstart')
-rw-r--r-- | debian/patches/000_use_packaged_upstart | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/debian/patches/000_use_packaged_upstart b/debian/patches/000_use_packaged_upstart index fa933a8..463ae57 100644 --- a/debian/patches/000_use_packaged_upstart +++ b/debian/patches/000_use_packaged_upstart @@ -8,21 +8,26 @@ Verbose = False WaAgent = None DiskActivated = False -@@ -84,6 +85,18 @@ def DetectLinuxDistro(): +@@ -79,11 +80,23 @@ def IsLinux(): + + def DetectLinuxDistro(): + global LinuxDistro ++ global PackagedForDistro + if os.path.isfile("/etc/redhat-release"): + LinuxDistro = "RedHat" return True if os.path.isfile("/etc/lsb-release") and "Ubuntu" in GetFileContents("/etc/lsb-release"): LinuxDistro = "Ubuntu" + + # Should this run as if it is packaged Ubuntu? -+ if os.path.isfile("/etc/default/walinuxagent"): -+ try: -+ with open('/etc/default/walinuxagent') as f: -+ for line in f.readlines(): -+ if line == "WAXLINUXAGENT_PACKAGED=1": -+ PackagedForDistro = "Ubuntu" ++ try: ++ cmd="dpkg -S %s" % os.path.basename(__file__) ++ retcode, krn = RunSafe(cmd) ++ if not retcode: ++ PackagedForDistro = "Ubuntu" + -+ except IOError as e: -+ pass ++ except IOError as e: ++ pass + return True if os.path.isfile("/etc/debian_version"): |