From 78d37bb13b5ff9f9e309854a9214762a8b85c6da Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Thu, 17 Jun 2021 14:46:51 +0200 Subject: [PATCH] switch to allow/block list terminology throughout code base allowlist and blocklist are much clearer terms with no cultural baggage. This changes all "whitelist" references to "allowlist", and all "blacklist" references to "blocklist". --- MANIFEST.in | 4 ++-- buildserver/provision-android-sdk | 4 ++-- fdroidserver/build.py | 2 +- fdroidserver/scanner.py | 8 ++++---- tests/common.TestCase | 4 ++-- .../app/build.gradle | 0 .../build.gradle | 0 7 files changed, 11 insertions(+), 11 deletions(-) rename tests/source-files/{firebase-whitelisted => firebase-allowlisted}/app/build.gradle (100%) rename tests/source-files/{firebase-whitelisted => firebase-allowlisted}/build.gradle (100%) diff --git a/MANIFEST.in b/MANIFEST.in index 2d4fe372..c65e8481 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -752,8 +752,8 @@ include tests/source-files/fdroid/fdroidclient/AndroidManifest.xml include tests/source-files/fdroid/fdroidclient/build.gradle include tests/source-files/firebase-suspect/app/build.gradle include tests/source-files/firebase-suspect/build.gradle -include tests/source-files/firebase-whitelisted/app/build.gradle -include tests/source-files/firebase-whitelisted/build.gradle +include tests/source-files/firebase-allowlisted/app/build.gradle +include tests/source-files/firebase-allowlisted/build.gradle include tests/source-files/info.guardianproject.ripple/build.gradle include tests/source-files/open-keychain/open-keychain/build.gradle include tests/source-files/open-keychain/open-keychain/OpenKeychain/build.gradle diff --git a/buildserver/provision-android-sdk b/buildserver/provision-android-sdk index 1ca5ec19..4814ca40 100644 --- a/buildserver/provision-android-sdk +++ b/buildserver/provision-android-sdk @@ -44,7 +44,7 @@ done cd /vagrant/cache # make links for `android update sdk` to use and delete -blacklist="build-tools_r17-linux.zip +blocklist="build-tools_r17-linux.zip build-tools_r18.0.1-linux.zip build-tools_r18.1-linux.zip build-tools_r18.1.1-linux.zip @@ -66,7 +66,7 @@ blacklist="build-tools_r17-linux.zip latestm2=`ls -1 android_m2repository*.zip | sort -n | tail -1` for f in $latestm2 android-[0-9]*.zip platform-[0-9]*.zip build-tools_r*-linux.zip; do rm -f ${ANDROID_HOME}/temp/$f - if [[ $blacklist != *$f* ]]; then + if [[ $blocklist != *$f* ]]; then ln -s /vagrant/cache/$f ${ANDROID_HOME}/temp/ fi done diff --git a/fdroidserver/build.py b/fdroidserver/build.py index 89097166..75dc122c 100644 --- a/fdroidserver/build.py +++ b/fdroidserver/build.py @@ -806,7 +806,7 @@ def build_local(app, build, vcs, build_dir, output_dir, log_dir, srclib_dir, ext str(build.versionCode))) if (options.scan_binary or config.get('scan_binary')) and not options.skipscan: if scanner.scan_binary(src): - raise BuildException("Found blacklisted packages in final apk!") + raise BuildException("Found blocklisted packages in final apk!") # Copy the unsigned APK to our destination directory for further # processing (by publish.py)... diff --git a/fdroidserver/scanner.py b/fdroidserver/scanner.py index 57e30066..6479a43c 100644 --- a/fdroidserver/scanner.py +++ b/fdroidserver/scanner.py @@ -136,18 +136,18 @@ def scan_source(build_dir, build=metadata.Build()): count = 0 - whitelisted = [ + allowlisted = [ 'firebase-jobdispatcher', # https://github.com/firebase/firebase-jobdispatcher-android/blob/master/LICENSE 'com.firebaseui', # https://github.com/firebase/FirebaseUI-Android/blob/master/LICENSE 'geofire-android' # https://github.com/firebase/geofire-java/blob/master/LICENSE ] - def is_whitelisted(s): - return any(wl in s for wl in whitelisted) + def is_allowlisted(s): + return any(al in s for al in allowlisted) def suspects_found(s): for n, r in NON_FREE_GRADLE_LINES.items(): - if r.match(s) and not is_whitelisted(s): + if r.match(s) and not is_allowlisted(s): yield n allowed_repos = [re.compile(r'^https://' + re.escape(repo) + r'/*') for repo in [ diff --git a/tests/common.TestCase b/tests/common.TestCase index 2619d4b7..222813f6 100755 --- a/tests/common.TestCase +++ b/tests/common.TestCase @@ -1376,8 +1376,8 @@ class CommonTest(unittest.TestCase): 'source-files/fdroid/fdroidclient/build.gradle', 'source-files/firebase-suspect/app/build.gradle', 'source-files/firebase-suspect/build.gradle', - 'source-files/firebase-whitelisted/app/build.gradle', - 'source-files/firebase-whitelisted/build.gradle', + 'source-files/firebase-allowlisted/app/build.gradle', + 'source-files/firebase-allowlisted/build.gradle', 'source-files/org.mozilla.rocket/app/build.gradle', 'source-files/realm/react-native/android/build.gradle', 'triple-t-2/build/org.piwigo.android/app/build.gradle', diff --git a/tests/source-files/firebase-whitelisted/app/build.gradle b/tests/source-files/firebase-allowlisted/app/build.gradle similarity index 100% rename from tests/source-files/firebase-whitelisted/app/build.gradle rename to tests/source-files/firebase-allowlisted/app/build.gradle diff --git a/tests/source-files/firebase-whitelisted/build.gradle b/tests/source-files/firebase-allowlisted/build.gradle similarity index 100% rename from tests/source-files/firebase-whitelisted/build.gradle rename to tests/source-files/firebase-allowlisted/build.gradle