This file is indexed.

/usr/share/gnucash/make-prefs-migration-script.xsl is in gnucash-common 1:2.6.1-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:df="http://dateformats.data">
<xsl:output method="text" encoding="UTF8"/>

<!-- Configure lookup table for date format -->
<xsl:key name="datefmt-lookup" match="df:dateformat" use="df:name"/>
<xsl:variable name="dateformats-top" select="document('')/*/df:dateformats"/>

<!-- Primary template - process each prefence group -->
<xsl:template match="/">
<!-- Write file header -->
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;  migrate-prefs.scm
;;;  Custom generated script to migrate user preferences from
;;;  gconf to gsettings. This should only be run once -
;;;  when running GnuCash 2.6.x for the first time.
;;;
;;;  Copyright 2013 Geert Janssens &lt;geert@kobaltwit.be&gt;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(define-module (migrate-prefs-user))

(use-modules (gnucash core-utils))
;(use-modules (gnucash gnc-module))
;; Guile 2 needs to find the symbols from the c module at compile time already
;(cond-expand
;  (guile-2
;    (eval-when
;      (compile load eval) 
;      (load-extension "libgnc-core-utils" "scm_init_sw_core_utils_module")))
;  (else
;    (load-extension "libgnc-core-utils" "scm_init_sw_core_utils_module")))
;(use-modules (sw_core_utils))

(define (run-migration-internal)
 <xsl:for-each select="//prefsgroup">
  <xsl:if test="document(gconfpath)//entry">
;; Processing preferences in group <xsl:value-of select="gschemaid"/>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   <xsl:variable name="gconf-top" select="document(gconfpath)/gconf"/>
   <xsl:apply-templates select="./pref"/>
  </xsl:if>
 </xsl:for-each>
 
(display "Preference migration has finished")(newline)
)

(define (run-migration)
  (catch #t
    run-migration-internal
    (lambda args 
        (display (string-append
                   "An error occurred while migrating preferences."
                   (newline) "The error is: "
                   (symbol->string key) " - "  (car (caddr args))  "."))
        #f))
)

(export run-migration)
</xsl:template>

<!-- Process one prefence -->
<xsl:template match="pref">
  <xsl:variable name="gconf-top" select="document(../gconfpath)/gconf"/>
  <xsl:apply-templates select="$gconf-top">
   <xsl:with-param name="curr-pref" select="."/>
  </xsl:apply-templates>
</xsl:template>
 
<!-- Find the equivalent entry in gconf -->
<xsl:template match="gconf">
 <xsl:param name="curr-pref"/>
 <xsl:for-each select="entry">
  <xsl:if test="@name = $curr-pref/gconfkey">
;; Processing preference <xsl:value-of select="$curr-pref/gschemaname"/>
   <xsl:apply-templates select=".">
    <xsl:with-param name="curr-pref" select="$curr-pref"/>
   </xsl:apply-templates>
  </xsl:if>
 </xsl:for-each>
</xsl:template>

<!-- Determine next action based on preference type -->
<xsl:template match="entry">
 <xsl:param name="curr-pref"/>
  <xsl:choose>
   <xsl:when test="$curr-pref/gschematype = 'b'"><xsl:if test="./@value">
;; Gconf value (boolean): <xsl:value-of select="./@value"/>
(gnc-prefs-set-bool
    ; preference group
    "<xsl:value-of select="$curr-pref/../gschemaid"/>"
    ; preference name
    "<xsl:value-of select="$curr-pref/gschemaname"/>"
    ; preference value
    <xsl:if test="./@value = 'true'">#t</xsl:if>
    <xsl:if test="./@value = 'false'">#f</xsl:if>
)
   </xsl:if></xsl:when>
   

   <xsl:when test="$curr-pref/gschematype = 'datefmt'"><xsl:if test="./stringvalue">
;; Gconf value (string): "<xsl:value-of select="./stringvalue"/>" -> gsettings (integer)
(gnc-prefs-set-int
    ; preference group
    "<xsl:value-of select="$curr-pref/../gschemaid"/>"
    ; preference name
    "<xsl:value-of select="$curr-pref/gschemaname"/>"
    ; preference value
    <xsl:apply-templates select="$dateformats-top">
     <xsl:with-param name="curr-entry" select="."/>
    </xsl:apply-templates>
)
   </xsl:if></xsl:when>


   <xsl:when test="$curr-pref/gschematype = '(dd)'">
;; Type: pair of decimals (stored in Gconf as list of floats)
(let ((coords '()))
     <xsl:for-each select="./li">
     (set! coords (append coords '(<xsl:value-of select="./@value"/>)))
     </xsl:for-each>
     (if (> (length coords) 1)
         (gnc-prefs-set-coords
             ; preference group
             "<xsl:value-of select="$curr-pref/../gschemaid"/>"
             ; preference name
             "<xsl:value-of select="$curr-pref/gschemaname"/>"
             ; x coord
             (car coords)
             ; y coord
             (cadr coords))))
   </xsl:when>


   <xsl:when test="$curr-pref/gschematype = 'd'"><xsl:if test="./@value">
;; Gconf value (decimal): <xsl:value-of select="./@value"/>
(gnc-prefs-set-float
    ; preference group
    "<xsl:value-of select="$curr-pref/../gschemaid"/>"
    ; preference name
    "<xsl:value-of select="$curr-pref/gschemaname"/>"
    ; preference value
    <xsl:value-of select="./@value"/>
)
   </xsl:if></xsl:when>


   <xsl:when test="$curr-pref/gschematype = 'i'"><xsl:if test="./@value">
;; Gconf value (integer): <xsl:value-of select="./@value"/>
(gnc-prefs-set-int
    ; preference group
    "<xsl:value-of select="$curr-pref/../gschemaid"/>"
    ; preference name
    "<xsl:value-of select="$curr-pref/gschemaname"/>"
    ; preference value
    <xsl:value-of select="./@value"/>
)
   </xsl:if></xsl:when>


   <xsl:when test="$curr-pref/gschematype = 's2b'"><xsl:if test="./stringvalue">
;; Gconf value (string): "<xsl:value-of select="./stringvalue"/>" -> gsettings (boolean)
(let ((suffix (string-delete "<xsl:value-of select="./stringvalue"/>" #\_)))
     (gnc-prefs-set-bool
         ; preference group
         "<xsl:value-of select="$curr-pref/../gschemaid"/>"
         ; preference name
         "<xsl:value-of select="$curr-pref/gschemaname"/>"
         ; preference value
         (string-suffix? (string-append "-" suffix) "<xsl:value-of select="$curr-pref/gschemaname"/>")))
   </xsl:if></xsl:when>


   <xsl:when test="$curr-pref/gschematype = 's'"><xsl:if test="./stringvalue">
;; Gconf value (string): "<xsl:value-of select="./stringvalue"/>"
(gnc-prefs-set-string
    ; preference group
    "<xsl:value-of select="$curr-pref/../gschemaid"/>"
    ; preference name
    "<xsl:value-of select="$curr-pref/gschemaname"/>"
    ; preference value
    "<xsl:value-of select="translate(./stringvalue, $win, $mingw)"/>"
)
   </xsl:if></xsl:when>


   <xsl:when test="$curr-pref/gschematype = 'x'"><xsl:if test="./@value">
;; Gconf value (64bit integer): <xsl:value-of select="./@value"/>
(gnc-prefs-set-int64
    ; preference group
    "<xsl:value-of select="$curr-pref/../gschemaid"/>"
    ; preference name
    "<xsl:value-of select="$curr-pref/gschemaname"/>"
    ; preference value
    <xsl:value-of select="./@value"/>
)
   </xsl:if></xsl:when>
  </xsl:choose>
</xsl:template>

<xsl:template match="df:dateformats">
 <xsl:param name="curr-entry"/>
 <xsl:value-of select="key('datefmt-lookup', $curr-entry/stringvalue)/df:index"/>
</xsl:template>

<xsl:variable name="win" select="'\'" />
<xsl:variable name="mingw" select="'/'" />


<df:dateformats>
  <df:dateformat><df:name>us</df:name><df:index>0</df:index></df:dateformat>
  <df:dateformat><df:name>uk</df:name><df:index>1</df:index></df:dateformat>
  <df:dateformat><df:name>ce</df:name><df:index>2</df:index></df:dateformat>
  <df:dateformat><df:name>iso</df:name><df:index>3</df:index></df:dateformat>
  <df:dateformat><df:name>locale</df:name><df:index>4</df:index></df:dateformat>
</df:dateformats>

</xsl:stylesheet>