Skip to content

Commit

Permalink
VPN-6220: Fix systemd installation on Ubuntu/noble (#9186)
Browse files Browse the repository at this point in the history
* Fix systemd installation on Ubuntu/noble
* Fix some syntax warnings in xlifftool.py
  • Loading branch information
oskirby authored Feb 28, 2024
1 parent f62f50f commit 54e209d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
10 changes: 6 additions & 4 deletions linux/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ ifneq (ok,$(shell dpkg --compare-versions $(GOLANG_NATIVE_VERSION) ge 2:1.18 &&
export PATH := $(GODIR)/bin:$(PATH)
endif

CMAKE_BUILD_DIR := build-$(DEB_HOST_MULTIARCH)

%:
dh $@ --with=systemd --buildsystem=cmake+ninja --warn-missing
dh $@ --with=systemd --buildsystem=cmake+ninja --builddirectory=$(CMAKE_BUILD_DIR) --warn-missing

override_dh_auto_configure:
dh_auto_configure -- -DWEBEXT_INSTALL_LIBDIR=/lib -DBUILD_ID=$(DEB_VERSION) -DBUILD_TESTS=OFF
Expand All @@ -24,10 +26,10 @@ override_dh_installdocs:
override_dh_installinfo:

override_dh_installsystemd:
dh_installsystemd debian/mozillavpn/lib/systemd/system/mozillavpn.service
dh_installsystemd $(CMAKE_BUILD_DIR)/src/mozillavpn.service

override_dh_systemd_start:
dh_systemd_start debian/mozillavpn/lib/systemd/system/mozillavpn.service
dh_systemd_start $(CMAKE_BUILD_DIR)/src/mozillavpn.service

override_dh_systemd_enable:
dh_systemd_enable debian/mozillavpn/lib/systemd/system/mozillavpn.service
dh_systemd_enable $(CMAKE_BUILD_DIR)/src/mozillavpn.service
8 changes: 4 additions & 4 deletions scripts/utils/xlifftool.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ def render(self, trid, format=None, strip_trid=0):
# Perform variable substitution and return the transformed text.
def transform(self, text):
start = 0
ac_regex = re.compile('@[\w.]+@') ## Autoconf style match: @VARNAME@
cm_regex = re.compile('\${[\w.]+}') ## CMake style match: ${VARNAME}
qt_regex = re.compile('qtTrId("[\w.]+")') ## Qt match: qtTrId("VARNAME")
ac_regex = re.compile('@[\\w.]+@') ## Autoconf style match: @VARNAME@
cm_regex = re.compile('\\${[\\w.]+}') ## CMake style match: ${VARNAME}
qt_regex = re.compile('qtTrId\\("[\\w.]+"\\)') ## Qt match: qtTrId("VARNAME")

while start < len(text):
## Search for the first thing that we can translate
Expand All @@ -99,7 +99,7 @@ def transform(self, text):
match = cm_match
trid = cm_match.group(0)[2:-1]
elif qt_match and (qt_start < ac_start) and (qt_start < cm_start):
match = cm_match
match = qt_match
trid = qt_match.group(0)[8:-2] ## TODO: Won't handle whitespace well.
else:
break
Expand Down

0 comments on commit 54e209d

Please sign in to comment.