[c048987] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[3930460] | 2 | <!DOCTYPE stylesheet [
|
---|
[0974c32] | 3 | <!ENTITY detect-config
|
---|
| 4 | "contains(string($current-instr),'useradd') or
|
---|
| 5 | contains(string($current-instr),'groupadd') or
|
---|
| 6 | contains(string($current-instr),'usermod') or
|
---|
| 7 | contains(string($current-instr),'icon-cache') or
|
---|
| 8 | contains(string($current-instr),'desktop-database') or
|
---|
| 9 | contains(string($current-instr),'compile-schemas') or
|
---|
| 10 | contains(string($current-instr),'query-loaders') or
|
---|
| 11 | contains(string($current-instr),'pam.d') or
|
---|
| 12 | contains(string($current-instr),'/opt/rustc') or
|
---|
| 13 | contains(string($current-instr),'libQt5WebEngine') or
|
---|
[426e40b] | 14 | contains(string($current-instr),'desktop-file-edit') or
|
---|
[22abf37] | 15 | contains(string($current-instr),'.old') or
|
---|
[0974c32] | 16 | contains(string($current-instr),'query-immodules')">
|
---|
[3930460] | 17 | ]>
|
---|
[c048987] | 18 |
|
---|
| 19 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
---|
| 20 | version="1.0">
|
---|
| 21 |
|
---|
[c992876] | 22 | <!-- $Id$ -->
|
---|
[7933ed7] | 23 |
|
---|
| 24 | <xsl:template name="process-install">
|
---|
| 25 | <xsl:param name="instruction-tree"/>
|
---|
| 26 | <xsl:param name="want-stats"/>
|
---|
| 27 | <xsl:param name="root-seen"/>
|
---|
| 28 | <xsl:param name="install-seen"/>
|
---|
| 29 | <xsl:param name="test-seen"/>
|
---|
| 30 | <xsl:param name="doc-seen"/>
|
---|
[c048987] | 31 |
|
---|
[8fc6a47] | 32 | <!-- Isolate the current instruction -->
|
---|
| 33 | <xsl:variable name="current-instr" select="$instruction-tree[1]"/>
|
---|
[c048987] | 34 |
|
---|
| 35 | <xsl:choose>
|
---|
[0a0b609] | 36 | <!--============================================================-->
|
---|
[8fc6a47] | 37 | <!-- First, if we have an empty tree, close everything and exit -->
|
---|
| 38 | <xsl:when test="not($current-instr)">
|
---|
| 39 | <xsl:if test="$install-seen">
|
---|
[c048987] | 40 | <xsl:call-template name="end-install"/>
|
---|
[8fc6a47] | 41 | </xsl:if>
|
---|
| 42 | <xsl:if test="$root-seen">
|
---|
[c048987] | 43 | <xsl:call-template name="end-root"/>
|
---|
| 44 | </xsl:if>
|
---|
[8fc6a47] | 45 | <xsl:if test="$doc-seen and not($root-seen)">
|
---|
| 46 | <xsl:call-template name="end-doc">
|
---|
| 47 | <xsl:with-param name="want-stats" select="$want-stats"/>
|
---|
| 48 | </xsl:call-template>
|
---|
| 49 | </xsl:if>
|
---|
| 50 | <xsl:if test="$test-seen">
|
---|
| 51 | <xsl:call-template name="end-test">
|
---|
| 52 | <xsl:with-param name="want-stats" select="$want-stats"/>
|
---|
| 53 | </xsl:call-template>
|
---|
| 54 | </xsl:if>
|
---|
[0a0b609] | 55 | </xsl:when><!-- end empty tree -->
|
---|
| 56 | <!--============================================================-->
|
---|
[8fc6a47] | 57 | <xsl:when test="$current-instr[@role='root' and @remap='test']">
|
---|
| 58 | <xsl:if test="$install-seen">
|
---|
| 59 | <xsl:call-template name="end-install"/>
|
---|
| 60 | </xsl:if>
|
---|
| 61 | <xsl:if test="$root-seen">
|
---|
[c048987] | 62 | <xsl:call-template name="end-root"/>
|
---|
| 63 | </xsl:if>
|
---|
[8fc6a47] | 64 | <xsl:if test="$doc-seen and not($root-seen)">
|
---|
| 65 | <xsl:call-template name="end-doc">
|
---|
| 66 | <xsl:with-param name="want-stats" select="$want-stats"/>
|
---|
| 67 | </xsl:call-template>
|
---|
| 68 | </xsl:if>
|
---|
| 69 | <xsl:if test="not($test-seen)">
|
---|
| 70 | <xsl:call-template name="begin-test">
|
---|
| 71 | <xsl:with-param name="want-stats" select="$want-stats"/>
|
---|
| 72 | </xsl:call-template>
|
---|
| 73 | </xsl:if>
|
---|
| 74 | <xsl:call-template name="begin-root"/>
|
---|
[0a0b609] | 75 | <!-- We first apply mode="root" templates, and save the result in a variable -->
|
---|
| 76 | <xsl:variable name="processed-instr">
|
---|
| 77 | <xsl:apply-templates select="$current-instr" mode="root"/>
|
---|
| 78 | </xsl:variable>
|
---|
| 79 | <!-- We then process as a test instruction -->
|
---|
| 80 | <xsl:call-template name="process-test">
|
---|
| 81 | <xsl:with-param name="test-instr" select="$processed-instr"/>
|
---|
| 82 | <xsl:with-param name="want-stats" select="$want-stats"/>
|
---|
| 83 | </xsl:call-template>
|
---|
[8fc6a47] | 84 | <xsl:call-template name="process-install">
|
---|
| 85 | <xsl:with-param
|
---|
| 86 | name="instruction-tree"
|
---|
| 87 | select="$instruction-tree[position()>1]"/>
|
---|
| 88 | <xsl:with-param name="want-stats" select="$want-stats"/>
|
---|
| 89 | <xsl:with-param name="root-seen" select="boolean(1)"/>
|
---|
| 90 | <xsl:with-param name="install-seen" select="boolean(0)"/>
|
---|
| 91 | <xsl:with-param name="test-seen" select="boolean(1)"/>
|
---|
| 92 | <xsl:with-param name="doc-seen" select="boolean(0)"/>
|
---|
| 93 | </xsl:call-template>
|
---|
[0a0b609] | 94 | </xsl:when><!-- end role="root" and remap="test" -->
|
---|
| 95 | <!--============================================================-->
|
---|
[8fc6a47] | 96 | <xsl:when test="$current-instr[@role='root' and @remap='doc']">
|
---|
| 97 | <xsl:if test="$test-seen">
|
---|
| 98 | <xsl:call-template name="end-test">
|
---|
| 99 | <xsl:with-param name="want-stats" select="$want-stats"/>
|
---|
| 100 | </xsl:call-template>
|
---|
| 101 | </xsl:if>
|
---|
| 102 | <xsl:if test="$doc-seen and not($root-seen)">
|
---|
| 103 | <xsl:call-template name="end-doc">
|
---|
| 104 | <xsl:with-param name="want-stats" select="$want-stats"/>
|
---|
| 105 | </xsl:call-template>
|
---|
| 106 | </xsl:if>
|
---|
| 107 | <xsl:if test="not($root-seen)">
|
---|
[c048987] | 108 | <xsl:call-template name="begin-root"/>
|
---|
| 109 | </xsl:if>
|
---|
[8fc6a47] | 110 | <xsl:if test="not($install-seen)">
|
---|
| 111 | <xsl:call-template name="begin-install"/>
|
---|
| 112 | </xsl:if>
|
---|
[0a0b609] | 113 | <!-- We first apply mode="install" templates, and save the result in a
|
---|
| 114 | variable -->
|
---|
| 115 | <xsl:variable name="processed-instr">
|
---|
| 116 | <xsl:apply-templates select="$current-instr" mode="install"/>
|
---|
| 117 | </xsl:variable>
|
---|
| 118 | <!-- Then comment it out -->
|
---|
| 119 | <xsl:call-template name="output-comment-out">
|
---|
| 120 | <xsl:with-param name="out-string" select="$processed-instr"/>
|
---|
| 121 | </xsl:call-template>
|
---|
[8fc6a47] | 122 | <!-- The above template ends with a commented line, so that if end-install
|
---|
| 123 | adds a closing single quote, it will not be seen. Add a CR to prevent
|
---|
| 124 | that -->
|
---|
| 125 | <xsl:text>
|
---|
| 126 | </xsl:text>
|
---|
| 127 | <xsl:call-template name="process-install">
|
---|
| 128 | <xsl:with-param
|
---|
| 129 | name="instruction-tree"
|
---|
| 130 | select="$instruction-tree[position()>1]"/>
|
---|
| 131 | <xsl:with-param name="want-stats" select="$want-stats"/>
|
---|
| 132 | <xsl:with-param name="root-seen" select="boolean(1)"/>
|
---|
| 133 | <xsl:with-param name="install-seen" select="boolean(1)"/>
|
---|
| 134 | <xsl:with-param name="test-seen" select="boolean(0)"/>
|
---|
| 135 | <xsl:with-param name="doc-seen" select="boolean(1)"/>
|
---|
| 136 | </xsl:call-template>
|
---|
[0a0b609] | 137 | </xsl:when><!-- end role="root" and remap="doc" -->
|
---|
| 138 | <!--============================================================-->
|
---|
[8fc6a47] | 139 | <xsl:when test="$current-instr[@role='root']">
|
---|
[0a0b609] | 140 | <!-- We have two cases, depending on the content: either a config instruction,
|
---|
[3930460] | 141 | that we do not record with porg (first case below), or a true install
|
---|
[0a0b609] | 142 | instruction (otherwise below) -->
|
---|
[8fc6a47] | 143 | <xsl:choose>
|
---|
[0a0b609] | 144 | <!--____________________________________________________________ -->
|
---|
[3930460] | 145 | <xsl:when test="&detect-config;">
|
---|
[8fc6a47] | 146 | <xsl:if test="$install-seen">
|
---|
| 147 | <xsl:call-template name="end-install"/>
|
---|
| 148 | </xsl:if>
|
---|
| 149 | <xsl:if test="$test-seen">
|
---|
| 150 | <xsl:call-template name="end-test">
|
---|
| 151 | <xsl:with-param name="want-stats" select="$want-stats"/>
|
---|
| 152 | </xsl:call-template>
|
---|
| 153 | </xsl:if>
|
---|
| 154 | <xsl:if test="$doc-seen and not($root-seen)">
|
---|
| 155 | <xsl:call-template name="end-doc">
|
---|
| 156 | <xsl:with-param name="want-stats" select="$want-stats"/>
|
---|
| 157 | </xsl:call-template>
|
---|
| 158 | </xsl:if>
|
---|
| 159 | <xsl:if test="not($root-seen)">
|
---|
| 160 | <xsl:call-template name="begin-root"/>
|
---|
| 161 | </xsl:if>
|
---|
| 162 | <xsl:apply-templates select="$current-instr" mode="root"/>
|
---|
| 163 | <xsl:call-template name="process-install">
|
---|
| 164 | <xsl:with-param
|
---|
| 165 | name="instruction-tree"
|
---|
| 166 | select="$instruction-tree[position()>1]"/>
|
---|
| 167 | <xsl:with-param name="want-stats" select="$want-stats"/>
|
---|
| 168 | <xsl:with-param name="root-seen" select="boolean(1)"/>
|
---|
| 169 | <xsl:with-param name="install-seen" select="boolean(0)"/>
|
---|
| 170 | <xsl:with-param name="test-seen" select="boolean(0)"/>
|
---|
| 171 | <xsl:with-param name="doc-seen" select="boolean(0)"/>
|
---|
| 172 | </xsl:call-template>
|
---|
| 173 | </xsl:when><!-- end config as root -->
|
---|
[0a0b609] | 174 | <!--____________________________________________________________ -->
|
---|
[8fc6a47] | 175 | <xsl:otherwise><!-- we have a true install instruction -->
|
---|
| 176 | <xsl:if test="$test-seen">
|
---|
| 177 | <xsl:call-template name="end-test">
|
---|
| 178 | <xsl:with-param name="want-stats" select="$want-stats"/>
|
---|
| 179 | </xsl:call-template>
|
---|
| 180 | </xsl:if>
|
---|
| 181 | <xsl:if test="$doc-seen and not($root-seen)">
|
---|
| 182 | <xsl:call-template name="end-doc">
|
---|
| 183 | <xsl:with-param name="want-stats" select="$want-stats"/>
|
---|
| 184 | </xsl:call-template>
|
---|
| 185 | </xsl:if>
|
---|
| 186 | <xsl:if test="$want-stats and not($install-seen)">
|
---|
| 187 | <xsl:if test="$root-seen">
|
---|
| 188 | <xsl:call-template name="end-root"/>
|
---|
| 189 | </xsl:if>
|
---|
| 190 | <xsl:text>
|
---|
| 191 | echo Time before install: ${SECONDS} >> $INFOLOG</xsl:text>
|
---|
| 192 | <xsl:apply-templates
|
---|
| 193 | select="$instruction-tree[@role='root']/userinput"
|
---|
| 194 | mode="destdir"/>
|
---|
| 195 | <xsl:text>
|
---|
| 196 |
|
---|
| 197 | echo Time after install: ${SECONDS} >> $INFOLOG
|
---|
| 198 | echo Size after install: $(sudo du -skx --exclude home /) >> $INFOLOG
|
---|
| 199 | </xsl:text>
|
---|
| 200 | <xsl:if test="$root-seen">
|
---|
| 201 | <xsl:call-template name="begin-root"/>
|
---|
| 202 | </xsl:if>
|
---|
| 203 | </xsl:if>
|
---|
| 204 | <xsl:if test="not($root-seen)">
|
---|
| 205 | <xsl:call-template name="begin-root"/>
|
---|
| 206 | </xsl:if>
|
---|
| 207 | <xsl:if test="not($install-seen)">
|
---|
| 208 | <xsl:call-template name="begin-install"/>
|
---|
| 209 | </xsl:if>
|
---|
| 210 | <xsl:apply-templates select="$current-instr" mode="install"/>
|
---|
| 211 | <xsl:call-template name="process-install">
|
---|
| 212 | <xsl:with-param
|
---|
| 213 | name="instruction-tree"
|
---|
| 214 | select="$instruction-tree[position()>1]"/>
|
---|
| 215 | <xsl:with-param name="want-stats" select="$want-stats"/>
|
---|
| 216 | <xsl:with-param name="root-seen" select="boolean(1)"/>
|
---|
| 217 | <xsl:with-param name="install-seen" select="boolean(1)"/>
|
---|
| 218 | <xsl:with-param name="test-seen" select="boolean(0)"/>
|
---|
| 219 | <xsl:with-param name="doc-seen" select="boolean(0)"/>
|
---|
| 220 | </xsl:call-template>
|
---|
| 221 | </xsl:otherwise><!-- end true install instruction -->
|
---|
[0a0b609] | 222 | <!--____________________________________________________________ -->
|
---|
[8fc6a47] | 223 | </xsl:choose>
|
---|
| 224 | </xsl:when><!-- role="root" and no remap -->
|
---|
[0a0b609] | 225 | <!--============================================================-->
|
---|
[8fc6a47] | 226 | <xsl:when test="$current-instr[@remap='test'] or
|
---|
| 227 | $current-instr/self::command">
|
---|
| 228 | <xsl:if test="$install-seen">
|
---|
[c048987] | 229 | <xsl:call-template name="end-install"/>
|
---|
| 230 | </xsl:if>
|
---|
[8fc6a47] | 231 | <xsl:if test="$root-seen">
|
---|
[c048987] | 232 | <xsl:call-template name="end-root"/>
|
---|
| 233 | </xsl:if>
|
---|
[8fc6a47] | 234 | <xsl:if test="$doc-seen and not($root-seen)">
|
---|
| 235 | <xsl:call-template name="end-doc">
|
---|
| 236 | <xsl:with-param name="want-stats" select="$want-stats"/>
|
---|
| 237 | </xsl:call-template>
|
---|
| 238 | </xsl:if>
|
---|
| 239 | <xsl:if test="not($test-seen)">
|
---|
| 240 | <xsl:if test="not($doc-seen)">
|
---|
| 241 | <xsl:call-template name="end-make">
|
---|
| 242 | <xsl:with-param name="want-stats" select="$want-stats"/>
|
---|
| 243 | </xsl:call-template>
|
---|
[c048987] | 244 | </xsl:if>
|
---|
[8fc6a47] | 245 | <xsl:call-template name="begin-test">
|
---|
| 246 | <xsl:with-param name="want-stats" select="$want-stats"/>
|
---|
| 247 | </xsl:call-template>
|
---|
[c048987] | 248 | </xsl:if>
|
---|
[0a0b609] | 249 | <!-- We first apply normal templates, and save the result in a variable -->
|
---|
| 250 | <xsl:variable name="processed-instr">
|
---|
| 251 | <xsl:apply-templates select="$current-instr"/>
|
---|
| 252 | </xsl:variable>
|
---|
| 253 | <!-- We then process as a test instruction -->
|
---|
| 254 | <xsl:call-template name="process-test">
|
---|
| 255 | <xsl:with-param name="test-instr" select="$processed-instr"/>
|
---|
| 256 | <xsl:with-param name="want-stats" select="$want-stats"/>
|
---|
| 257 | </xsl:call-template>
|
---|
[8fc6a47] | 258 | <xsl:call-template name="process-install">
|
---|
| 259 | <xsl:with-param
|
---|
| 260 | name="instruction-tree"
|
---|
| 261 | select="$instruction-tree[position()>1]"/>
|
---|
| 262 | <xsl:with-param name="want-stats" select="$want-stats"/>
|
---|
| 263 | <xsl:with-param name="root-seen" select="boolean(0)"/>
|
---|
| 264 | <xsl:with-param name="install-seen" select="boolean(0)"/>
|
---|
| 265 | <xsl:with-param name="test-seen" select="boolean(1)"/>
|
---|
| 266 | <xsl:with-param name="doc-seen" select="boolean(0)"/>
|
---|
| 267 | </xsl:call-template>
|
---|
[0a0b609] | 268 | </xsl:when><!-- end no role, remap=test -->
|
---|
| 269 | <!--============================================================-->
|
---|
[8fc6a47] | 270 | <xsl:when test="$current-instr[@remap='doc']">
|
---|
| 271 | <xsl:if test="$install-seen">
|
---|
| 272 | <xsl:call-template name="end-install"/>
|
---|
| 273 | </xsl:if>
|
---|
| 274 | <xsl:if test="$root-seen">
|
---|
| 275 | <xsl:call-template name="end-root"/>
|
---|
| 276 | </xsl:if>
|
---|
| 277 | <xsl:if test="$test-seen">
|
---|
| 278 | <xsl:call-template name="end-test">
|
---|
| 279 | <xsl:with-param name="want-stats" select="$want-stats"/>
|
---|
| 280 | </xsl:call-template>
|
---|
| 281 | </xsl:if>
|
---|
| 282 | <xsl:if test="not($doc-seen) or $root-seen">
|
---|
| 283 | <xsl:if test="not($test-seen) and not($root-seen)">
|
---|
| 284 | <xsl:call-template name="end-make">
|
---|
| 285 | <xsl:with-param name="want-stats" select="$want-stats"/>
|
---|
| 286 | </xsl:call-template>
|
---|
[c048987] | 287 | </xsl:if>
|
---|
[8fc6a47] | 288 | <xsl:call-template name="begin-doc">
|
---|
| 289 | <xsl:with-param name="want-stats" select="$want-stats"/>
|
---|
| 290 | </xsl:call-template>
|
---|
[c048987] | 291 | </xsl:if>
|
---|
[0a0b609] | 292 | <!-- We first apply normal templates, and save the result in a variable -->
|
---|
| 293 | <xsl:variable name="processed-instr">
|
---|
| 294 | <xsl:apply-templates select="$current-instr"/>
|
---|
| 295 | </xsl:variable>
|
---|
| 296 | <!-- We then process as a doc instruction -->
|
---|
| 297 | <xsl:call-template name="process-doc">
|
---|
| 298 | <xsl:with-param name="doc-instr" select="$processed-instr"/>
|
---|
| 299 | <xsl:with-param name="want-stats" select="$want-stats"/>
|
---|
| 300 | </xsl:call-template>
|
---|
[8fc6a47] | 301 | <xsl:call-template name="process-install">
|
---|
| 302 | <xsl:with-param
|
---|
| 303 | name="instruction-tree"
|
---|
| 304 | select="$instruction-tree[position()>1]"/>
|
---|
| 305 | <xsl:with-param name="want-stats" select="$want-stats"/>
|
---|
| 306 | <xsl:with-param name="root-seen" select="boolean(0)"/>
|
---|
| 307 | <xsl:with-param name="install-seen" select="boolean(0)"/>
|
---|
| 308 | <xsl:with-param name="test-seen" select="boolean(0)"/>
|
---|
| 309 | <xsl:with-param name="doc-seen" select="boolean(1)"/>
|
---|
| 310 | </xsl:call-template>
|
---|
| 311 | </xsl:when><!-- no role, remap="doc" -->
|
---|
[0a0b609] | 312 | <!--============================================================-->
|
---|
[8fc6a47] | 313 | <xsl:otherwise><!-- no role no remap -->
|
---|
| 314 | <xsl:if test="$install-seen">
|
---|
[c048987] | 315 | <xsl:call-template name="end-install"/>
|
---|
[8fc6a47] | 316 | </xsl:if>
|
---|
| 317 | <xsl:if test="$root-seen">
|
---|
[c048987] | 318 | <xsl:call-template name="end-root"/>
|
---|
| 319 | </xsl:if>
|
---|
[8fc6a47] | 320 | <xsl:if test="$doc-seen and not($root-seen)">
|
---|
| 321 | <xsl:call-template name="end-doc">
|
---|
| 322 | <xsl:with-param name="want-stats" select="$want-stats"/>
|
---|
| 323 | </xsl:call-template>
|
---|
| 324 | </xsl:if>
|
---|
| 325 | <xsl:if test="$test-seen">
|
---|
| 326 | <xsl:call-template name="end-test">
|
---|
| 327 | <xsl:with-param name="want-stats" select="$want-stats"/>
|
---|
| 328 | </xsl:call-template>
|
---|
| 329 | </xsl:if>
|
---|
| 330 | <xsl:apply-templates select="$current-instr"/>
|
---|
| 331 | <xsl:call-template name="process-install">
|
---|
| 332 | <xsl:with-param
|
---|
| 333 | name="instruction-tree"
|
---|
| 334 | select="$instruction-tree[position()>1]"/>
|
---|
| 335 | <xsl:with-param name="want-stats" select="$want-stats"/>
|
---|
| 336 | <xsl:with-param name="root-seen" select="boolean(0)"/>
|
---|
| 337 | <xsl:with-param name="install-seen" select="boolean(0)"/>
|
---|
| 338 | <xsl:with-param name="test-seen" select="boolean(0)"/>
|
---|
| 339 | <xsl:with-param name="doc-seen" select="boolean(0)"/>
|
---|
| 340 | </xsl:call-template>
|
---|
| 341 | </xsl:otherwise><!-- no role, no remap -->
|
---|
[0a0b609] | 342 | <!--============================================================-->
|
---|
[8fc6a47] | 343 | </xsl:choose>
|
---|
| 344 | </xsl:template>
|
---|
| 345 |
|
---|
[0a0b609] | 346 | <xsl:template match="userinput" mode="install">
|
---|
[8fc6a47] | 347 | <xsl:text>
|
---|
| 348 | </xsl:text>
|
---|
[0a0b609] | 349 | <xsl:call-template name="output-install">
|
---|
[8fc6a47] | 350 | <xsl:with-param name="out-string" select="string()"/>
|
---|
| 351 | </xsl:call-template>
|
---|
| 352 | </xsl:template>
|
---|
| 353 |
|
---|
[0a0b609] | 354 | <!-- userinput templates for mode="root" and normal are in scripts.xsl -->
|
---|
[8fc6a47] | 355 |
|
---|
[0a0b609] | 356 | <xsl:template name="process-test">
|
---|
| 357 | <xsl:param name="test-instr"/>
|
---|
| 358 | <xsl:param name="want-stats"/>
|
---|
| 359 | <xsl:choose>
|
---|
| 360 | <!-- the string may begin with a linefeed -->
|
---|
| 361 | <xsl:when test="substring($test-instr,1,1)='
'">
|
---|
| 362 | <xsl:text>
|
---|
[8fc6a47] | 363 | </xsl:text>
|
---|
[0a0b609] | 364 | <xsl:call-template name="process-test">
|
---|
| 365 | <xsl:with-param name="test-instr"
|
---|
| 366 | select="substring-after($test-instr,'
')"/>
|
---|
| 367 | <xsl:with-param name="want-stats" select="$want-stats"/>
|
---|
| 368 | </xsl:call-template>
|
---|
| 369 | </xsl:when>
|
---|
| 370 | <xsl:when test="contains($test-instr,'
')">
|
---|
| 371 | <xsl:call-template name="process-test">
|
---|
| 372 | <xsl:with-param name="test-instr"
|
---|
| 373 | select="substring-before($test-instr,'
')"/>
|
---|
| 374 | <xsl:with-param name="want-stats" select="$want-stats"/>
|
---|
| 375 | </xsl:call-template>
|
---|
| 376 | <xsl:text>
|
---|
| 377 | </xsl:text>
|
---|
| 378 | <xsl:call-template name="process-test">
|
---|
| 379 | <xsl:with-param name="test-instr"
|
---|
| 380 | select="substring-after($test-instr,'
')"/>
|
---|
| 381 | <xsl:with-param name="want-stats" select="$want-stats"/>
|
---|
| 382 | </xsl:call-template>
|
---|
| 383 | </xsl:when>
|
---|
| 384 | <xsl:otherwise>
|
---|
| 385 | <xsl:if test="not($want-stats)">
|
---|
| 386 | <xsl:text>#</xsl:text>
|
---|
| 387 | </xsl:if>
|
---|
| 388 | <xsl:choose>
|
---|
| 389 | <xsl:when test="contains($test-instr,'make')
|
---|
| 390 | and not(contains($test-instr,'make -k'))">
|
---|
| 391 | <xsl:copy-of select="substring-before($test-instr,'make')"/>
|
---|
| 392 | <xsl:text>make -k</xsl:text>
|
---|
| 393 | <xsl:copy-of select="substring-after($test-instr,'make')"/>
|
---|
| 394 | </xsl:when>
|
---|
| 395 | <xsl:otherwise>
|
---|
| 396 | <xsl:copy-of select="$test-instr"/>
|
---|
| 397 | </xsl:otherwise>
|
---|
| 398 | </xsl:choose>
|
---|
| 399 | <xsl:if test="substring($test-instr,
|
---|
| 400 | string-length($test-instr),
|
---|
| 401 | 1)!='\'">
|
---|
| 402 | <xsl:if test="$want-stats">
|
---|
| 403 | <xsl:text> >> $TESTLOG 2>&1</xsl:text>
|
---|
| 404 | </xsl:if>
|
---|
| 405 | <xsl:text> || true</xsl:text>
|
---|
| 406 | </xsl:if>
|
---|
| 407 | </xsl:otherwise>
|
---|
| 408 | </xsl:choose>
|
---|
[8fc6a47] | 409 | </xsl:template>
|
---|
| 410 |
|
---|
[0a0b609] | 411 | <xsl:template name="process-doc">
|
---|
| 412 | <xsl:param name="doc-instr"/>
|
---|
| 413 | <xsl:param name="want-stats"/>
|
---|
| 414 | <xsl:choose>
|
---|
| 415 | <xsl:when test="$want-stats">
|
---|
| 416 | <xsl:copy-of select="$doc-instr"/>
|
---|
| 417 | </xsl:when>
|
---|
| 418 | <xsl:otherwise>
|
---|
| 419 | <xsl:call-template name="output-comment-out">
|
---|
| 420 | <xsl:with-param name="out-string" select="$doc-instr"/>
|
---|
| 421 | </xsl:call-template>
|
---|
| 422 | </xsl:otherwise>
|
---|
| 423 | </xsl:choose>
|
---|
[8fc6a47] | 424 | </xsl:template>
|
---|
[c048987] | 425 |
|
---|
[8fc6a47] | 426 | <xsl:template name="output-comment-out">
|
---|
[0a0b609] | 427 | <!-- Output instructions with each line commented out. -->
|
---|
[8fc6a47] | 428 | <xsl:param name="out-string"/>
|
---|
| 429 | <xsl:choose>
|
---|
[0a0b609] | 430 | <!-- the string may begin with a linefeed -->
|
---|
| 431 | <xsl:when test="substring($out-string,1,1)='
'">
|
---|
| 432 | <xsl:text>
|
---|
| 433 | </xsl:text>
|
---|
| 434 | <xsl:call-template name="output-comment-out">
|
---|
| 435 | <xsl:with-param name="out-string"
|
---|
| 436 | select="substring-after($out-string,'
')"/>
|
---|
| 437 | </xsl:call-template>
|
---|
| 438 | </xsl:when>
|
---|
[8fc6a47] | 439 | <xsl:when test="contains($out-string,'
')">
|
---|
[0a0b609] | 440 | <xsl:text>#</xsl:text>
|
---|
| 441 | <xsl:copy-of select="substring-before($out-string,'
')"/>
|
---|
[8fc6a47] | 442 | <xsl:text>
|
---|
| 443 | </xsl:text>
|
---|
| 444 | <xsl:call-template name="output-comment-out">
|
---|
[0a0b609] | 445 | <xsl:with-param name="out-string"
|
---|
| 446 | select="substring-after($out-string,'
')"/>
|
---|
[8fc6a47] | 447 | </xsl:call-template>
|
---|
| 448 | </xsl:when>
|
---|
| 449 | <xsl:otherwise>
|
---|
[0a0b609] | 450 | <xsl:text>#</xsl:text>
|
---|
| 451 | <xsl:copy-of select="$out-string"/>
|
---|
[8fc6a47] | 452 | </xsl:otherwise>
|
---|
[c048987] | 453 | </xsl:choose>
|
---|
| 454 | </xsl:template>
|
---|
| 455 |
|
---|
[8fc6a47] | 456 | <xsl:template name="end-make">
|
---|
| 457 | <xsl:param name="want-stats"/>
|
---|
| 458 | <xsl:if test="$want-stats">
|
---|
| 459 | <xsl:text>
|
---|
| 460 |
|
---|
| 461 | echo Time after make: ${SECONDS} >> $INFOLOG
|
---|
| 462 | echo Size after make: $(sudo du -skx --exclude home /) >> $INFOLOG</xsl:text>
|
---|
| 463 | </xsl:if>
|
---|
| 464 | </xsl:template>
|
---|
| 465 |
|
---|
| 466 | <xsl:template name="begin-doc">
|
---|
| 467 | <xsl:param name="want-stats"/>
|
---|
| 468 | <xsl:if test="$want-stats">
|
---|
| 469 | <xsl:text>
|
---|
| 470 | echo Time before doc: ${SECONDS} >> $INFOLOG
|
---|
| 471 | </xsl:text>
|
---|
| 472 | </xsl:if>
|
---|
| 473 | </xsl:template>
|
---|
| 474 |
|
---|
| 475 | <xsl:template name="begin-test">
|
---|
| 476 | <xsl:param name="want-stats"/>
|
---|
| 477 | <xsl:if test="$want-stats">
|
---|
| 478 | <xsl:text>
|
---|
| 479 | echo Time before test: ${SECONDS} >> $INFOLOG
|
---|
| 480 | </xsl:text>
|
---|
| 481 | </xsl:if>
|
---|
| 482 | </xsl:template>
|
---|
| 483 |
|
---|
[c048987] | 484 | <xsl:template name="begin-root">
|
---|
| 485 | <xsl:if test="$sudo='y'">
|
---|
[619b313] | 486 | <xsl:text>
|
---|
| 487 | sudo -E sh << ROOT_EOF</xsl:text>
|
---|
[c048987] | 488 | </xsl:if>
|
---|
| 489 | </xsl:template>
|
---|
| 490 |
|
---|
| 491 | <xsl:template name="begin-install">
|
---|
| 492 | <xsl:if test="$wrap-install = 'y'">
|
---|
[619b313] | 493 | <xsl:text>
|
---|
| 494 | if [ -r "$JH_PACK_INSTALL" ]; then
|
---|
[c048987] | 495 | source $JH_PACK_INSTALL
|
---|
| 496 | export -f wrapInstall
|
---|
| 497 | export -f packInstall
|
---|
| 498 | fi
|
---|
[619b313] | 499 | wrapInstall '</xsl:text>
|
---|
[c048987] | 500 | </xsl:if>
|
---|
| 501 | </xsl:template>
|
---|
| 502 |
|
---|
[8fc6a47] | 503 | <xsl:template name="end-doc">
|
---|
| 504 | <xsl:param name="want-stats"/>
|
---|
| 505 | <xsl:if test="$want-stats">
|
---|
| 506 | <xsl:text>
|
---|
| 507 |
|
---|
| 508 | echo Time after doc: ${SECONDS} >> $INFOLOG
|
---|
| 509 | echo Size after doc: $(sudo du -skx --exclude home /) >> $INFOLOG</xsl:text>
|
---|
| 510 | </xsl:if>
|
---|
| 511 | </xsl:template>
|
---|
| 512 |
|
---|
| 513 | <xsl:template name="end-test">
|
---|
| 514 | <xsl:param name="want-stats"/>
|
---|
| 515 | <xsl:if test="$want-stats">
|
---|
| 516 | <xsl:text>
|
---|
| 517 |
|
---|
| 518 | echo Time after test: ${SECONDS} >> $INFOLOG
|
---|
| 519 | echo Size after test: $(sudo du -skx --exclude home /) >> $INFOLOG</xsl:text>
|
---|
| 520 | </xsl:if>
|
---|
| 521 | </xsl:template>
|
---|
| 522 |
|
---|
[c048987] | 523 | <xsl:template name="end-root">
|
---|
| 524 | <xsl:if test="$sudo='y'">
|
---|
[619b313] | 525 | <xsl:text>
|
---|
| 526 | ROOT_EOF</xsl:text>
|
---|
[c048987] | 527 | </xsl:if>
|
---|
| 528 | </xsl:template>
|
---|
| 529 |
|
---|
| 530 | <xsl:template name="end-install">
|
---|
| 531 | <xsl:if test="$del-la-files = 'y'">
|
---|
| 532 | <xsl:call-template name="output-root">
|
---|
| 533 | <xsl:with-param name="out-string" select="$la-files-instr"/>
|
---|
| 534 | </xsl:call-template>
|
---|
| 535 | </xsl:if>
|
---|
| 536 | <xsl:if test="$wrap-install = 'y'">
|
---|
[619b313] | 537 | <xsl:text>'
packInstall</xsl:text>
|
---|
[c048987] | 538 | </xsl:if>
|
---|
| 539 | </xsl:template>
|
---|
| 540 |
|
---|
| 541 | <xsl:template name="output-install">
|
---|
| 542 | <xsl:param name="out-string" select="''"/>
|
---|
| 543 | <xsl:choose>
|
---|
[619b313] | 544 | <xsl:when test="starts-with($out-string, 'make ') or
|
---|
| 545 | contains($out-string,' make ') or
|
---|
| 546 | contains($out-string,'
make')">
|
---|
| 547 | <xsl:call-template name="output-install">
|
---|
| 548 | <xsl:with-param
|
---|
| 549 | name="out-string"
|
---|
| 550 | select="substring-before($out-string,'make ')"/>
|
---|
| 551 | </xsl:call-template>
|
---|
| 552 | <xsl:text>make -j1 </xsl:text>
|
---|
| 553 | <xsl:call-template name="output-install">
|
---|
| 554 | <xsl:with-param
|
---|
| 555 | name="out-string"
|
---|
| 556 | select="substring-after($out-string,'make ')"/>
|
---|
| 557 | </xsl:call-template>
|
---|
| 558 | </xsl:when>
|
---|
[c048987] | 559 | <xsl:when test="contains($out-string,string($APOS))
|
---|
| 560 | and $wrap-install = 'y'">
|
---|
| 561 | <xsl:call-template name="output-root">
|
---|
| 562 | <xsl:with-param
|
---|
| 563 | name="out-string"
|
---|
| 564 | select="substring-before($out-string,string($APOS))"/>
|
---|
| 565 | </xsl:call-template>
|
---|
| 566 | <xsl:text>'\''</xsl:text>
|
---|
| 567 | <xsl:call-template name="output-install">
|
---|
| 568 | <xsl:with-param name="out-string"
|
---|
| 569 | select="substring-after($out-string,string($APOS))"/>
|
---|
| 570 | </xsl:call-template>
|
---|
| 571 | </xsl:when>
|
---|
| 572 | <xsl:otherwise>
|
---|
| 573 | <xsl:call-template name="output-root">
|
---|
[aeb8539] | 574 | <xsl:with-param name="out-string" select="$out-string"/>
|
---|
[c048987] | 575 | </xsl:call-template>
|
---|
| 576 | </xsl:otherwise>
|
---|
| 577 | </xsl:choose>
|
---|
| 578 | </xsl:template>
|
---|
| 579 |
|
---|
| 580 | </xsl:stylesheet>
|
---|