Removed GNU sed usage, using patches instead.

This commit is contained in:
Bert van der Weerd 2021-03-29 23:38:57 +02:00
parent 21abdd645d
commit f038bdebb7
No known key found for this signature in database
GPG key ID: 4CFABB96ADE0F5B1
6 changed files with 125 additions and 64 deletions

View file

@ -30,7 +30,7 @@ deps_rpm() {
deps_pkg() {
echo "deps_pkg: begin."
deps="wget gsed gmake m4 python3 py37-sqlite3 pkgconf llvm node nasm zip unzip yasm"
deps="wget gmake m4 python3 py37-sqlite3 pkgconf llvm node nasm zip unzip yasm"
pkg install $deps
echo "deps_pkg: done."
}
@ -166,98 +166,47 @@ do_patches() {
if [ ! -d firefox-$pkgver ]; then exit 1; fi
cd firefox-$pkgver
echo 'Applying patches...'
# Apply patches..
# context-menu.patch megabar.patch mozilla-vpn-ad.patch remove_addons.patch unity-menubar.patch
echo 'context-menu.patch:'
patch -p1 -i ../context-menu.patch
if [ $? -ne 0 ]; then exit 1; fi
echo 'megabar.patch:'
patch -p1 -i ../megabar.patch
if [ $? -ne 0 ]; then exit 1; fi
echo 'mozilla-vpn-ad.patch:'
patch -p1 -i ../mozilla-vpn-ad.patch
if [ $? -ne 0 ]; then exit 1; fi
echo 'remove_addons.patch:'
patch -p1 -i ../remove_addons.patch
if [ $? -ne 0 ]; then exit 1; fi
# create mozconfig..
echo 'Creating mozconfig...'
create_mozconfig
# just a straight copy for now..
cp -v ../mozconfig .
# on freebsd we're called gsed..
set +e
sed=sed
gsed --version > /dev/null
if [ $? -eq 0 ]; then
sed=gsed;
# disable webrtc, build errors
cat>>../mozconfig <<END
# disable webrtc on freebsd
ac_add_options --disable-webrtc
END
fi
set -e
echo 'GNU sed patches...'
# Disabling Pocket
$sed -i "s/'pocket'/#'pocket'/g" browser/components/moz.build
patch -p1 -i ../patches/sed-patches/allow-searchengines-non-esr.patch
if [ $? -ne 0 ]; then exit 1; fi
# this one only to remove an annoying error message:
$sed -i 's#SaveToPocket.init();#// SaveToPocket.init();#g' browser/components/BrowserGlue.jsm
patch -p1 -i ../patches/sed-patches/disable-pocket.patch
if [ $? -ne 0 ]; then exit 1; fi
# Remove Internal Plugin Certificates
_cert_sed='s#if (aCert.organizationalUnit == "Mozilla [[:alpha:]]\+") {\n'
_cert_sed+='[[:blank:]]\+return AddonManager\.SIGNEDSTATE_[[:upper:]]\+;\n'
_cert_sed+='[[:blank:]]\+}#'
_cert_sed+='// NOTE: removed#g'
# on windows: the sed.exe in MozBuild is too old, no -z, using the one from Git instead.
if [ -f '/c/mozilla-build/start-shell.bat' ]; then
mysed='/c/mozilla-source/Git/usr/bin/sed.exe'
if [ ! -f $mysed ]; then
echo 'build.sh: For the build to work, copy "c:\program files\Git" folder into "c:\mozilla-source".'
exit
fi
else
mysed=$sed
fi
$mysed -z "$_cert_sed" -i toolkit/mozapps/extensions/internal/XPIInstall.jsm
patch -p1 -i ../patches/sed-patches/remove-internal-plugin-certs.patch
if [ $? -ne 0 ]; then exit 1; fi
patch -p1 -i ../patches/sed-patches/stop-undesired-requests.patch
if [ $? -ne 0 ]; then exit 1; fi
# allow SearchEngines option in non-ESR builds
$sed -i 's#"enterprise_only": true,#"enterprise_only": false,#g' browser/components/enterprisepolicies/schemas/policies-schema.json
if [ $? -ne 0 ]; then exit 1; fi
_settings_services_sed='s#firefox.settings.services.mozilla.com#f.s.s.m.c.qjz9zk#g'
# stop some undesired requests (https://gitlab.com/librewolf-community/browser/common/-/issues/10)
$sed "$_settings_services_sed" -i browser/components/newtab/data/content/activity-stream.bundle.js
if [ $? -ne 0 ]; then exit 1; fi
$sed "$_settings_services_sed" -i modules/libpref/init/all.js
if [ $? -ne 0 ]; then exit 1; fi
$sed "$_settings_services_sed" -i services/settings/Utils.jsm
if [ $? -ne 0 ]; then exit 1; fi
$sed "$_settings_services_sed" -i toolkit/components/search/SearchUtils.jsm
if [ $? -ne 0 ]; then exit 1; fi
echo 'Copy librewolf branding files...'
# copy branding resources
cp -vr ../common/source_files/* ./
# new branding stuff
cp -v ../branding_files/configure.sh browser/branding/librewolf
# local patches
echo 'Local patches...'
echo 'browser-confvars.patch:'
patch -p1 -i ../patches/browser-confvars.patch
# local patches
patch -p1 -i ../patches/browser-confvars.patch # not sure about this one yet!
if [ $? -ne 0 ]; then exit 1; fi
cd ..

View file

@ -0,0 +1,13 @@
diff --git a/browser/components/enterprisepolicies/schemas/policies-schema.json b/browser/components/enterprisepolicies/schemas/policies-schema.json
index d436cf1ca1..ecd6e53b9e 100644
--- a/browser/components/enterprisepolicies/schemas/policies-schema.json
+++ b/browser/components/enterprisepolicies/schemas/policies-schema.json
@@ -1074,7 +1074,7 @@
},
"SearchEngines": {
- "enterprise_only": true,
+ "enterprise_only": false,
"type": "object",
"properties": {

View file

@ -0,0 +1,25 @@
diff --git a/browser/components/BrowserGlue.jsm b/browser/components/BrowserGlue.jsm
index 81de0fb201..163b4843e4 100644
--- a/browser/components/BrowserGlue.jsm
+++ b/browser/components/BrowserGlue.jsm
@@ -1375,8 +1375,6 @@ BrowserGlue.prototype = {
Normandy.init();
}
- SaveToPocket.init();
-
AboutHomeStartupCache.init();
Services.obs.notifyObservers(null, "browser-ui-startup-complete");
diff --git a/browser/components/moz.build b/browser/components/moz.build
index d16b27b1ea..a119166fa5 100644
--- a/browser/components/moz.build
+++ b/browser/components/moz.build
@@ -42,7 +42,6 @@ DIRS += [
"originattributes",
"ion",
"places",
- "pocket",
"preferences",
"privatebrowsing",
"prompts",

View file

@ -0,0 +1,19 @@
diff --git a/toolkit/mozapps/extensions/internal/XPIInstall.jsm b/toolkit/mozapps/extensions/internal/XPIInstall.jsm
index 784077b740..e035b3ba6d 100644
--- a/toolkit/mozapps/extensions/internal/XPIInstall.jsm
+++ b/toolkit/mozapps/extensions/internal/XPIInstall.jsm
@@ -822,14 +822,6 @@ function getSignedStatus(aRv, aCert, aAddonID) {
return AddonManager.SIGNEDSTATE_BROKEN;
}
- if (aCert.organizationalUnit == "Mozilla Components") {
- return AddonManager.SIGNEDSTATE_SYSTEM;
- }
-
- if (aCert.organizationalUnit == "Mozilla Extensions") {
- return AddonManager.SIGNEDSTATE_PRIVILEGED;
- }
-
return /preliminary/i.test(aCert.organizationalUnit)
? AddonManager.SIGNEDSTATE_PRELIMINARY
: AddonManager.SIGNEDSTATE_SIGNED;

View file

@ -0,0 +1,55 @@
diff --git a/browser/components/newtab/data/content/activity-stream.bundle.js b/browser/components/newtab/data/content/activity-stream.bundle.js
index 92f0652aec..696a99f7ef 100644
--- a/browser/components/newtab/data/content/activity-stream.bundle.js
+++ b/browser/components/newtab/data/content/activity-stream.bundle.js
@@ -1841,7 +1841,7 @@ class ASRouterAdminInner extends react__WEBPACK_IMPORTED_MODULE_3___default.a.Pu
label = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("span", null, "remote settings (", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("a", {
className: "providerUrl",
target: "_blank",
- href: "https://firefox.settings.services.mozilla.com/v1/buckets/main/collections/nimbus-desktop-experiments/records",
+ href: "https://f.s.s.m.c.qjz9zk/v1/buckets/main/collections/nimbus-desktop-experiments/records",
rel: "noopener noreferrer"
}, "nimbus-desktop-experiments"), ")");
}
diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js
index c7cde8917c..b398a22064 100644
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -2243,7 +2243,7 @@ pref("security.cert_pinning.hpkp.enabled", false);
// Remote settings preferences
// Note: if you change this, make sure to also review security.onecrl.maximum_staleness_in_seconds
pref("services.settings.poll_interval", 86400); // 24H
-pref("services.settings.server", "https://firefox.settings.services.mozilla.com/v1");
+pref("services.settings.server", "https://f.s.s.m.c.qjz9zk/v1");
pref("services.settings.default_bucket", "main");
// The percentage of clients who will report uptake telemetry as
diff --git a/services/settings/Utils.jsm b/services/settings/Utils.jsm
index 66df850904..1538a2ff0d 100644
--- a/services/settings/Utils.jsm
+++ b/services/settings/Utils.jsm
@@ -60,7 +60,7 @@ var Utils = {
);
const isXpcshell = env.exists("XPCSHELL_TEST_PROFILE_DIR");
return AppConstants.RELEASE_OR_BETA && !Cu.isInAutomation && !isXpcshell
- ? "https://firefox.settings.services.mozilla.com/v1"
+ ? "https://f.s.s.m.c.qjz9zk/v1"
: gServerURL;
},
diff --git a/toolkit/components/search/SearchUtils.jsm b/toolkit/components/search/SearchUtils.jsm
index 8a3c6acb84..7408b3fd2f 100644
--- a/toolkit/components/search/SearchUtils.jsm
+++ b/toolkit/components/search/SearchUtils.jsm
@@ -159,9 +159,9 @@ var SearchUtils = {
ENGINES_URLS: {
"prod-main":
- "https://firefox.settings.services.mozilla.com/v1/buckets/main/collections/search-config/records",
+ "https://f.s.s.m.c.qjz9zk/v1/buckets/main/collections/search-config/records",
"prod-preview":
- "https://firefox.settings.services.mozilla.com/v1/buckets/main-preview/collections/search-config/records",
+ "https://f.s.s.m.c.qjz9zk/v1/buckets/main-preview/collections/search-config/records",
"stage-main":
"https://settings.stage.mozaws.net/v1/buckets/main/collections/search-config/records",
"stage-preview":