Eddy Petrișor a scris:
> Hello Paolo,
> 
> (I've CC-ed the dev list for tracking/archiving purposes).
> 
> I have taken the osm-helpers-0.3 archive and made a few changes:
> 
>     use XDG_CONFIG_HOME directory for the location of the config files
>     make sure PREFIX/bin is created before copying stuff into it
> 
> These patches are attached.

Oops, the initial patch for the XDG_CONFIG_HOME changes was a little broken. 
Corrected patch is
attached.

-- 
Regards,
EddyP
=============================================
"Imagination is more important than knowledge" A.Einstein
From 599d0d156604c535aecb43954e5983622c73de70 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Eddy=20Petri=C8=99or?= <[email protected]>
Date: Mon, 15 Dec 2008 13:27:58 +0200
Subject: [PATCH] use XDG_CONFIG_HOME directory for the location of the config files

See http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

This can be tested that is works with this:

using System;
using System.IO;

class xdg {
	static public void Main ()
	{
		string filename = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData), "foo");
		Console.WriteLine ("Filename: {0}", filename);
	}
}
---
 README                |   12 +++++++-----
 osm-check.cs          |    2 +-
 osm-upload-changes.cs |    4 ++--
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/README b/README
index d779b9d..bbcda0c 100644
--- a/README
+++ b/README
@@ -26,8 +26,9 @@ in an XML format. This file can be inspected for mistakes and then fed to
 osm-upload-changes to upload to the OpenStreetMap database server.
 Other rules will be added in the next releases.
 
-The rules are described in an XML file, loaded from $HOME/.osm-check.rules
-by default (use the --rules option to specify a different file).
+The rules are described in an XML file, loaded from
+$HOME/.config/osm-helpers/osm-check.rules by default (use the --rules
+option to specify a different file).
 
 Each abbreviation is specified with the following element:
 	<abbr from="abbr." to="Abbreviation" />
@@ -52,9 +53,10 @@ when using some other mass-update scripts). This also means that
 the uploading process can be somewhat slow (depending mostly on the
 performance of the OpenStreetMap server).
 A username and password are required to upload the changes: currently they
-are read from the file $HOME/.osm-auth, which contains the username in the
-first line and the password in the second or, if that file is not present
-they can be entered at the console prompt.
+are read from the file $HOME/.config/osm-helpers/osm-auth, which
+contains the username in the first line and the password in the second
+or, if that file is not present they can be entered at the console
+prompt.
 
 osm-upload-changes prints a dot for each successful upload, an asterisk
 for a change skipped because it's no longer valid, a letter if something
diff --git a/osm-check.cs b/osm-check.cs
index 0dbaa33..abc6e25 100644
--- a/osm-check.cs
+++ b/osm-check.cs
@@ -28,7 +28,7 @@ class OsmCheck {
 	static void LoadRules (string filename)
 	{
 		if (filename == null)
-			filename = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.Personal), ".osm-check.rules");
+			filename = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData), "osm-helpers/osm-check.rules");
 		XmlTextReader reader = new XmlTextReader (filename);
 		List<string> abbrs = new List<string> ();
 		List<string> ways = new List<string> ();
diff --git a/osm-upload-changes.cs b/osm-upload-changes.cs
index bdf5ee1..6d00388 100644
--- a/osm-upload-changes.cs
+++ b/osm-upload-changes.cs
@@ -83,7 +83,7 @@ Thanks!
 	{
 		try {
 			TextReader reader = new StreamReader (
-				Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.Personal), ".osm-auth"));
+				Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData), ".config/osm-helpers/osm-auth"));
 			user = reader.ReadLine ();
 			password = reader.ReadLine ();
 			if (user != null && password != null)
@@ -98,7 +98,7 @@ Thanks!
 		return;
 		//Console.WriteLine ("{0}: {1} {2}, {3}", user, password, user.Length, password.Length);
 		Environment.Exit (2);
-		Console.WriteLine ("Add the file ~/.osm-auth with your username and password, one per line.");
+		Console.WriteLine ("Add the file ~/.config/osm-helpers/osm-auth with your username and password, one per line.");
 		user = password = null;
 		Environment.Exit (2);
 	}
-- 
1.5.6.5

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
dev mailing list
[email protected]
http://lists.openstreetmap.org/listinfo/dev

Reply via email to