Skip to content

Commit 06cbeac

Browse files
authored
Update to Moodle 5.1 new directory structure (#160)
- See #159.
1 parent 2f6db18 commit 06cbeac

File tree

3 files changed

+38
-174
lines changed

3 files changed

+38
-174
lines changed

.gitignore

Lines changed: 26 additions & 162 deletions
Original file line numberDiff line numberDiff line change
@@ -1,167 +1,31 @@
11
## Files specific to this project
22

3-
# Mac finder files and hidden folders
4-
.DS_Store
5-
63
# Node and Grunt files
74
node_modules
85

9-
## Core latex/pdflatex auxiliary files:
10-
*.aux
11-
*.lof
12-
*.log
13-
*.lot
14-
*.fls
15-
*.out
16-
*.toc
17-
*.fmt
18-
19-
## Intermediate documents:
20-
*.dvi
21-
*-converted-to.*
22-
# these rules might exclude image files for figures etc.
23-
# *.ps
24-
# *.eps
25-
# *.pdf
26-
27-
## Bibliography auxiliary files (bibtex/biblatex/biber):
28-
*.bbl
29-
*.bcf
30-
*.blg
31-
*-blx.aux
32-
*-blx.bib
33-
*.brf
34-
*.run.xml
35-
36-
## Build tool auxiliary files:
37-
*.fdb_latexmk
38-
*.synctex
39-
*.synctex.gz
40-
*.synctex.gz(busy)
41-
*.pdfsync
42-
43-
## Auxiliary and intermediate files from other packages:
44-
# algorithms
45-
*.alg
46-
*.loa
47-
48-
# achemso
49-
acs-*.bib
50-
51-
# amsthm
52-
*.thm
53-
54-
# beamer
55-
*.nav
56-
*.snm
57-
*.vrb
58-
59-
# cprotect
60-
*.cpt
61-
62-
#(e)ledmac/(e)ledpar
63-
*.end
64-
*.[1-9]
65-
*.[1-9][0-9]
66-
*.[1-9][0-9][0-9]
67-
*.[1-9]R
68-
*.[1-9][0-9]R
69-
*.[1-9][0-9][0-9]R
70-
*.eledsec[1-9]
71-
*.eledsec[1-9]R
72-
*.eledsec[1-9][0-9]
73-
*.eledsec[1-9][0-9]R
74-
*.eledsec[1-9][0-9][0-9]
75-
*.eledsec[1-9][0-9][0-9]R
76-
77-
# glossaries
78-
*.acn
79-
*.acr
80-
*.glg
81-
*.glo
82-
*.gls
83-
84-
# gnuplottex
85-
*-gnuplottex-*
86-
87-
# hyperref
88-
*.brf
89-
90-
# knitr
91-
*-concordance.tex
92-
*.tikz
93-
*-tikzDictionary
94-
95-
# listings
96-
*.lol
97-
98-
# makeidx
99-
*.idx
100-
*.ilg
101-
*.ind
102-
*.ist
103-
104-
# minitoc
105-
*.maf
106-
*.mtc
107-
*.mtc[0-9]
108-
*.mtc[1-9][0-9]
109-
110-
# minted
111-
_minted*
112-
*.pyg
113-
114-
# morewrites
115-
*.mw
116-
117-
# mylatexformat
118-
*.fmt
119-
120-
# nomencl
121-
*.nlo
122-
123-
# sagetex
124-
*.sagetex.sage
125-
*.sagetex.py
126-
*.sagetex.scmd
127-
128-
# sympy
129-
*.sout
130-
*.sympy
131-
sympy-plots-for-*.tex/
132-
133-
# pdfcomment
134-
*.upa
135-
*.upb
136-
137-
#pythontex
138-
*.pytxcode
139-
pythontex-files-*/
140-
141-
# Texpad
142-
.texpadtmp
143-
144-
# TikZ & PGF
145-
*.dpth
146-
*.md5
147-
*.auxlock
148-
149-
# todonotes
150-
*.tdo
151-
152-
# xindy
153-
*.xdy
154-
155-
# xypic precompiled matrices
156-
*.xyc
157-
158-
# WinEdt
159-
*.bak
160-
*.sav
161-
162-
# endfloat
163-
*.ttt
164-
*.fff
165-
166-
# Latexian
167-
TSWLatexianTemp*
6+
# Mac finder files and hidden folders
7+
*.DS_Store
8+
.AppleDouble
9+
.LSOverride
10+
11+
# Icon must end with two \r
12+
Icon[]
13+
14+
# Thumbnails
15+
._*
16+
17+
# Files that might appear in the root of a volume
18+
.DocumentRevisions-V100
19+
.fseventsd
20+
.Spotlight-V100
21+
.TemporaryItems
22+
.Trashes
23+
.VolumeIcon.icns
24+
.com.apple.timemachine.donotpresent
25+
26+
# Directories potentially created on remote AFP share
27+
.AppleDB
28+
.AppleDesktop
29+
Network Trash Folder
30+
Temporary Items
31+
.apdisk

bin/changepassword.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# Configuration.
2222
# Get directory of this script and Moodle source directory.
2323
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
24-
MOODLEDIR="$( echo $DIR | sed 's/\/admin.*//g' )"
24+
MOODLEDIR="$( echo $DIR | sed -E 's/(\/public)?\/admin.*//g' )"
2525
# Path of file containing the new password (plain text).
2626
FILE=${DIR%/*}/.newpassword
2727
# Set username.

bin/changewifisettings.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def do_regulatory_country():
111111
"""Regulatory country setting."""
112112
global new_country
113113
# Check if new_country is in list of ISO 3166 alpha-2 country codes.
114-
regex = re.compile(bytes('\n' + new_country + '\s', 'ascii'))
114+
regex = re.compile(bytes('\\n' + new_country + '\\s', 'ascii'))
115115
with open('/usr/share/zoneinfo/iso3166.tab') as iso3166file:
116116
data = mmap.mmap(iso3166file.fileno(), 0, access=mmap.ACCESS_READ)
117117
# Replace new_country with default_country if invalid.
@@ -171,7 +171,7 @@ def do_ssid():
171171
if not is_regex_in_file(hostapd_conf_file, r'^utf8_ssid=\b'):
172172
file_replace_line(hostapd_conf_file,
173173
'^(?P<ssid>ssid2?=(?:[0-9a-fA-F]{2}){1,32}).*$',
174-
'\g<ssid>\nutf8_ssid=1')
174+
'\\g<ssid>\nutf8_ssid=1')
175175

176176
def do_ssid_hidden_state():
177177
"""SSID hidden state setting."""
@@ -192,7 +192,7 @@ def do_ssid_hidden_state():
192192
if not is_regex_in_file(hostapd_conf_file, r'^ignore_broadcast_ssid=\b'):
193193
file_replace_line(hostapd_conf_file,
194194
'^(?P<hidden>utf8_ssid=[01]).*$',
195-
'\g<hidden>\n# Show or hide SSID\nignore_broadcast_ssid=' + ssid_hidden_state)
195+
'\\g<hidden>\n# Show or hide SSID\nignore_broadcast_ssid=' + ssid_hidden_state)
196196
else:
197197
file_replace_line(hostapd_conf_file,
198198
'ignore_broadcast_ssid=.*',
@@ -283,23 +283,23 @@ def do_ip_address():
283283
max_range = str(new_static_ip + default_max_range - 1)
284284
new_static_ip = str(new_static_ip)
285285

286-
ip_regex = "(?:10(\.(25[0-5]|2[0-4][0-9]|1[0-9]{1,2}|[0-9]{1,2})){3}|((172\.(1[6-9]|2[0-9]|3[01]))|192\.168)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{1,2}|[0-9]{1,2})){2})"
286+
ip_regex = "(?:10(\\.(25[0-5]|2[0-4][0-9]|1[0-9]{1,2}|[0-9]{1,2})){3}|((172\\.(1[6-9]|2[0-9]|3[01]))|192\\.168)(\\.(25[0-5]|2[0-4][0-9]|1[0-9]{1,2}|[0-9]{1,2})){2})"
287287
# Set IP and range in all needed files.
288288
file_replace_line(hosts_file,
289-
'^' + ip_regex + '\s+(?P<host>([a-zA-Z0-9][-a-zA-Z0-9]{0,62}\s*)+)$',
290-
new_static_ip + '\t\g<host>')
289+
'^' + ip_regex + '\\s+(?P<host>([a-zA-Z0-9][-a-zA-Z0-9]{0,62}\\s*)+)$',
290+
new_static_ip + '\\t\\g<host>')
291291
file_replace_line(nodogsplash_conf_file,
292-
'^GatewayAddress\s+' + ip_regex,
292+
'^GatewayAddress\\s+' + ip_regex,
293293
'GatewayAddress ' + new_static_ip)
294294
file_replace_line(dnsmasq_conf_file,
295-
'^address=\/home\/.*$',
295+
'^address=\\/home\\/.*$',
296296
'address=/home/' + new_static_ip)
297297
if is_networkmanager():
298298
subprocess.run(['sudo', 'nmcli', 'con', 'mod', 'WifiAP', 'ipv4.addresses', new_static_ip + '/24'])
299299
subprocess.run(['sudo', 'nmcli', 'con', 'mod', 'WifiAP', 'ipv4.gateway', new_static_ip])
300300
file_replace_line(dnsmasq_conf_file,
301301
'^dhcp-option=6,' + ip_regex + '(?P<end>.*)$',
302-
'dhcp-option=6,' + new_static_ip + '\g<end>')
302+
'dhcp-option=6,' + new_static_ip + '\\g<end>')
303303
else:
304304
file_replace_line(dhcpcd_conf_file,
305305
'^static ip_address=.*$',
@@ -309,10 +309,10 @@ def do_ip_address():
309309
'listen-address=' + new_static_ip)
310310
file_replace_line(dnsmasq_conf_file,
311311
'^dhcp-range=wifi,' + ip_regex + ',' + ip_regex + ',(?P<end>.*)$',
312-
'dhcp-range=wifi,' + min_range + ',' + max_range + ',\g<end>')
312+
'dhcp-range=wifi,' + min_range + ',' + max_range + ',\\g<end>')
313313
file_replace_line(dnsmasq_conf_file,
314314
'^dhcp-option=wifi,6,' + ip_regex + '(?P<end>.*)$',
315-
'dhcp-option=wifi,6,' + new_static_ip + '\g<end>')
315+
'dhcp-option=wifi,6,' + new_static_ip + '\\g<end>')
316316

317317
def fix_wrong_kernel_cmdline():
318318
"""Fix buggy file produced by buggy script in version 2.17.0 and 2.17.1."""

0 commit comments

Comments
 (0)