Browse Source

fix master branch

master
Claudio Luck 6 months ago
parent
commit
158b714450
11 changed files with 240 additions and 99 deletions
  1. +10
    -4
      .drone.yml
  2. +39
    -16
      GNUmakefile
  3. +126
    -56
      locale/de/LC_MESSAGES/tb_setup.po
  4. +4
    -2
      pEp_Thunderbird_Setup.desktop
  5. +2
    -0
      parts/pEp_Thunderbird_Setup.desktop
  6. +19
    -12
      plat/lnx/pEp_install.sh
  7. +33
    -3
      src/tb_setup.cc
  8. +1
    -0
      src/tb_setup.h
  9. +3
    -3
      src/wx_setup_win.cpp
  10. +2
    -2
      src/wx_setup_win.fbp
  11. +1
    -1
      src/wx_setup_win.h

+ 10
- 4
.drone.yml View File

@ -61,7 +61,9 @@ steps:
commands:
- /install/bin/wx-config --static --cppflags
- /install/bin/wx-config --static --libs
- _ver_mk=$$(awk '$1 == "VERSION" {print $3}' GNUmakefile)
# - awk '$1 == "VERSION" {print $3}' GNUmakefile)
- make print-versions
- _ver_mk=$$(make print-version 2>/dev/null)
# For variant version numbers see https://dev.pep.security/thunderbird/releases
# also update the build image (build-image/master branch), and
# matching git submodule contrib/pEp/pEpLinuxBuilder
@ -71,9 +73,13 @@ steps:
# - export _pEp4Tb_manifest_ver=$$(python3 -c 'import json;from zipfile import ZipFile; v=json.loads(ZipFile("plat/lnx/pEp4Tb@pEp.security.xpi", "r").__enter__().read("manifest.json"));print(v["version"])')
- export _pEp4Tb_rel=$$(git --git-dir .git/modules/contrib/pEp/pEpForThunderbird describe --tags)
- export _variant=unrel_$${_pEp4Tb_manifest_ver}
- "cp -f /install/bin/pEp-mini-json-adapter-local plat/lnx/pEp-mini-json-adapter-local 2>/dev/null || true"
- "cp -f plat/lnx/pEp-mini-json-adapter-local plat/lnx/pEp-mini-json-adapter.user 2>/dev/null || true"
- "cp -f /install/bin/pEp-mini-json-adapter plat/lnx/pEp-mini-json-adapter 2>/dev/null || true"
- "echo 'TODO/Temp: -local and non-local are swapped due to BUG in build image'"
#- "cp -f /install/bin/pEp-mini-json-adapter-local plat/lnx/pEp-mini-json-adapter-local 2>/dev/null || true"
#- "cp -f plat/lnx/pEp-mini-json-adapter-local plat/lnx/pEp-mini-json-adapter.user 2>/dev/null || true"
#- "cp -f /install/bin/pEp-mini-json-adapter plat/lnx/pEp-mini-json-adapter 2>/dev/null || true"
- "cp -f /install/bin/pEp-mini-json-adapter-local plat/lnx/pEp-mini-json-adapter 2>/dev/null || true"
- "cp -f /install/bin/pEp-mini-json-adapter plat/lnx/pEp-mini-json-adapter-user 2>/dev/null || true"
- "cp -f plat/lnx/pEp-mini-json-adapter-user plat/lnx/pEp-mini-json-adapter.user 2>/dev/null || true"
- make OS=lnx VARIANT="$${_variant}" pEp4Tb_release="$${_pEp4Tb_rel}" VERSION="$${_ver}" download-parts
- "[ ! -e plat/lnx/tb_setup ] || touch plat/lnx/tb_setup"
- "[ -e plat/lnx/tb_setup ] || CPPFLAGS=-L/install/lib make -C src all STATIC=yes wx_config=/install/bin/wx-config"


+ 39
- 16
GNUmakefile View File

@ -4,7 +4,11 @@ space := ${null} ${null}
# You may override these variables in a CI or custom build:
#
VERSION := 2.2.0-RC.2
ifeq ($(wildcard .git/refs/tags/*),)
VERSION := 2.2.0-RC.6
else
VERSION := $(shell git describe --tags | sed -e 's/^[^0-9][^_]*_//g')
endif
VERSION_XYZ := $(firstword $(subst -, ,$(VERSION)))
VERSION_XY := $(subst $(space),.,$(wordlist 1,2,$(subst ., ,$(VERSION_XYZ))))
#
@ -57,6 +61,8 @@ bundle_tgz := dist/pEp_Setup_Thunderbird_$(BUNDLE_VER_TAG).tgz
pEp_import_SRC = $(wildcard contrib/pEp/ImportFromEnigmail/*.py)
src_FILES = $(wildcard src/*.cc)
part_FILES = system.db \
pEp-mini-json-adapter.desktop \
pEp-mini-json-adapter.service \
@ -74,7 +80,7 @@ plat_FILES = pEp_install.sh \
tb_setup
po_LANG = en de
mo_FILES = $(patsubst %,po/%/LC_MESSAGES/tb_setup.mo,$(po_LANG))
mo_FILES = $(patsubst %,locale/%/LC_MESSAGES/tb_setup.mo,$(po_LANG))
ifeq ($(OS),lnx)
Py_dist_FILES = $(wildcard plat/lnx/Python/lib/python2.7/*.py) \
@ -111,6 +117,15 @@ bundle_DESTS = $(patsubst %,$(SETUPDIR)/%,$(BIN_PARTFILES)) \
$(patsubst %,$(SETUPDIR)/%,$(mo_FILES)) \
$(patsubst %,$(DISTDIR)/pEp_Setup_Thunderbird/%,$(Root_FILES))
print-version:
-@echo $(VERSION)
print-versions:
@echo Version: $(VERSION)
@echo Version X.Y: $(VERSION_XY)
@echo Version X.Y.Z: $(VERSION_XYZ)
@echo Binary ref: $(BINARY_DL_VER)
bundle_zip_layout:
mkdir -p $(SETUPDIR) $(SETUPDIR)/Import
@ -120,7 +135,7 @@ $(SETUPDIR):
bundle_layout: $(SETUPDIR) $(bundle_zip_layout) $(bundle_DESTS)
sed -i.bak \
-e 's/^X-pEp-MDA-Version=.*$$/X-pEp-MDA-Version=$(VERSION)/' \
-e 's/^X-pEp-MDA-OS=.*$$/X-pEp-MDA-OSn=$(OS)/' \
-e 's/^X-pEp-MDA-OS=.*$$/X-pEp-MDA-OS=$(OS)/' \
-e 's/^X-pEp-MDA-Variant=.*$$/X-pEp-MDA-Variant=$(VARIANT)/' \
-e 's/^X-pEp-MDA-Platform=.*$$/X-pEp-MDA-Platform=$(PLAT)/' \
$(DISTDIR)/pEp_Setup_Thunderbird/pEp_Thunderbird_Setup.desktop
@ -192,7 +207,7 @@ $(patsubst %,$(DISTDIR)/pEp_Setup_Thunderbird/%,$(Root_FILES)):
cp -Hf $(patsubst $(DISTDIR)/pEp_Setup_Thunderbird/%,plat/$(VARIANT)/$(OS)/%,$@) $@ || \
cp -Hf $(patsubst $(DISTDIR)/pEp_Setup_Thunderbird/%,plat/$(OS)/%,$@) $@
$(patsubst %,$(SETUPDIR)/%,$(mo_FILES)): $(mo_FILES)
$(SETUPDIR)/locale/%/LC_MESSAGES/tb_setup.mo: locale/%/LC_MESSAGES/tb_setup.mo
echo $$(dirname "$@")
mkdir -p $$(dirname "$@")
cp -f $^ $@
@ -251,28 +266,36 @@ download-parts:
# curl -L $(PARTS_HOST)/parts/tb_setup > plat/lnx/tb_setup
# chmod 755 plat/lnx/tb_setup
update-pot: po/tb_setup.pot
update-pot: locale/tb_setup.pot
po/tb_setup.pot:
xgettext -d tb_setup -s --keyword=_ -p ./po -o tb_setup.pot --from-code=utf-8 \
$$(find ./src -name '*.cc' -print)
xgettext -d tb_setup -s -L Shell --keyword --keyword=tr -p ./po -o tb_setup.pot --from-code=utf-8 -j \
locale/tb_setup.pot: $(src_FILES) ./plat/lnx/pEp_install.sh ./plat/lnx/pEp_import.sh
xgettext -d tb_setup -s --keyword=_ -p ./locale -o tb_setup.pot --from-code=utf-8 $(src_FILES)
xgettext -d tb_setup -s -L Shell --keyword --keyword=tr -p ./locale -o tb_setup.pot --from-code=utf-8 -j \
./plat/lnx/pEp_install.sh \
./plat/lnx/pEp_import.sh
sed -i.bak 's/charset=CHARSET/charset=UTF-8/g' ./po/tb_setup.pot
-@rm -f ./po/tb_setup.pot.bak
sed -i.bak 's/charset=CHARSET/charset=UTF-8/g' ./locale/tb_setup.pot
-@rm -f ./locale/tb_setup.pot.bak
update-po: $(patsubst %,po/%/LC_MESSAGES/tb_setup.po,$(po_LANG))
update-po: $(patsubst %,locale/%/LC_MESSAGES/tb_setup.po,$(po_LANG))
$(patsubst %,po/%/LC_MESSAGES/tb_setup.po,$(po_LANG)): po/tb_setup.pot
$(patsubst %,locale/%/LC_MESSAGES/tb_setup.po,$(po_LANG)): locale/tb_setup.pot
if [ ! -e $@ ] ; then cp -f $^ $@ ; fi
-sed -i.bak 's/charset=CHARSET/charset=UTF-8/g' $@
if grep -q charset=CHARSET $@ ; then sed -i.bak 's/charset=CHARSET/charset=UTF-8/g' $@ ; fi
-@rm -f $@.bak
msgmerge -U $@ $^
update-mo: $(patsubst %,po/%/LC_MESSAGES/tb_setup.mo,$(po_LANG))
merge-translations:
set -e ; TD=$$(mktemp -d) ; \
git --git-dir="$$MAKEDIR/.git" --work-tree "$$TD" checkout translations -- locale/ ; \
for PO in $$(git --git-dir="$$MAKEDIR/.git" ls-files \*.po) ; do \
msgmerge -U "$$TD/$$PO" "$$MAKEDIR/$$PO" && \
msgmerge -U "$$MAKEDIR/$$PO" "$$TD/$$PO" ; \
done ; \
rm -rf "$$TD"
update-mo: $(patsubst %,locale/%/LC_MESSAGES/tb_setup.mo,$(po_LANG))
po/%/LC_MESSAGES/tb_setup.mo: po/%/LC_MESSAGES/tb_setup.po
locale/%/LC_MESSAGES/tb_setup.mo: locale/%/LC_MESSAGES/tb_setup.po
msgfmt -o $@ $^
-include GNUmakefile.local


+ 126
- 56
locale/de/LC_MESSAGES/tb_setup.po View File

@ -3,146 +3,216 @@
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-03-02 13:53+0100\n"
"PO-Revision-Date: 2021-04-06 08:22+0000\n"
"Last-Translator: Andy <aw@pep.security>\n"
"Language-Team: German <http://translate.pep.security/projects/pep-software/"
"pep4thunderbird-linux/de/>\n"
"Language: de\n"
"POT-Creation-Date: 2021-04-07 20:38+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.3.2\n"
#: /tb_setup.cc:95
#: src/tb_setup.cc:100
msgid "*.desktop file"
msgstr "*.desktop Datei"
msgstr "*.desktop-Datei"
#: /wx_setup_win.cc:105
#: plat/lnx/pEp_import.sh:33
msgid "A prerequisite (Python 2.7) was not found on this system."
msgstr "Eine Abhängigkeit (Python 2.7) wurde auf dem System nicht gefunden."
#: plat/lnx/pEp_install.sh:106 plat/lnx/pEp_install.sh:154
msgid "Activating systemd unit..."
msgstr "Aktiviere systemd-Einheit..."
#: src/wx_setup_win.cc:105
msgid "Administrative passwort required:"
msgstr "Administratives Passwort benötigt:"
msgstr "Administrationskennwort notwendig:"
#: /tb_setup.cc:503
#: src/tb_setup.cc:576
msgid "Calling: "
msgstr ""
msgstr "Wird ausgeführt:"
#: /tb_setup.cc:151
#: src/tb_setup.cc:159
msgid "Can't load"
msgstr ""
msgstr "Kann nicht laden"
#: /tb_setup.cc:200
#: src/tb_setup.cc:233
msgid "Can't load language"
msgstr ""
msgstr "Kann Sprache nicht laden"
#: /wx_setup_win.cc:149
#: src/wx_setup_win.cc:149
msgid "Close"
msgstr "Schliessen"
#: /wx_setup_win.cc:114
#: src/tb_setup.cc:460 src/tb_setup.cc:491 src/tb_setup.cc:510
msgid "Command failed with exit code"
msgstr "Befehl mit Fehlerrückgabewert beendet"
#: plat/lnx/pEp_install.sh:162
msgid "Completed"
msgstr "Fertig"
#: plat/lnx/pEp_install.sh:101
msgid "Configure system-installed adapter for user"
msgstr "Konfiguration des systemweit installierten Adapters für diesen Anwender"
#: plat/lnx/pEp_install.sh:149
msgid "Configure user-local adapter for user"
msgstr "Konfiguration des ins Anwendungsverzeichnis installierten Adapters für diesen Anwender"
#: src/wx_setup_win.cc:114
msgid "Continue"
msgstr ""
msgstr "Weiter"
#: /tb_setup.cc:140
#: src/tb_setup.cc:148
msgid "Given invalid path for XDG file"
msgstr ""
msgstr "Ungültiger Pfad für XDG-Datei übergeben"
#: plat/lnx/pEp_install.sh:73
msgid "Install adapter to system"
msgstr "Installiere Adapter systemweit"
#: plat/lnx/pEp_install.sh:115
msgid "Install adapter to user profile"
msgstr "Installiere Adapter ins Anwendungsverzeichnis"
#: /wx_setup_win.cc:79
#: src/wx_setup_win.cc:79
msgid "Install location for the adapter"
msgstr ""
msgstr "Installationsart des Anwender"
#: plat/lnx/pEp_install.sh:53
msgid "Installing:"
msgstr "Installiere:"
#: /wx_setup_win.cc:83
#: src/wx_setup_win.cc:83
msgid "Last used"
msgstr ""
msgstr "Zuletzt gebraucht"
#: /tb_setup.cc:484
#: src/tb_setup.cc:555
msgid "No utility for privilege escalation found"
msgstr ""
msgstr "Kein Werkzeuch für Privilegieneskalation gefunden"
#: /wx_setup_win.cc:152
#: src/wx_setup_win.cc:152
msgid "Start installation"
msgstr ""
msgstr "Beginne Installation"
#: plat/lnx/pEp_install.sh:104 plat/lnx/pEp_install.sh:152
msgid "Starting adapters..."
msgstr "Starte Adapter..."
#: plat/lnx/pEp_install.sh:62
msgid "Starting the adapter"
msgstr "Der Adapter startet"
#: plat/lnx/pEp_install.sh:102 plat/lnx/pEp_install.sh:150
msgid "Stopping adapters..."
msgstr "Der Adapter stoppt"
#: /wx_setup_win.cc:77
#: src/wx_setup_win.cc:77
msgid "System"
msgstr "System"
#: plat/lnx/pEp_install.sh:117
msgid "This installer does not contain the user variant of the adapter"
msgstr ""
#: /wx_setup_win.cc:70
#: src/wx_setup_win.cc:70
msgid "This installer will setup pEp for Thunderbird for the current user."
msgstr ""
msgstr "Dieser Installer setzt pEp für Thunderbird für den aktuellen Anwender auf."
#: /wx_setup_win.cc:85
#: src/wx_setup_win.cc:85
msgid "Thunderbird profile"
msgstr ""
msgstr "Thunderbird-Profil"
#: /wx_setup_win.cc:157
#: src/wx_setup_win.cc:157
msgid "Uninstall"
msgstr ""
msgstr "Entfernen"
#: /wx_setup_win.cc:77
#: plat/lnx/pEp_install.sh:21
msgid "Usage:"
msgstr "Gebrauch:"
#: src/wx_setup_win.cc:77
msgid "User environment"
msgstr ""
msgstr "Anwenderumgebung"
#: plat/lnx/pEp_install.sh:98 plat/lnx/pEp_install.sh:147
msgid "Warning:"
msgstr "Warnung:"
#: plat/lnx/pEp_install.sh:91
msgid "Warning: /etc/systemd/user not present, can not install systemd unit"
msgstr "Warnung: /etc/systemd/user ist nicht vorhanden, systemd Einheit kann nicht installiert werden"
#: /wx_setup_win.cc:38
#: src/wx_setup_win.cc:38
msgid "Welcome to the pEp for Thunderbird Installer"
msgstr ""
msgstr "Willkommen beim Installer für pEp für Thunderbird"
#: /tb_setup.cc:83
#: src/tb_setup.cc:88
msgid "adapter package operating system to install"
msgstr ""
#: /tb_setup.cc:80
#: src/tb_setup.cc:85
msgid "adapter package platform to install"
msgstr ""
#: /tb_setup.cc:86
#: src/tb_setup.cc:91
msgid "adapter package variant"
msgstr ""
#: /tb_setup.cc:77
#: src/tb_setup.cc:82
msgid "adapter package version to install"
msgstr ""
#: /tb_setup.cc:62
#: src/tb_setup.cc:64
msgid "default to install to user profile instead of system location"
msgstr ""
#: /tb_setup.cc:53
#: src/tb_setup.cc:55
msgid "displays this help"
msgstr ""
#: /tb_setup.cc:56
#: src/tb_setup.cc:58
msgid "displays uninstall button"
msgstr ""
#: /tb_setup.cc:71
#: src/tb_setup.cc:76
msgid "internal data import script"
msgstr ""
#: /tb_setup.cc:65
#: src/tb_setup.cc:67
msgid "internal install script"
msgstr ""
#: /tb_setup.cc:68
#: src/tb_setup.cc:70
msgid "internal install script base directory"
msgstr ""
#: /tb_setup.cc:92
#: src/tb_setup.cc:73
msgid "internal locale directory"
msgstr "interner locale-Ordner"
#: src/tb_setup.cc:97
msgid "language"
msgstr ""
#: /tb_setup.cc:74
#: plat/lnx/pEp_install.sh:98 plat/lnx/pEp_install.sh:147
msgid "not present, can not install autostart entry"
msgstr ""
#: src/tb_setup.cc:79
msgid "profile directory to install to"
msgstr ""
#: /tb_setup.cc:59
#: src/tb_setup.cc:61
msgid "skip data migration step"
msgstr ""
#: /tb_setup.cc:89
#: src/tb_setup.cc:94
msgid "unattended start and close"
msgstr ""

+ 4
- 2
pEp_Thunderbird_Setup.desktop View File

@ -17,8 +17,10 @@ Icon=mail-replied
Exec=sh -c '"$(dirname "%k")/.Setup/tb_setup" "%k"'
X-pEp-Exec=.Setup/pEp_install.sh
X-pEp-Import-Exec=.Setup/pEp_import.sh
X-pEp-Locale-Dir=.Setup/locale
# X-pEp-Language=de_DE
X-pEp-MDA-Version=2.0.7
X-pEp-MDA-Platform=x86_64
X-pEp-MDA-OSn=lnx
X-pEp-MDA-OS=lnx
X-pEp-MDA-Variant=tb
X-pEp-Prefer-User-Install=no
X-pEp-Prefer-User-Install=yes

+ 2
- 0
parts/pEp_Thunderbird_Setup.desktop View File

@ -19,6 +19,8 @@ Icon=mail-replied
Exec=sh -c '.Setup/tb_setup "%k"'
X-pEp-Exec=.Setup/pEp_install
X-pEp-Import-Exec=.Setup/pEp_import
X-pEp-Locale-Dir=.Setup/locale
# X-pEp-Language=de_DE
X-pEp-MDA-Version=2.0.12
X-pEp-MDA-Platform=
X-pEp-MDA-OS=


+ 19
- 12
plat/lnx/pEp_install.sh View File

@ -66,14 +66,16 @@ _start_adapter () {
}
systemd_init_pid=$(pidof -s /sbin/init 2>/dev/null || echo 0)
systemctl_cmd=$(which systemctl 2>/dev/null || : )
adapter_bin=""
if [ $user_inst -eq 0 ] ; then
_uid=$(id -u)
if [ $_uid -eq 0 ] ; then
_section $(tr "Install adapter to system")
adapter_bin="/usr/local/bin/pEp-mini-json-adapter"
_install 0555 root:0 \
"${SETUP_DIR}/pEp-mini-json-adapter" \
"/usr/local/bin/pEp-mini-json-adapter"
"$adapter_bin"
_install 0555 root:0 \
"${SETUP_DIR}/pEp-mini-json-adapter-wrapper" \
"/usr/local/bin/pEp-mini-json-adapter-wrapper"
@ -103,11 +105,13 @@ if [ $user_inst -eq 0 ] ; then
pkill pEp-mini-json-adapter || true
_info $(tr "Starting adapters...")
if [ -f /etc/systemd/user/pEp-mini-json-adapter.service ] ; then
_info $(tr "Activating systemd unit...")
systemctl --user daemon-reload
systemctl --user stop pEp-mini-json-adapter.service 2>/dev/null || true
systemctl --user enable pEp-mini-json-adapter.service
systemctl --user start pEp-mini-json-adapter.service
if [ -n "$systemctl_cmd" ] ; then
_info $(tr "Activating systemd unit...")
$systemctl_cmd --user daemon-reload
$systemctl_cmd --user stop pEp-mini-json-adapter.service 2>/dev/null || true
$systemctl_cmd --user enable pEp-mini-json-adapter.service
$systemctl_cmd --user start pEp-mini-json-adapter.service
fi
fi
_start_adapter
fi
@ -121,9 +125,10 @@ else
bin_prefix=$HOME/.local/bin
etc_xdg_prefix=${XDG_CONFIG_HOME:-$HOME/.config}
umask 0027
adapter_bin="${bin_prefix}/pEp-mini-json-adapter"
_install 0555 "" \
"${SETUP_DIR}/pEp-mini-json-adapter.user" \
"${bin_prefix}/pEp-mini-json-adapter"
"$adapter_bin"
_install 0555 "" \
"${SETUP_DIR}/pEp-mini-json-adapter-wrapper" \
"${bin_prefix}/pEp-mini-json-adapter-wrapper"
@ -151,11 +156,13 @@ else
pkill pEp-mini-json-adapter || true
_info $(tr "Starting adapters...")
if [ -f "${etc_xdg_prefix}/systemd/user/pEp-mini-json-adapter.service" ] ; then
_info $(tr "Activating systemd unit...")
systemctl --user daemon-reload
systemctl --user stop pEp-mini-json-adapter.service 2>/dev/null || true
systemctl --user enable pEp-mini-json-adapter.service
systemctl --user start pEp-mini-json-adapter.service
if [ -n "$systemctl_cmd" ] ; then
_info $(tr "Activating systemd unit...")
$systemctl_cmd --user daemon-reload
$systemctl_cmd --user stop pEp-mini-json-adapter.service 2>/dev/null || true
$systemctl_cmd --user enable pEp-mini-json-adapter.service
$systemctl_cmd --user start pEp-mini-json-adapter.service
fi
fi
_start_adapter
fi


+ 33
- 3
src/tb_setup.cc View File

@ -36,6 +36,7 @@ wxIMPLEMENT_APP(TbSetupApp);
#define PEP_TBSETUP_OPT_SCRIPT "script"
#define PEP_TBSETUP_OPT_SCRIPT_BASE "script-base"
#define PEP_TBSETUP_OPT_LOCALE_DIR "locale-dir"
#define PEP_TBSETUP_OPT_SKIP_IMPORT "no-migration"
#define PEP_TBSETUP_OPT_IMPORT_SCRIPT "import-script"
#define PEP_TBSETUP_OPT_WITH_UNINSTALL "with-uninstall"
@ -68,6 +69,9 @@ static const wxCmdLineEntryDesc g_cmdLineDesc [] =
{ wxCMD_LINE_OPTION, "b", PEP_TBSETUP_OPT_SCRIPT_BASE,
_("internal install script base directory"),
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL },
{ wxCMD_LINE_OPTION, NULL, PEP_TBSETUP_OPT_LOCALE_DIR,
_("internal locale directory"),
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL },
{ wxCMD_LINE_OPTION, "I", PEP_TBSETUP_OPT_IMPORT_SCRIPT,
_("internal data import script"),
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL },
@ -108,6 +112,7 @@ bool TbSetupApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
wxString s;
bool script_base_explicit;
bool locale_dir_explicit;
m_opt_with_uninstall = parser.Found(PEP_TBSETUP_OPT_WITH_UNINSTALL);
m_opt_prefer_user_install = parser.Found(PEP_TBSETUP_OPT_USER_INSTALL);
@ -118,6 +123,8 @@ bool TbSetupApp::OnCmdLineParsed(wxCmdLineParser& parser)
m_opt_import_script = Abspath( s.ToStdString().c_str() );
if ((script_base_explicit = parser.Found(PEP_TBSETUP_OPT_SCRIPT_BASE, &s)))
m_opt_script_base = Abspath( s.ToStdString().c_str() );
if ((locale_dir_explicit = parser.Found(PEP_TBSETUP_OPT_LOCALE_DIR, &s)))
m_opt_locale_dir = Abspath( s.ToStdString().c_str() );
if (parser.Found(PEP_TBSETUP_OPT_ADAP_PKG_VER, &s))
m_opt_adapter_package_ver = s.ToStdString();
if (parser.Found(PEP_TBSETUP_OPT_ADAP_PKG_PLAT, &s))
@ -160,11 +167,14 @@ bool TbSetupApp::OnCmdLineParsed(wxCmdLineParser& parser)
string xdg_mda_plat = reader.Get("Desktop Entry", "X-pEp-MDA-Platform", "");
string xdg_mda_os = reader.Get("Desktop Entry", "X-pEp-MDA-OS", "");
string xdg_mda_varia = reader.Get("Desktop Entry", "X-pEp-MDA-Variant", "");
string xdg_mda_lang = reader.Get("Dekstop Entry", "X-pEp-Language", "");
string xdg_mda_lang = reader.Get("Desktop Entry", "X-pEp-Language", "");
string xdg_locale_dir = reader.Get("Desktop Entry", "X-pEp-Locale-Dir", "");
m_opt_prefer_user_install = xdg_pref_user;
if (!script_base_explicit)
m_opt_script_base = Dirname( m_opt_xdg.c_str() );
if (!locale_dir_explicit && xdg_locale_dir.length())
m_opt_locale_dir = xdg_locale_dir;
if (xdg_script.length())
m_opt_script = m_opt_script_base + "/" + xdg_script.c_str();
if (xdg_imp_script.length())
@ -190,6 +200,26 @@ bool TbSetupApp::OnCmdLineParsed(wxCmdLineParser& parser)
m_opt_script = m_opt_script_base + "/pEp_install.sh";
if (!m_opt_import_script.length())
m_opt_import_script = m_opt_script_base + "/pEp_import.sh";
if (!m_opt_locale_dir.length())
m_opt_locale_dir = m_opt_script_base + "/locale";
m_opt_locale_dir = Abspath( m_opt_locale_dir.c_str() );
// Tests show that MUSL ignores LC_ALL/LANG environment variables.
// Also, MUSL folks think there is no need for a ifdef __MUSL__...
#ifndef __GLIBC__
if (!m_opt_language.length())
{
if (getenv("LANG"))
m_opt_language = string(getenv("LANG"));
else if (getenv("LC_ALL"))
m_opt_language = string(getenv("LC_ALL"));
if (m_opt_language.length())
{
stringstream m_opt_language_tokens(m_opt_language);
getline(m_opt_language_tokens, m_opt_language, '.');
}
}
#endif
if (m_locale)
wxDELETE(m_locale);
@ -205,8 +235,8 @@ bool TbSetupApp::OnCmdLineParsed(wxCmdLineParser& parser)
}
m_locale = new wxLocale(langinfo->Language, wxLOCALE_LOAD_DEFAULT);
}
m_locale->AddCatalogLookupPathPrefix( // <script-base>/po/<lang>/LC_MESSAGES/*.mo
(wxString(m_opt_script_base) + wxFileName::GetPathSeparator() + "po"));
// <script-base>/locale/ + ./<lang>/LC_MESSAGES/<catalog>.mo
m_locale->AddCatalogLookupPathPrefix(wxString(m_opt_locale_dir.c_str()));
m_locale->AddCatalog("tb_setup");
chdir(m_opt_script_base.c_str());


+ 1
- 0
src/tb_setup.h View File

@ -27,6 +27,7 @@ protected:
string m_opt_script = "";
string m_opt_import_script = "";
string m_opt_script_base = "";
string m_opt_locale_dir = "";
string m_opt_tb_profile_dir = "";
bool m_opt_do_not_import = false;
bool m_import_script_pending = false;


+ 3
- 3
src/wx_setup_win.cpp View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// C++ code generated with wxFormBuilder (version Apr 9 2021)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -35,7 +35,7 @@ WelcomeWindowBase::WelcomeWindowBase( wxWindow* parent, wxWindowID id, const wxS
bSizer57->Add( 0, 0, 1, wxEXPAND, 5 );
m_staticText23 = new wxStaticText( m_panel4, wxID_ANY, _("Welcome to the pEp for Thunderbird Installer"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText23 = new wxStaticText( m_panel4, wxID_ANY, _("Welcome to the p≡p for Thunderbird Installer"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText23->Wrap( -1 );
m_staticText23->SetForegroundColour( wxColour( 255, 255, 255 ) );
@ -67,7 +67,7 @@ WelcomeWindowBase::WelcomeWindowBase( wxWindow* parent, wxWindowID id, const wxS
bSizer48->Add( bSizer50, 1, wxEXPAND, 5 );
m_staticText24 = new wxStaticText( this, wxID_ANY, _("This installer will setup pEp for Thunderbird for the current user."), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText24 = new wxStaticText( this, wxID_ANY, _("This installer will setup pp for Thunderbird for the current user."), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText24->Wrap( -1 );
bSizer48->Add( m_staticText24, 0, wxALL, 5 );


+ 2
- 2
src/wx_setup_win.fbp View File

@ -189,7 +189,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Welcome to the pEp for Thunderbird Installer</property>
<property name="label">Welcome to the p≡p for Thunderbird Installer</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
@ -298,7 +298,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">This installer will setup pEp for Thunderbird for the current user.</property>
<property name="label">This installer will setup pp for Thunderbird for the current user.</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>


+ 1
- 1
src/wx_setup_win.h View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// C++ code generated with wxFormBuilder (version Apr 9 2021)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!


Loading…
Cancel
Save