From 0276117d36280feba76d7ea44f5e8fb656af5137 Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Wed, 18 Jul 2007 14:55:54 +0000 Subject: [PATCH] Don't include a path to the avrdude config file on Linux, avrdude will know where it's config file is. --- app/AvrdudeUploader.java | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/app/AvrdudeUploader.java b/app/AvrdudeUploader.java index 5ff1c6ffd..15677672e 100755 --- a/app/AvrdudeUploader.java +++ b/app/AvrdudeUploader.java @@ -120,21 +120,22 @@ public class AvrdudeUploader extends Uploader { public boolean uisp(Collection params) throws RunnerException { flushSerialBuffer(); - String userdir = System.getProperty("user.dir") + File.separator; - String avrBasePath; - if(Base.isMacOS()) { - avrBasePath = new String("tools/avr/etc/"); - } - else if(Base.isLinux()) { - avrBasePath = new String(""); - } - else { - avrBasePath = new String(userdir + "tools/avr/etc/"); - } - List commandDownloader = new ArrayList(); commandDownloader.add("avrdude"); - commandDownloader.add("-C" + avrBasePath + File.separator + "avrdude.conf"); + + // On Windows and the Mac, we need to point avrdude at its config file + // since it's getting installed in an unexpected location (i.e. a + // sub-directory of wherever the user happens to stick Arduino). On Linux, + // avrdude will have been properly installed by the distribution's package + // manager and should be able to find its config file. + if(Base.isMacOS()) { + commandDownloader.add("-C" + "tools/avr/etc/avrdude.conf"); + } + else if(Base.isWindows()) { + String userdir = System.getProperty("user.dir") + File.separator; + commandDownloader.add("-C" + userdir + "tools/avr/etc/avrdude.conf"); + } + if (Preferences.getBoolean("upload.verbose")) { commandDownloader.add("-v"); commandDownloader.add("-v");