diff options
author | Ben Howard <ben.howard@ubuntu.com> | 2013-01-31 11:42:39 -0700 |
---|---|---|
committer | usd-importer <ubuntu-server@lists.ubuntu.com> | 2013-02-01 06:03:53 +0000 |
commit | 608a9999c43d3500a13f03621c3982db505ec781 (patch) | |
tree | e47ef2994eab9dbbe441c9d2f42e71294aaa23bb /debian/patches/000_use_packaged_upstart | |
parent | b62390fb93897d9f873c0d23ddfcd7d2def7204f (diff) | |
download | vyos-walinuxagent-608a9999c43d3500a13f03621c3982db505ec781.tar.gz vyos-walinuxagent-608a9999c43d3500a13f03621c3982db505ec781.zip |
Import patches-unapplied version 1.3-0ubuntu2 to ubuntu/raring-proposed
Imported using git-ubuntu import.
Changelog parent: b62390fb93897d9f873c0d23ddfcd7d2def7204f
New changelog entries:
* Changed detection of whether or not agent is packaged to using
dpkg command. (LP: #1111690)
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"): |