Page MenuHomeMiraheze
Paste P381

Generate list of files for vmtouch (T6765)
ActivePublic

Authored by Southparkfan on Mon, Feb 8, 13:18.
#! /usr/bin/python3
import os.path
from glob import glob
files = [
'/srv/mediawiki/w/cache/databases.json'
]
l10nLangs = [
'de',
'en',
'es',
'it',
'ja',
'ko',
'nl',
'zh',
'zh-cn',
'zh-tw'
]
globFiles = [
'/etc/ssl/certs',
'/srv/mediawiki/w/cache/*wiki.json',
'/srv/mediawiki/w/extensions/*/extension.json',
'/srv/mediawiki/w/skins/*/skin.json',
'/usr/share/ca-certificates/mozilla'
]
for globFile in globFiles:
for file in glob(globFile):
if os.path.isfile(file):
files.append(file)
for lang in l10nLangs:
files.append("/srv/mediawiki/w/cache/l10n/l10n_cache-{}.cdb".format(lang))
with open('/etc/vmtouch-mediawiki-files.list', mode='wt') as filesList:
filesList.write('\n'.join(files))
filesList.write('\n')