From ed93683024480499f59bde649f47a478083101fe Mon Sep 17 00:00:00 2001 From: ngld Date: Mon, 22 Oct 2018 21:33:29 +0200 Subject: [PATCH 01/73] Fix escaping issue in .deb launch script. --- releng/ubuntu/debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/releng/ubuntu/debian/rules b/releng/ubuntu/debian/rules index c7a70504..b9e9ce6e 100644 --- a/releng/ubuntu/debian/rules +++ b/releng/ubuntu/debian/rules @@ -8,7 +8,7 @@ export PYBUILD_INSTALL_DIR=/usr/share/knossos override_dh_link: dh_link echo '#!/bin/bash' > debian/knossos/usr/bin/knossos - echo 'exec python3 /usr/share/knossos/knossos/__main__.py "\$@"' >> debian/knossos/usr/bin/knossos + echo 'exec python3 /usr/share/knossos/knossos/__main__.py "$''@"' >> debian/knossos/usr/bin/knossos %: dh $@ --with python3 --buildsystem=pybuild From bf8dde253069574ac908d147c8f807602d1051c0 Mon Sep 17 00:00:00 2001 From: ngld Date: Mon, 22 Oct 2018 21:34:38 +0200 Subject: [PATCH 02/73] Changed code to launch external processes to make debugging easier. * Higher log level * Don't hide FSO on Windows even when launching it in the background. --- knossos/runner.py | 4 ++-- knossos/util.py | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/knossos/runner.py b/knossos/runner.py index ef15f20e..6b1e0ce3 100644 --- a/knossos/runner.py +++ b/knossos/runner.py @@ -85,7 +85,7 @@ def run(self): env['LD_LIBRARY_PATH'] = ld_path - logging.debug('Launching FS2: %s in %s', repr([fs2_bin] + self._params[1:]), self._cwd) + logging.info('Launching FS2: %s in %s', repr([fs2_bin] + self._params[1:]), self._cwd) if not self.prepare_fso_config(fs2_bin): return @@ -376,7 +376,7 @@ def run_fs2_silent(params): try: try: - output = util.check_output(params, env=env, cwd=base_path, stderr=subprocess.DEVNULL) + output = util.check_output(params, env=env, cwd=base_path, stderr=subprocess.DEVNULL, no_hide=True) rc = 0 except CalledProcessError as e: # check_output raises this error if the return code was anything other than 0 diff --git a/knossos/util.py b/knossos/util.py index 94a434c7..a632984c 100644 --- a/knossos/util.py +++ b/knossos/util.py @@ -244,7 +244,7 @@ def call(*args, **kwargs): kwargs['startupinfo'] = si - logging.debug('Running %s', args[0]) + logging.info('Running %s', args[0]) return subprocess.call(*args, **kwargs) @@ -261,7 +261,7 @@ def Popen(*args, **kwargs): kwargs['startupinfo'] = si - logging.debug('Running %s', args[0]) + logging.info('Running %s', args[0]) return subprocess.Popen(*args, **kwargs) @@ -271,16 +271,18 @@ def check_output(*args, **kwargs): kwargs.setdefault('stdin', subprocess.DEVNULL) kwargs.setdefault('stderr', subprocess.DEVNULL) - si = subprocess.STARTUPINFO() - si.dwFlags = subprocess.STARTF_USESHOWWINDOW - si.wShowWindow = subprocess.SW_HIDE - - kwargs['startupinfo'] = si + if kwargs.get('no_hide'): + del kwargs['no_hide'] + else: + si = subprocess.STARTUPINFO() + si.dwFlags = subprocess.STARTF_USESHOWWINDOW + si.wShowWindow = subprocess.SW_HIDE + kwargs['startupinfo'] = si kwargs.setdefault('errors', 'surrogateescape') kwargs.setdefault('universal_newlines', True) - logging.debug('Running %s', args[0]) + logging.info('Running %s', args[0]) return subprocess.check_output(*args, **kwargs) From f9fc50b3b5b870dbd737bee02f006022f933a776 Mon Sep 17 00:00:00 2001 From: ngld Date: Mon, 22 Oct 2018 21:35:25 +0200 Subject: [PATCH 03/73] The main window's progress bar now has the correct text color. --- ui/hell.ui | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ui/hell.ui b/ui/hell.ui index 36f93563..312399c5 100644 --- a/ui/hell.ui +++ b/ui/hell.ui @@ -25,7 +25,10 @@ background: #1c1c1c; color: #fff; } - + +QProgressBar { + color: #fff; +} @@ -230,7 +233,7 @@ QPushButton:pressed { 6 - + 0 @@ -242,7 +245,7 @@ QPushButton:pressed { padding: 5; } - + about:blank From c36cae40873092e4139e60b1826c7b0ce08a0cb8 Mon Sep 17 00:00:00 2001 From: ngld Date: Sun, 2 Dec 2018 17:52:14 +0000 Subject: [PATCH 04/73] Updated CI scripts --- .drone.yml | 37 ++++++++++++++++++++++++ .travis.yml | 16 +++++------ releng/arch/Dockerfile | 4 +-- releng/arch/PKGBUILD | 6 ++-- releng/arch/auto-build.sh | 43 +++++++++++++++++++++++----- releng/macos/Knossos.spec | 6 ++-- releng/ubuntu/Dockerfile | 11 +++---- releng/ubuntu/auto-build.sh | 57 ++++++++++++++++++++----------------- releng/ubuntu/debian/rules | 2 +- 9 files changed, 127 insertions(+), 55 deletions(-) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 00000000..54f99162 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,37 @@ +kind: pipeline +name: ubuntu + +steps: + - name: build + image: ngld/knossos-builders:ubuntu + secrets: [ubuntu_gpg_key, ubuntu_key] + environment: + TRAVIS: n + RELEASE: n + UBUNTU_GPG_KEY: + from_secret: ubuntu_gpg_key + UBUNTU_KEY: + from_secret: ubuntu_key + commands: + - export VERSION="$(python3 setup.py get_version)" + - bash releng/ubuntu/auto-build.sh + +--- + +kind: pipeline +name: arch + +steps: + - name: build + image: ngld/knossos-builders:arch + secrets: [aur_key] + environment: + TRAVIS: n + RELEASE: n + AUR_USER: ngld + AUR_EMAIL: ngld@tproxy.de + AUR_KEY: + from_secret: aur_key + commands: + - export VERSION="$(python3 setup.py get_version)" + - bash releng/arch/auto-build.sh diff --git a/.travis.yml b/.travis.yml index 42b83887..cfdc49d4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,21 +4,21 @@ branches: - /^v\d+\.\d+(\.\d+)?(-\S*)?$/ sudo: required -services: - - docker +#services: +# - docker matrix: include: - - os: linux +# - os: linux - os: osx env: - secure: "fMo6M/KJV0QvkTo9rvksH3gDirKiDQlkOj5bwP0VBTdQPt0l/4Top9n9ZZ4ZZqtUBo6fACsbCaBV7WYSpvE3q0iPBRV3a07vyVnHy5O5+p8NZI+FJWHUhAEZKQHTVQztBLeDzlgoP4JNHPtVrwSp+EQO7Ci7bpmKpFR2uZi+Gcg=" -addons: - apt: - packages: - - docker-ce +#addons: +# apt: +# packages: +# - docker-ce before_install: - cd releng/config @@ -32,7 +32,7 @@ install: script: - bash ./releng/ci/travis.sh macos #- bash ./releng/ci/travis.sh ubuntu -- bash ./releng/ci/travis.sh arch +#- bash ./releng/ci/travis.sh arch after_success: - bash ./releng/ci/travis_upload.sh diff --git a/releng/arch/Dockerfile b/releng/arch/Dockerfile index 8134389f..a47450fd 100644 --- a/releng/arch/Dockerfile +++ b/releng/arch/Dockerfile @@ -3,9 +3,9 @@ FROM mailsvb/arch-linux:latest ADD aur.sh /usr/bin/aur RUN pacman -Sy --noconfirm archlinux-keyring && \ - pacman -Su --needed --noconfirm base-devel sudo python pkgbuild-introspection \ + pacman -Su --needed --noconfirm base-devel sudo python \ python-six python-requests python-requests-toolbelt python-ply python-pyqt5 python-raven \ - qt5-webengine qt5-webchannel qt5-tools sdl2 openal p7zip ninja rsync git openssh nodejs npm && \ + qt5-webengine qt5-webchannel qt5-tools sdl2 openal p7zip ninja rsync git openssh nodejs yarn && \ chmod a+x /usr/bin/aur && \ useradd -mG wheel packager && \ echo '%wheel ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers && \ diff --git a/releng/arch/PKGBUILD b/releng/arch/PKGBUILD index 8d13fabe..ed3a84ba 100644 --- a/releng/arch/PKGBUILD +++ b/releng/arch/PKGBUILD @@ -10,9 +10,9 @@ license=('Apache') groups=() depends=( 'python' 'python-six' 'python-requests' 'python-requests-toolbelt' 'python-ply' 'python-token-bucket' 'python-pyqt5' 'qt5-webengine' - 'qt5-webchannel' 'python-semantic-version' 'python-raven' 'p7zip' 'openal' 'sdl2' + 'qt5-webchannel' 'qt5-tools' 'python-semantic-version' 'python-raven' 'p7zip' 'openal' 'sdl2' ) -makedepends=('python-setuptools' 'ninja' 'npm') +makedepends=('python-setuptools' 'ninja' 'yarn') options=(!emptydirs) source=( "https://github.com/ngld/knossos/archive/v${pkgver}.tar.gz" @@ -25,7 +25,7 @@ md5sums=('d238a3a4f6190f0ed0710652a46c4941' package() { cd "$srcdir/${_name}-$pkgver" - npm install + yarn install python configure.py ninja resources python setup.py install --root="$pkgdir/" --optimize=1 diff --git a/releng/arch/auto-build.sh b/releng/arch/auto-build.sh index 2b1f0553..efe333e7 100644 --- a/releng/arch/auto-build.sh +++ b/releng/arch/auto-build.sh @@ -2,21 +2,50 @@ set -eo pipefail -cd /build sudo chown packager . -rsync -au --exclude=dist --exclude=build --exclude=packer --exclude=.vagrant --exclude=node_modules src/ work/ -cd work + +if [ -d work ]; then + rm -rf work +fi + +if [ -z "$CI" ]; then + # Make a "clean" copy of the source dir (without the files in .gitignore) to avoid + # modifying a local checkout mounted via -v + + git clone . work + + cd src + git diff > ./work/pp + cd ./work + + if [ -n "$(cat pp)" ]; then + git apply pp + fi + + rm pp +else + ln -s . work + cd work +fi if [ "$RELEASE" = "y" ]; then . releng/config/config.sh - install -Dm600 releng/config/aur_key ~/.ssh/id_rsa - echo -e "Host aur.archlinux.org\n\tStrictHostKeyChecking no\n\tUserKnownHostsFile=/dev/null\n" > ~/.ssh/config + if [ "$DRONE" = "true" ]; then + echo "$AUR_SSH_KEY" > releng/config/aur_key + fi + + install -Dm600 releng/config/aur_key ~/.ssh/id_ecdsa + + # Disable interactive question for unknown host keys + echo -e "Host aur.archlinux.org\n\tIdentityFile ~/.ssh/id_ecdsa\n\tStrictHostKeyChecking no\n\tUserKnownHostsFile=/dev/null\n" > ~/.ssh/config git config --global user.name "$AUR_USER" git config --global user.email "$AUR_EMAIL" - VERSION="$(python setup.py get_version | cut -d - -f 1)" + if [ -z "$VERSION" ]; then + VERSION="$(python setup.py get_version | cut -d - -f 1)" + fi cd releng/arch if [ -d pkg ]; then @@ -28,7 +57,7 @@ if [ "$RELEASE" = "y" ]; then sed -e 's#^pkgver=.*#pkgver='"$VERSION"'#' -e 's#^pkrel=.*#pkgrel=1#' < ../PKGBUILD > PKGBUILD updpkgsums - mksrcinfo + makepkg --srcinfo > .SRCINFO # Make sure we can actually build the package makepkg -c diff --git a/releng/macos/Knossos.spec b/releng/macos/Knossos.spec index 0d53df67..59768908 100644 --- a/releng/macos/Knossos.spec +++ b/releng/macos/Knossos.spec @@ -80,9 +80,9 @@ a = Analysis(['../../knossos/__main__.py'], runtime_hooks=rthooks, binaries=[ # Add QtWebEngine stuff because PyInstaller's hook doesn't do anything without qmake (which PyQt5 doesn't include). - (os.path.join(qt_path, 'QtWebEngineCore.framework', 'Helpers', 'QtWebEngineProcess.app', - 'Contents', 'MacOS', 'QtWebEngineProcess'), - os.path.join('QtWebEngineProcess.app', 'Contents', 'MacOS')) +# (os.path.join(qt_path, 'QtWebEngineCore.framework', 'Helpers', 'QtWebEngineProcess.app', +# 'Contents', 'MacOS', 'QtWebEngineProcess'), +# os.path.join('QtWebEngineProcess.app', 'Contents', 'MacOS')) ] + qt_plugins_binaries('styles', namespace='PyQt5'), datas=[ (p7zip_path, '.'), diff --git a/releng/ubuntu/Dockerfile b/releng/ubuntu/Dockerfile index 36c48ba9..c7527a79 100644 --- a/releng/ubuntu/Dockerfile +++ b/releng/ubuntu/Dockerfile @@ -1,15 +1,16 @@ -FROM ubuntu:artful +FROM ubuntu:bionic RUN apt-get update && apt-get upgrade -y && \ - apt-get install -y build-essential sudo gnupg debhelper pbuilder apt-file \ + apt-get install -y build-essential sudo gnupg2 debhelper pbuilder apt-file \ python3-six python3-requests python3-requests-toolbelt python3-ply \ python3-semantic-version python3-setuptools python3-pyqt5 python3-pyqt5.qtwebengine \ python3-pyqt5.qtwebchannel pyqt5-dev-tools qtbase5-dev-tools libsdl2-2.0-0 libopenal1 \ - p7zip-full ninja-build git yarnpkg twine python3-wheel gnupg-agent gnupg2 pinentry-tty gdb \ - python-software-properties software-properties-common && \ + p7zip-full ninja-build git gnupg-agent software-properties-common && \ + curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ + echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list && \ add-apt-repository ppa:ngld/knossos && \ apt-get update && \ - apt-get install -y python3-token-bucket + apt-get install -y python3-token-bucket yarn dh-python RUN useradd -mG sudo packager && \ echo '%sudo ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers && \ diff --git a/releng/ubuntu/auto-build.sh b/releng/ubuntu/auto-build.sh index 89233911..f6a14637 100644 --- a/releng/ubuntu/auto-build.sh +++ b/releng/ubuntu/auto-build.sh @@ -2,51 +2,56 @@ set -eo pipefail -cd /build -sudo chown packager . src/releng/ubuntu/dist +sudo chown packager . releng/ubuntu/dist if [ -d work ]; then - cd work - git reset --hard - git pull + rm -r work +fi + +if [ -z "$CI" ]; then + # Make a "clean" copy of the source dir (without the files in .gitignore) to avoid + # modifying a local checkout mounted via -v + + git clone . work + git diff > ./work/pp + + cd ./work + if [ -n "$(cat pp)" ]; then + git apply pp + fi + rm pp cd .. -else - git clone src work fi -cd src -git diff > ../work/pp -cd ../work -git apply pp -rm pp +if [ "$DRONE" = "true" ]; then + echo "$UBUNTU_GPG_KEY" | gpg --import /dev/stdin +else + . releng/config/config.sh + import_key +fi -cd src -. releng/config/config.sh -cd ../work +if [ -z "$CI" ]; then + cd work +fi export QT_SELECT=5 if [ -z "$VERSION" ]; then VERSION="$(python3 setup.py get_version)" fi -UBUNTU_VERSION="cosmic" python3 tools/common/npm_wrapper.py python3 configure.py ninja resources -tar -czf ../"knossos_$VERSION.orig.tar.gz" knossos setup.* DESCRIPTION.rst MANIFEST.in LICENSE NOTICE +tar -czf "knossos_$VERSION.orig.tar.gz" knossos setup.* DESCRIPTION.rst MANIFEST.in LICENSE NOTICE -mkdir ../knossos -cd ../knossos +mkdir deb_work +cd deb_work tar -xzf ../"knossos_$VERSION.orig.tar.gz" -cp -a ../src/releng/ubuntu/debian . +cp -a ../releng/ubuntu/debian . if [ "$RELEASE" = "y" ]; then - pushd /build/src > /dev/null - import_key - popd > /dev/null - for ubuntu in bionic cosmic; do cat > debian/changelog < debian/changelog < debian/knossos/usr/bin/knossos - echo 'exec python3 /usr/share/knossos/knossos/__main__.py "$''@"' >> debian/knossos/usr/bin/knossos + echo 'exec python3 /usr/share/knossos/knossos/__main__.py "$$''@"' >> debian/knossos/usr/bin/knossos %: dh $@ --with python3 --buildsystem=pybuild From d8995f49cfde9125336b52b2812fd2a9d6582217 Mon Sep 17 00:00:00 2001 From: ngld Date: Sun, 2 Dec 2018 19:19:53 +0100 Subject: [PATCH 05/73] Fix macOS build on Travis --- .travis.yml | 10 ---------- releng/ci/travis_provision.sh | 4 ++-- releng/macos/Knossos.spec | 14 +++++++------- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/.travis.yml b/.travis.yml index cfdc49d4..3612cb34 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,22 +4,14 @@ branches: - /^v\d+\.\d+(\.\d+)?(-\S*)?$/ sudo: required -#services: -# - docker matrix: include: -# - os: linux - os: osx env: - secure: "fMo6M/KJV0QvkTo9rvksH3gDirKiDQlkOj5bwP0VBTdQPt0l/4Top9n9ZZ4ZZqtUBo6fACsbCaBV7WYSpvE3q0iPBRV3a07vyVnHy5O5+p8NZI+FJWHUhAEZKQHTVQztBLeDzlgoP4JNHPtVrwSp+EQO7Ci7bpmKpFR2uZi+Gcg=" -#addons: -# apt: -# packages: -# - docker-ce - before_install: - cd releng/config - openssl aes-256-cbc -K $encrypted_7dc0ff3d6916_key -iv $encrypted_7dc0ff3d6916_iv -in ci.tar.enc -out ci.tar -d @@ -31,8 +23,6 @@ install: script: - bash ./releng/ci/travis.sh macos -#- bash ./releng/ci/travis.sh ubuntu -#- bash ./releng/ci/travis.sh arch after_success: - bash ./releng/ci/travis_upload.sh diff --git a/releng/ci/travis_provision.sh b/releng/ci/travis_provision.sh index 2f89586a..384595ec 100644 --- a/releng/ci/travis_provision.sh +++ b/releng/ci/travis_provision.sh @@ -15,8 +15,8 @@ if [ "$TRAVIS_OS_NAME" == "osx" ]; then cd /tmp/prov # We need Python 3.6 since that's the latest version PyInstaller supports. - echo "==> Installing Python 3.6.6" - curl -so python.pkg "https://www.python.org/ftp/python/3.6.6/python-3.6.6-macosx10.6.pkg" + echo "==> Installing Python 3.6.7" + curl -so python.pkg "https://www.python.org/ftp/python/3.6.7/python-3.6.7-macosx10.6.pkg" sudo installer -store -pkg python.pkg -target / export PATH="/Library/Frameworks/Python.framework/Versions/3.6/bin:$PATH" diff --git a/releng/macos/Knossos.spec b/releng/macos/Knossos.spec index 59768908..efd46f33 100644 --- a/releng/macos/Knossos.spec +++ b/releng/macos/Knossos.spec @@ -80,9 +80,9 @@ a = Analysis(['../../knossos/__main__.py'], runtime_hooks=rthooks, binaries=[ # Add QtWebEngine stuff because PyInstaller's hook doesn't do anything without qmake (which PyQt5 doesn't include). -# (os.path.join(qt_path, 'QtWebEngineCore.framework', 'Helpers', 'QtWebEngineProcess.app', -# 'Contents', 'MacOS', 'QtWebEngineProcess'), -# os.path.join('QtWebEngineProcess.app', 'Contents', 'MacOS')) + (os.path.join(qt_path, 'QtWebEngineCore.framework', 'Helpers', 'QtWebEngineProcess.app', + 'Contents', 'MacOS', 'QtWebEngineProcess'), + os.path.join('QtWebEngineProcess.app', 'Contents', 'MacOS')) ] + qt_plugins_binaries('styles', namespace='PyQt5'), datas=[ (p7zip_path, '.'), @@ -90,10 +90,10 @@ a = Analysis(['../../knossos/__main__.py'], ('../../knossos/data/resources.rcc', 'data'), # Add QtWebEngine stuff because PyInstaller's hook doesn't do anything without qmake (which PyQt5 doesn't include). - (os.path.join(resources_dir, 'icudtl.dat'), ''), - (os.path.join(resources_dir, 'qtwebengine_resources.pak'), ''), - (os.path.join(resources_dir, 'qtwebengine_resources_100p.pak'), ''), - (os.path.join(resources_dir, 'qtwebengine_resources_200p.pak'), ''), + (os.path.join(resources_dir, 'icudtl.dat'), '.'), + (os.path.join(resources_dir, 'qtwebengine_resources.pak'), '.'), + (os.path.join(resources_dir, 'qtwebengine_resources_100p.pak'), '.'), + (os.path.join(resources_dir, 'qtwebengine_resources_200p.pak'), '.'), # The distributed Info.plist has LSUIElement set to true, which prevents the # icon from appearing in the dock. From 63756915d4286f4128b0c4c367f93a3d9214d514 Mon Sep 17 00:00:00 2001 From: jg18 Date: Sat, 8 Dec 2018 13:21:12 -0800 Subject: [PATCH 06/73] Hide FS2 mods when retail is not installed Also add settings option for showing FS2 mods even when retail is not installed. --- html/templates/kn-settings-page.vue | 11 +++++++++-- knossos/center.py | 3 ++- knossos/settings.py | 9 ++++++++- knossos/windows.py | 4 ++++ 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/html/templates/kn-settings-page.vue b/html/templates/kn-settings-page.vue index c7417866..df42f538 100644 --- a/html/templates/kn-settings-page.vue +++ b/html/templates/kn-settings-page.vue @@ -77,7 +77,7 @@ export default { fs2mod.setBasePath(this.knossos.base_path); } - for(let set of ['max_downloads', 'use_raven', 'engine_stability', 'download_bandwidth', 'update_notify', 'custom_bar']) { + for(let set of ['max_downloads', 'use_raven', 'engine_stability', 'download_bandwidth', 'update_notify', 'custom_bar', 'show_fs2_mods_without_retail']) { if(this.knossos[set] != this.old_settings.knossos[set]) { fs2mod.saveSetting(set, JSON.stringify(this.knossos[set])); } @@ -123,7 +123,7 @@ export default {

Settings - +

@@ -170,6 +170,13 @@ export default {
+ +
+ +
+ +
+
diff --git a/knossos/center.py b/knossos/center.py index 5f329a3d..e8ba1c04 100644 --- a/knossos/center.py +++ b/knossos/center.py @@ -70,7 +70,8 @@ 'joystick': { 'guid': None, 'id': 99999 - } + }, + 'show_fs2_mods_without_retail': False } if sys.platform.startswith('win'): diff --git a/knossos/settings.py b/knossos/settings.py index 42a23c78..47bb8101 100644 --- a/knossos/settings.py +++ b/knossos/settings.py @@ -684,9 +684,16 @@ def save_setting(name, value): else: center.main_win.hide_bar() + refresh_mod_list = False + if name == 'show_fs2_mods_without_retail': + if value != center.settings['show_fs2_mods_without_retail']: + refresh_mod_list = True + center.settings[name] = value center.save_settings() - + + if refresh_mod_list: + center.main_win.update_mod_list() def get_fso_log(self): logpath = os.path.join(get_fso_profile_path(), 'data/fs2_open.log') diff --git a/knossos/windows.py b/knossos/windows.py index 99735317..e447ed8c 100644 --- a/knossos/windows.py +++ b/knossos/windows.py @@ -363,11 +363,13 @@ def ask_update(self, version): def search_mods(self): mods = None + omit_fs2_mods = False if self._mod_filter in ('home', 'develop'): mods = center.installed.mods elif self._mod_filter == 'explore': mods = center.mods.mods + omit_fs2_mods = not center.installed.has('FS2') and not center.settings['show_fs2_mods_without_retail'] else: mods = {} @@ -377,6 +379,8 @@ def search_mods(self): for mid, mvs in mods.items(): if query in mvs[0].title.lower(): mod = mvs[0] + if mod.parent == 'FS2' and omit_fs2_mods: + continue if mod.mtype == 'engine' and self._mod_filter != 'develop': mvs = [mv for mv in mvs if mv.satisfies_stability(center.settings['engine_stability'])] if len(mvs) == 0: From b10bd8c66d2e85b1e8761780b80a90cf2e3b68fa Mon Sep 17 00:00:00 2001 From: ngld Date: Thu, 13 Dec 2018 22:08:57 +0100 Subject: [PATCH 07/73] Fix problems with the CI scripts and PRs (builds triggered by PRs can't access secrets) --- .drone.yml | 2 ++ releng/ci/travis_provision.sh | 5 ++++- releng/ubuntu/auto-build.sh | 4 +++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 54f99162..2595953e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -14,6 +14,7 @@ steps: from_secret: ubuntu_key commands: - export VERSION="$(python3 setup.py get_version)" + - if [ "$DRONE_BUILD_EVENT" = "tag" ]; then export RELEASE=y; fi - bash releng/ubuntu/auto-build.sh --- @@ -34,4 +35,5 @@ steps: from_secret: aur_key commands: - export VERSION="$(python3 setup.py get_version)" + - if [ "$DRONE_BUILD_EVENT" = "tag" ]; then export RELEASE=y; fi - bash releng/arch/auto-build.sh diff --git a/releng/ci/travis_provision.sh b/releng/ci/travis_provision.sh index 384595ec..3861a39a 100644 --- a/releng/ci/travis_provision.sh +++ b/releng/ci/travis_provision.sh @@ -4,8 +4,11 @@ set -exo pipefail base="$(pwd)" if [ "$TRAVIS_OS_NAME" == "osx" ]; then + # Don't waste time on updating Homebrew. + export HOMEBREW_NO_AUTO_UPDATE=1 + echo "==> Installing build tools" - brew install p7zip ninja qt5 yarn + brew install --force-bottle p7zip ninja qt5 yarn # If we don't delete qmake, PyInstaller detects this Qt installation and uses its libraries instead of PyQt5's # which then leads to a crash because PyQt5 isn't compatible with the version we install. diff --git a/releng/ubuntu/auto-build.sh b/releng/ubuntu/auto-build.sh index f6a14637..ca74708c 100644 --- a/releng/ubuntu/auto-build.sh +++ b/releng/ubuntu/auto-build.sh @@ -24,7 +24,9 @@ if [ -z "$CI" ]; then fi if [ "$DRONE" = "true" ]; then - echo "$UBUNTU_GPG_KEY" | gpg --import /dev/stdin + if [ -n "$UBUNTU_GPG_KEY" ]; then + echo "$UBUNTU_GPG_KEY" | gpg --import /dev/stdin + fi else . releng/config/config.sh import_key From d6847bb7b6adda71b6919b3946f9488482ea5f5e Mon Sep 17 00:00:00 2001 From: ngld Date: Thu, 13 Dec 2018 22:10:02 +0100 Subject: [PATCH 08/73] Fix a null bug in the JS -> Python bridge for FSO user settings --- html/templates/kn-fso-user-settings.vue | 3 ++- knossos/web.py | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/html/templates/kn-fso-user-settings.vue b/html/templates/kn-fso-user-settings.vue index 484c70b0..c0677852 100644 --- a/html/templates/kn-fso-user-settings.vue +++ b/html/templates/kn-fso-user-settings.vue @@ -33,7 +33,8 @@ export default { }, save() { - if(this.mod.user_cmdline === this.mod_cmdline) this.mod.user_cmdline = null; + // Sadly we can't use null here since the cmdline parameter for saveUserFsoDetails is a QString. + if(this.mod.user_cmdline === this.mod_cmdline) this.mod.user_cmdline = '#DEFAULT#'; let build = this.user_build; if(build === null) build = ''; diff --git a/knossos/web.py b/knossos/web.py index db6fb242..10144f56 100644 --- a/knossos/web.py +++ b/knossos/web.py @@ -513,7 +513,7 @@ def setBasePath(self, path): else: vp_path = util.ipath(os.path.join(path, 'root_fs2.vp')) if os.path.isfile(vp_path): - QtWidgets.QMessageBox.critical(None, 'Knossos', self.tr("Please don't use an existing FS2 directory. It won't work!")) + QtWidgets.QMessageBox.critical(None, 'Knossos', self.tr("Please don't use an existing FS2 directory. It won't work! Select an empty directory instead.")) return False center.settings['base_path'] = os.path.abspath(path) @@ -1193,6 +1193,9 @@ def saveUserFsoDetails(self, mid, version, build, cmdline): mod.user_custom_build = None mod.user_exe = build + if cmdline == '#DEFAULT#': + cmdline = None + mod.user_cmdline = cmdline try: mod.save_user() From 1737e06ed5f1436f885a92cbff54da2ba451806b Mon Sep 17 00:00:00 2001 From: jg18 Date: Thu, 13 Dec 2018 22:37:58 -0800 Subject: [PATCH 09/73] Mark FS2 mods when retail is not installed --- html/css/style.css | 6 +++++- html/templates/kn-mod-explore.vue | 7 +++++-- knossos/windows.py | 11 +++++++++-- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/html/css/style.css b/html/css/style.css index 398f6108..e2eeb891 100644 --- a/html/css/style.css +++ b/html/css/style.css @@ -443,6 +443,10 @@ iframe { margin-left: 25px; } +.retail-dependency-missing { + filter: grayscale(60%); +} + .main-btn:hover .explore-image { background-image: url(../images/iconbtn-explore-h.png); } @@ -740,7 +744,7 @@ iframe { right: 0px; } -.mod-node .mod-installed { /* Places the overlay for installed mods on the Explore tab */ +.mod-node .mod-status { /* Places the overlay for mod status on the Explore tab */ width: 150px; height: 268px; position: absolute; diff --git a/html/templates/kn-mod-explore.vue b/html/templates/kn-mod-explore.vue index d2b134f2..cbc09592 100644 --- a/html/templates/kn-mod-explore.vue +++ b/html/templates/kn-mod-explore.vue @@ -51,20 +51,23 @@ export default {