[Pcsclite-cvs-commit] r6332 - /trunk/pcsc-tools/ATR_analysis
rousseau at users.alioth.debian.org
rousseau at users.alioth.debian.org
Wed Jun 13 12:02:33 UTC 2012
Author: rousseau
Date: Wed Jun 13 12:02:32 2012
New Revision: 6332
URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=6332
Log:
Use XDG_CACHE_HOME env variable
http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
defines the default cache directory and the use of XDG_CACHE_HOME to
override it.
The smartcard_list.txt file is now searched in ~/.cache/ by default
Thanks to Diego Elio Pettenò for the idea.
Modified:
trunk/pcsc-tools/ATR_analysis
Modified: trunk/pcsc-tools/ATR_analysis
URL: http://svn.debian.org/wsvn/pcsclite/trunk/pcsc-tools/ATR_analysis?rev=6332&op=diff
==============================================================================
--- trunk/pcsc-tools/ATR_analysis (original)
+++ trunk/pcsc-tools/ATR_analysis Wed Jun 13 12:02:32 2012
@@ -46,8 +46,18 @@
use Getopt::Std;
use Chipcard::PCSC::Card;
+# default value for XDG_CACHE_HOME
+# http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
+my $Cache = "$ENV{HOME}/.cache";
+
+# check if XDG_CACHE_HOME env variable is set
+if (exists($ENV{XDG_CACHE_HOME}))
+{
+ $Cache = "$ENV{XDG_CACHE_HOME}";
+}
+
# file containing the smart card models
-my @SMARTCARD_LIST = ( "$ENV{HOME}/.smartcard_list.txt", "/usr/local/pcsc/smartcard_list.txt", "/usr/share/pcsc/smartcard_list.txt", "/usr/local/share/pcsc/smartcard_list.txt");
+my @SMARTCARD_LIST = ( "$Cache/smartcard_list.txt", "$ENV{HOME}/.smartcard_list.txt", "/usr/local/pcsc/smartcard_list.txt", "/usr/share/pcsc/smartcard_list.txt", "/usr/local/share/pcsc/smartcard_list.txt");
our ($opt_v, $opt_h);
my ($atr, %TS, @Fi, @FMax, @Di, @XI, @UI, $T, $value, $counter, $line, $TCK);
More information about the Pcsclite-cvs-commit
mailing list