[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[coldsync-hackers] ColdSync.pm patch
- To: coldsync-hackers at lusars dot net
- Subject: [coldsync-hackers] ColdSync.pm patch
- From: Pierre Phaneuf <pp at ludusdesign dot com>
- Date: Wed, 16 Oct 2002 10:53:38 -0400
- Reply-To: coldsync-hackers at lusars dot net
- Sender: owner-coldsync-hackers at lusars dot net
- User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020913 Debian/1.1-1
If you invoke a conduit with a relative path (for example, "./my-conduit
-config"), the "-config" output will have the relative path in it,
which might be wrong. One could do nicer (for example, change
"foo/bar/.." into just "foo"), but this at least doesn't produce
incorrect output.
--- ColdSync.pm 2 Apr 2002 15:33:04 -0000 1.18
+++ ColdSync.pm 16 Oct 2002 14:45:16 -0000
@@ -153,6 +153,15 @@ sub DumpConfig
my $type;
my @typestrings = ();
my $typestring;
+ my $path = $0;
+
+ if($path =~ m|^[^/].*/|) {
+ $path =~ s|^\./||;
+ $path = $ENV{'PWD'} . '/' . $path;
+ }
+
+ $path =~ s|^\./||;
+
foreach $creator (keys %Palm::PDB::PDBHandlers)
{
@@ -169,7 +178,7 @@ sub DumpConfig
print "conduit ", join(",", @flavors), " {\n";
# Print the "conduit" directive and the list of
# flavors
- print "\tpath: \"$0\";\n";
+ print "\tpath: \"$path\";\n";
# Print path to the conduit
# Print the list of types that this conduit supports.
--
Pierre Phaneuf
http://advogato.org/person/pphaneuf/
--
This message was sent through the coldsync-hackers mailing list. To remove
yourself from this mailing list, send a message to majordomo@thedotin.net
with the words "unsubscribe coldsync-hackers" in the message body. For more
information on Coldsync, send mail to coldsync-hackers-owner@thedotin.net.