fix #105: fallback to /etc/avrdude while searching for avrdude.conf

Esse commit está contido em:
Victor Nakoryakov
2013-09-23 21:27:32 +04:00
commit 3ddc133ee8
3 arquivos alterados com 11 adições e 8 exclusões
+3
Ver Arquivo
@@ -87,6 +87,7 @@ Contributors
* `David Charbonnier <https://github.com/dcharbonnier>`_.
* `Jared Boone <https://github.com/jboone>`_.
* `Lars Englund <https://github.com/larsenglund>`_.
* `Alberto Ruiz <https://github.com/aruiz>`_.
Changelog
=========
@@ -95,6 +96,8 @@ Changelog
* Fix #74, #107, #108: Use of types declared in included files is allowed
in function definitions. Previously it led to: '<enum|struct|typedef>' not
declared in this scope.
* Fix #105: Search for `avrdude.conf` in `/etc/avrdude` to be compatible with
Fedora.
0.3.5
* Fix #62: Include `MIT-LICENSE.txt` in the tarball.
+4 -4
Ver Arquivo
@@ -39,10 +39,10 @@ class Upload(Command):
self.e.find_tool('stty', ['stty'])
if platform.system() == 'Linux':
self.e.find_arduino_tool('avrdude', ['hardware', 'tools'])
if os.path.exists('/etc/avrdude/avrdude.conf'):
self.e['avrdude.conf'] = '/etc/avrdude/avrdude.conf'
else:
self.e.find_arduino_file('avrdude.conf', ['hardware', 'tools'])
conf_places = self.e.arduino_dist_places(['hardware', 'tools'])
conf_places.append('/etc/avrdude') # fallback to system-wide conf on Fedora
self.e.find_file('avrdude.conf', places=conf_places)
else:
self.e.find_arduino_tool('avrdude', ['hardware', 'tools', 'avr', 'bin'])
self.e.find_arduino_file('avrdude.conf', ['hardware', 'tools', 'avr', 'etc'])
+4 -4
Ver Arquivo
@@ -143,17 +143,17 @@ class Environment(dict):
return self.find_file(key, items, places or ['$PATH'], human_name)
def find_arduino_dir(self, key, dirname_parts, items=None, human_name=None):
return self.find_dir(key, items, self._arduino_dist_places(dirname_parts), human_name)
return self.find_dir(key, items, self.arduino_dist_places(dirname_parts), human_name)
def find_arduino_file(self, key, dirname_parts, items=None, human_name=None):
return self.find_file(key, items, self._arduino_dist_places(dirname_parts), human_name)
return self.find_file(key, items, self.arduino_dist_places(dirname_parts), human_name)
def find_arduino_tool(self, key, dirname_parts, items=None, human_name=None):
# if not bundled with Arduino Software the tool should be searched on PATH
places = self._arduino_dist_places(dirname_parts) + ['$PATH']
places = self.arduino_dist_places(dirname_parts) + ['$PATH']
return self.find_file(key, items, places, human_name)
def _arduino_dist_places(self, dirname_parts):
def arduino_dist_places(self, dirname_parts):
"""
For `dirname_parts` like [a, b, c] return list of
search paths within Arduino distribution directory like: