3 # Copyright: 2012, Colomban Wendling
4 # License: GNU GPL v2 or later
6 # Update Geany's bundled Scintilla from a given Scintilla source directory
7 # (e.g. an upstream Mercurial clone or tarball)
16 echo "USAGE: $0 SCINTILLA_SOURCE_DIRECTORY" >&2
20 # check source directory
21 if ! [ -f "$SCI_SRC"/version.txt
]; then
22 echo "'$SCI_SRC' is not a valid Scintilla source directory!" >&2
25 # check destination directory
26 if ! [ -d .git
] ||
! [ -f scintilla
/version.txt
]; then
27 echo "Please run this script from Geany's root source directory." >&2
31 # make sure destination directory is clean
32 if git status
-unormal -s scintilla |
grep '^??'; then
33 echo "Please clean scintilla directory from untracked files before." >&2
37 # copy everything from scintilla but lexers
38 cp -v "$SCI_SRC"/src
/*.cxx scintilla
/src ||
exit 1
39 cp -v "$SCI_SRC"/src
/*.h scintilla
/src ||
exit 1
40 cp -v "$SCI_SRC"/include
/*.h scintilla
/include ||
exit 1
41 cp -v "$SCI_SRC"/include
/*.iface scintilla
/include ||
exit 1
42 cp -v "$SCI_SRC"/gtk
/*.c scintilla
/gtk ||
exit 1
43 cp -v "$SCI_SRC"/gtk
/*.cxx scintilla
/gtk ||
exit 1
44 cp -v "$SCI_SRC"/gtk
/*.h scintilla
/gtk ||
exit 1
45 cp -v "$SCI_SRC"/gtk
/*.list scintilla
/gtk ||
exit 1
46 cp -v "$SCI_SRC"/lexlib
/*.cxx scintilla
/lexlib ||
exit 1
47 cp -v "$SCI_SRC"/lexlib
/*.h scintilla
/lexlib ||
exit 1
48 cp -v "$SCI_SRC"/License.txt scintilla ||
exit 1
49 cp -v "$SCI_SRC"/version.txt scintilla ||
exit 1
50 # now copy the lexers we use
51 git ls-files scintilla
/lexers
/*.cxx |
sed 's%^scintilla/%./%' |
while read f
; do
52 cp -v "$SCI_SRC/$f" "scintilla/$f" ||
exit 1
56 git apply
-p0 scintilla
/scintilla_changes.
patch ||
{
57 echo "scintilla_changes.patch doesn't apply, please update it and retry."
58 echo "Changes for the catalogue are:"
59 git
diff -p -R --src-prefix= --dst-prefix= scintilla
/src
/Catalogue.cxx |
cat
63 # show a nice success banner
64 echo "Scintilla update successful!" |
sed 'h;s/./=/g;p;x;p;x'
66 #check whether there are new files
67 if git status
-unormal -s scintilla |
grep '^??'; then
70 Untracked files above have been introduced by the new Scintilla version and
71 should be added to version control if appropriate, or removed.
73 Don't forget to add new files to the build system.
77 # check for possible changes to styles
78 if ! git
diff --quiet scintilla
/include
/SciLexer.h
; then
81 Check the diff of scintilla/include/SciLexer.h to see whether and which
82 mapping to add or update in src/highlightingmappings.h
83 (use git diff scintilla/include/SciLexer.h).
84 Don't forget to also update the comment and string styles in
92 Don't forget to add or update the appropriate line in NEWS.