summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Lowther <victor.lowther@gmail.com>2009-12-05 21:29:01 -0600
committerVictor Lowther <victor.lowther@gmail.com>2009-12-05 21:29:01 -0600
commitab89e5758bc07d1506050d97b4d9ff5a051b6681 (patch)
tree6c84dbb49d934b2e015aca38b204c1dd441f2fc4
parent946ba5c8fa6e1d46b0bb205a0b2a98cc4261a480 (diff)
Update import-fdi-quirkdb to make it a little more flexible.
It now takes two optional arguments -- $1 is the location of the .fdi quirks, and $2 is the place to put them.
-rw-r--r--src/import-fdi-quirkdb.in17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/import-fdi-quirkdb.in b/src/import-fdi-quirkdb.in
index 076562a..f344304 100644
--- a/src/import-fdi-quirkdb.in
+++ b/src/import-fdi-quirkdb.in
@@ -9,6 +9,15 @@
# If anyone wants fo rewrite this in a language that actually understands
# XML, feel free.
+# If run with no arguments, it will translate the already installed .fdi
+# quirks into the native ones at their default location.
+
+# If run with one argument, it will translate the .fdi quirks located at
+# $1 into the native ones at their default location.
+
+# if run with two arguments, it will translate the .fdi quirks located at $1
+# into the native ones at $2.
+
. "@PM-UTILS-LIBDIR@/pm-functions"
begin_match='<match key="([a-z._]+)" ([a-z_]+)="([^"]+)">'
@@ -125,9 +134,13 @@ translate_xml() {
}
+loc="/usr/share/hal/fdi/information/10freedesktop/20-video-quirk*.fdi"
+[[ $1 && -d $1 ]] && loc="$1/20-video-quirk*.fdi"
+[[ $2 ]] && PM_QUIRKDB="$2"
+
+
mkdir -p "$PM_QUIRKDB"
-for f in /etc/hal/fdi/information/99local-pm-utils-quirks.fdi \
- /usr/share/hal/fdi/information/10freedesktop/20-video-quirk*.fdi;
+for f in $loc;
do
lf="$PM_QUIRKDB/${f##*/}"
lf="${lf%.*}.quirkdb"