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 import subprocess
32 import os.path
33 import roslib.os_detect
34
35 import rosdep.base_rosdep
36
37
38
39
42 self.name = "uninitialized"
44 if "ROSDEP_TEST_OS" in os.environ:
45 return True
46 return False
47
49 return os.environ.get("ROSDEP_TEST_OS", "rosdep_test_os")
50
52 return os.environ.get("ROSDEP_TEST_VERSION", "rosdep_test_version")
53
56
58 if default_yes:
59 return "#yes"
60 else:
61 return "#no"
62
63
65
67 ret_list = []
68 cmd = ['dpkg-query', '-W', '-f=\'${Package} ${Status}\n\'']
69 cmd.extend(pkgs)
70 pop = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
71 (std_out, std_err) = pop.communicate()
72 std_out = std_out.replace('\'','')
73 pkg_list = std_out.split('\n')
74 for pkg in pkg_list:
75 pkg_row = pkg.split()
76 if len(pkg_row) == 4 and (pkg_row[3] =='installed'):
77 ret_list.append( pkg_row[0])
78 return ret_list
79
81 return list(set(packages) - set(self.dpkg_detect(packages)))
82
84 if not packages:
85 return "#No Packages to install"
86 if default_yes:
87 return "#Packages\nsudo apt-get install -y " + ' '.join(packages)
88 else:
89 return "#Packages\nsudo apt-get install " + ' '.join(packages)
90
91
92 -class Debian(roslib.os_detect.Debian, AptGetInstall, rosdep.base_rosdep.RosdepBaseOS):
93 """ This is an implementation of a standard interface for
94 interacting with rosdep. This defines all Ubuntu sepecific
95 methods, including detecting the OS/Version number. As well as
96 how to check for and install packages."""
97 pass
98
99
100
101 -class Ubuntu(roslib.os_detect.Ubuntu, AptGetInstall, rosdep.base_rosdep.RosdepBaseOS):
102 """ This is an implementation of a standard interface for
103 interacting with rosdep. This defines all Ubuntu sepecific
104 methods, including detecting the OS/Version number. As well as
105 how to check for and install packages."""
106 pass
107
108
109
110
111 -class Mint(AptGetInstall, rosdep.base_rosdep.RosdepBaseOS):
112 """ This is an implementation of a standard interface for
113 interacting with rosdep. Mint is closely coupled to Ubuntu, it
114 will masquerade as ubuntu for the purposes of rosdep. """
115
117 self.mint_detector = roslib.os_detect.Mint()
118 self.version_map = {'9':'10.04',
119 '8':'9.10',
120 '7':'9.04',
121 '6':'8.10',
122 '5':'8.04'}
124 return self.version_map[self.mint_detector.get_version()]
125
128
131
132
133 pass
134
135
136