~ubuntu-branches/ubuntu/vivid/installation-guide/vivid-proposed

« back to all changes in this revision

Viewing changes to build/preseed.awk

  • Committer: Bazaar Package Importer
  • Author(s): Frans Pop
  • Date: 2005-10-25 17:37:25 UTC
  • Revision ID: james.westby@ubuntu.com-20051025173725-aq0bm11be7bfd7rw
Tags: 20051025
* Mention in copyright that full GPL is included in the manual.
  Closes: #334925
* Register installed documents with doc-base.
* Minor updates in English text and translations.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Extract the preseeding example from appendix/example-preseed-*.xml.
 
2
# During extraction "line continuations" - that were added for improved
 
3
# readability - will be removed, rejoining the split lines.
 
4
 
 
5
# If variable lckeep is passed with value "1", line continuations are
 
6
# ignored, i.e. the lines in the example are not reformatted.
 
7
 
 
8
BEGIN {
 
9
    inexample="0"
 
10
    inseq="0"
 
11
    totline=""
 
12
}
 
13
 
 
14
# Ignore everything before the line opening the example
 
15
# Note: this assumes that <informalexample><screen> is on one line
 
16
/<informalexample.*><screen>/ {
 
17
    inexample="1"
 
18
    getline
 
19
}
 
20
 
 
21
# Ignore everything after the line closing the example
 
22
# Note: this assumes that </screen></informalexample> is on one line
 
23
/<\/screen><\/informalexample>/ {
 
24
    inexample="0"
 
25
}
 
26
 
 
27
# Handling of lines not ending with a line continuation character
 
28
! /\\[[:space:]]*$/ {
 
29
    if ( inexample == "1" ) {
 
30
        if ( lckeep == "1" ) {
 
31
            print $0
 
32
        } else {
 
33
            if ( inseq == "1" ) {
 
34
                sub(/^[[:space:]]*/, "")
 
35
                sub(/^#[[:space:]]*/, "")
 
36
            }
 
37
            totline = totline $0
 
38
 
 
39
            print totline
 
40
            totline=""
 
41
            inseq="0"
 
42
        }
 
43
    }
 
44
}
 
45
 
 
46
# Handling of lines ending with a line continuation character
 
47
/\\[[:space:]]*$/ {
 
48
    if ( inexample == "1" ) {
 
49
        if ( lckeep == "1" ) {
 
50
            print $0
 
51
        } else {
 
52
            if ( inseq == "1" ) {
 
53
                sub(/^[[:space:]]*/, "")
 
54
                sub(/^#[[:space:]]*/, "")
 
55
            }
 
56
            inseq="1"
 
57
            gsub(/[[:space:]]*\\[[:space:]]*$/, " ")
 
58
            totline = totline $0
 
59
        }
 
60
    }
 
61
}