From 9adcf69b976f5befb945f1dcc29296040b2f6fbf Mon Sep 17 00:00:00 2001 From: Rytis Petronis Date: Tue, 13 Feb 2024 16:24:56 +0200 Subject: [PATCH 1/2] update setup-cron.sh to actually auto update --- utils/testing-container/Dockerfile | 1 + utils/testing-container/install-crawl-versions.sh | 2 +- utils/testing-container/setup-cron.sh | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/utils/testing-container/Dockerfile b/utils/testing-container/Dockerfile index c8475443..a78c4fd4 100644 --- a/utils/testing-container/Dockerfile +++ b/utils/testing-container/Dockerfile @@ -102,6 +102,7 @@ COPY utils/testing-container/docker-entrypoint.sh / COPY utils/testing-container/docker-entrypoint-build-all.sh / COPY utils/testing-container/docker-entrypoint-build-trunk.sh / COPY utils/testing-container/enable-apache.sh / +COPY utils/testing-container/setup-cron.sh / COPY utils/testing-container/install-crawl-versions.sh / # finally copy in utils, which will be often invalidated while working on the diff --git a/utils/testing-container/install-crawl-versions.sh b/utils/testing-container/install-crawl-versions.sh index 6fdd8f79..0f598d5b 100644 --- a/utils/testing-container/install-crawl-versions.sh +++ b/utils/testing-container/install-crawl-versions.sh @@ -31,4 +31,4 @@ sleep 5 sleep 5 /home/crawl-dev/dgamelaunch-config/bin/dgl update-gcc kimchicrawl crawl-forks/kimchicrawl/bugfix sleep 5 -/home/crawl-dev/dgamelaunch-config/bin/dgl update-gcc bcadrencrawl bcadrencrawl/bcrawl \ No newline at end of file +/home/crawl-dev/dgamelaunch-config/bin/dgl update-gcc bcadrencrawl bcadrencrawl/bCrawl \ No newline at end of file diff --git a/utils/testing-container/setup-cron.sh b/utils/testing-container/setup-cron.sh index b9f63453..c50b5567 100644 --- a/utils/testing-container/setup-cron.sh +++ b/utils/testing-container/setup-cron.sh @@ -7,7 +7,7 @@ schedule1="*5 4 * * *" # Runs daily at 04:05 AM command2="/home/crawl-dev/dgamelaunch-config/bin/dgl update-gcc stoatsoup stoatsoup/master" schedule2="5 3 * * *" # Runs daily at 03:05 AM -command3="/home/crawl-dev/dgamelaunch-config/bin/dgl update-gcc bcadrencrawl bcadrencrawl/bcrawl" +command3="/home/crawl-dev/dgamelaunch-config/bin/dgl update-gcc bcadrencrawl bcadrencrawl/bCrawl" schedule3="35 3 * * *" # Runs daily at 03:35 AM # Check if a crontab file exists for the user, create one if not @@ -20,6 +20,7 @@ fi { crontab -l 2>/dev/null; echo "$schedule2 $command2"; } >> "$HOME/crontab.txt" { crontab -l 2>/dev/null; echo "$schedule3 $command3"; } >> "$HOME/crontab.txt" +crontab -r # Install the updated crontab file crontab "$HOME/crontab.txt" rm "$HOME/crontab.txt" From 4b539e47225df2454c790f6fa411f50bf966bd6f Mon Sep 17 00:00:00 2001 From: Rytis Petronis Date: Tue, 13 Feb 2024 16:47:19 +0200 Subject: [PATCH 2/2] Merge remote-tracking branch 'dcss/master' # Conflicts: # chroot/data/menus/main_admin.txt # chroot/sbin/install-stable.sh # dgamelaunch.conf # utils/testing-container/Dockerfile --- README.md | 2 +- bin/compress-ttyrecs.sh | 2 +- bin/passwd.sh | 6 +- bin/publish-conf.sh | 3 +- bin/publish-scripts.sh | 3 +- bin/publish.pl | 21 +++++ bin/remove-trunks.sh | 1 - bin/savegame-transfer-all.sh | 1 - chroot/bin/crawl-git-launcher.sh | 98 ++++++++++----------- chroot/bin/crawl-stable-launcher.sh | 4 +- chroot/bin/init-webtiles.sh | 4 +- chroot/bin/savegame-backup.sh | 17 ++-- chroot/data/menus/crawl-0.25.txt | 2 +- chroot/data/menus/crawl-0.25_adv.txt | 2 +- chroot/data/menus/crawl_git.txt | 2 +- chroot/data/menus/crawl_git_adv.txt | 2 +- chroot/data/menus/experimental.txt | 2 +- chroot/data/menus/main_admin.txt | 2 +- chroot/data/menus/main_anon.txt | 2 +- chroot/data/menus/main_user.txt | 2 +- chroot/sbin/install-stable.sh | 26 +++--- chroot/sbin/install-trunk.sh | 8 +- chroot/sbin/remove-trunks.sh | 102 +++++++++++----------- chroot/sbin/savegame-transfer.sh | 110 ++++++++++++------------ config.py | 2 +- crawl-build/update-crawl-trunk-build.sh | 2 +- crawl-git.conf | 2 +- dgamelaunch.conf | 18 ++-- games.d/base.yaml | 2 + help/admin.txt | 1 - utils/testing-container/Dockerfile | 5 +- utils/trigger-rebuild.pl | 1 - 32 files changed, 235 insertions(+), 222 deletions(-) create mode 100644 games.d/base.yaml diff --git a/README.md b/README.md index 30144355..8fc9fbb7 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ itself 2. `dgl create-chroot` command to set up a basic chroot jail with all the fixtures dgamelaunch wants (dgamelaunch already has a skeleton script that can serve as a basis, although this is unfortunately NetHack-biased). - + 3. Support for installing different games, including fetching their sources from their respective source repositories, compiling, installing into the chroot, etc. diff --git a/bin/compress-ttyrecs.sh b/bin/compress-ttyrecs.sh index 24824246..b679b1d5 100755 --- a/bin/compress-ttyrecs.sh +++ b/bin/compress-ttyrecs.sh @@ -33,7 +33,7 @@ for ttyrec in "$TTYRECDIR"/*/*.ttyrec; do continue fi if bzip2 "$ttyrec"; then - (( ++succ )) + (( ++succ )) verbiate -n "+" else (( ++fail )) diff --git a/bin/passwd.sh b/bin/passwd.sh index 5f18c58c..4f9b7b3c 100644 --- a/bin/passwd.sh +++ b/bin/passwd.sh @@ -42,7 +42,7 @@ change-password() { local password_clear="$2" assert-password-safe "$password_clear" - local password_crypt + local password_crypt password_crypt="$(perl -le 'print crypt($ARGV[0], substr($ARGV[0], 0, 2))' "$password_clear")" sqlite3 "$LOGIN_DB" < 0) { + print("Skipping optional files: @optional_skipped"); + } $dirty } diff --git a/bin/remove-trunks.sh b/bin/remove-trunks.sh index c622c5c4..eb314c0c 100644 --- a/bin/remove-trunks.sh +++ b/bin/remove-trunks.sh @@ -1,4 +1,3 @@ #!/bin/bash sudo -H "$DGL_CHROOT/sbin/remove-trunks.sh" $* - diff --git a/bin/savegame-transfer-all.sh b/bin/savegame-transfer-all.sh index 9fa21a17..99b83204 100644 --- a/bin/savegame-transfer-all.sh +++ b/bin/savegame-transfer-all.sh @@ -30,4 +30,3 @@ for char in ${ALL_CHARS} do dgl savegame-transfer "${char}" done - diff --git a/chroot/bin/crawl-git-launcher.sh b/chroot/bin/crawl-git-launcher.sh index 6f99d28b..81279580 100755 --- a/chroot/bin/crawl-git-launcher.sh +++ b/chroot/bin/crawl-git-launcher.sh @@ -14,11 +14,11 @@ # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# along with this program. If not, see . # =========================================================================== # @@ -146,41 +146,41 @@ transfer-save() { local game_hash=$2 local target="$CRAWL_GIT_DIR/$BINARY_BASE_NAME-$game_hash/$SAVES" local src_save_dir=$(dirname $save) - + wecho -n '{"msg":"show_dialog", "html":"' - + if [[ -d "$target" ]]; then # It's okay if moving the .prf fails (it might not exist one day). mv "$src_save_dir/start-$CHAR_NAME-ns.prf" "$target" 2>/dev/null || true mv -n "$src_save_dir/$CHAR_NAME".cs "$target" - if test $? -eq 0 - then + if test $? -eq 0 + then wcat <Transferring successful!

"} EOF - cecho ": successful!" - cecho - OUR_GAME_HASH="${game_hash}" + cecho ": successful!" + cecho + OUR_GAME_HASH="${game_hash}" cecho -n "--- any key to continue ---" - read -n 1 -t 5 -s - cecho - else + read -n 1 -t 5 -s + cecho + else wcat <Transferring failed!

Transferring your save failed! Continuing with former version.

"} EOF - cecho ": failed!" - cecho - cecho "Transferring your save failed! Continuing with former version." + cecho ": failed!" + cecho + cecho "Transferring your save failed! Continuing with former version." cecho -n "--- any key to continue ---" - read -n 1 -s - cecho - fi + read -n 1 -s + cecho + fi else wcat <Transferring failed!

@@ -188,12 +188,12 @@ EOF "} EOF - cecho ": failed!" - cecho - cecho "Target version is corrupt! Continuing with former version." + cecho ": failed!" + cecho + cecho "Target version is corrupt! Continuing with former version." cecho -n "--- any key to continue ---" - read -n 1 -s - cecho + read -n 1 -s + cecho fi wecho '{"msg":"hide_dialog"}' } @@ -217,10 +217,10 @@ if [[ -n "$SAVE" ]]; then then current_ver="$(hash-description $OUR_GAME_HASH)" cecho "Hi, you have a $current_ver save game:" - cecho + cecho - OUR_SGV_MAJOR="$(major-version-for-game $OUR_GAME_HASH)" - NEW_GAME_HASH="$(newest-version-with-major-version $OUR_SGV_MAJOR)" + OUR_SGV_MAJOR="$(major-version-for-game $OUR_GAME_HASH)" + NEW_GAME_HASH="$(newest-version-with-major-version $OUR_SGV_MAJOR)" new_ver="$(hash-description $NEW_GAME_HASH)" if [[ "$OUR_GAME_HASH" != "$NEW_GAME_HASH" && @@ -228,8 +228,8 @@ if [[ -n "$SAVE" ]]; then wecho '{"msg":"layer", "layer":"crt"}' wecho -n '{"msg":"show_dialog", "html":"' - if [[ "${NEW_GAME_HASH}" != "${LATEST_GAME_HASH}" ]]; then - cecho "There's a newer version ($new_ver) that can load your save." + if [[ "${NEW_GAME_HASH}" != "${LATEST_GAME_HASH}" ]]; then + cecho "There's a newer version ($new_ver) that can load your save." cecho -n "[T]ransfer your save to this version?" wcat <There's a newer version ($new_ver) that can load your save.

@@ -239,8 +239,8 @@ if [[ -n "$SAVE" ]]; then "} EOF read -n 1 -s REPLY - cecho - else + cecho + else cecho -n "[T]ransfer your save to the latest version ($new_ver)?" wcat <[T]ransfer your save to the latest version ($new_ver)?

@@ -248,30 +248,30 @@ EOF "} EOF - read -n 1 -s REPLY - cecho - fi + read -n 1 -s REPLY + cecho + fi wecho '{"msg":"hide_dialog"}' - if test "$REPLY" = "t" -o "$REPLY" = "T" -o "$REPLY" = "y" -o "$REPLY" = "Y" - then - cecho -n "Transferring..." + if test "$REPLY" = "t" -o "$REPLY" = "T" -o "$REPLY" = "y" -o "$REPLY" = "Y" + then + cecho -n "Transferring..." transfer-save "$SAVE" "$NEW_GAME_HASH" - fi - else - if test "${TRANSFER_ENABLED}" != "1" - then - cecho "Transfering of saves is currently disabled." - cecho "Finish your game or end your character to play in latest version." - else - cecho "Your save cannot be tranferred though because of incompatibility." - cecho "Finish your game or end your character to play in latest version." - fi + fi + else + if test "${TRANSFER_ENABLED}" != "1" + then + cecho "Transfering of saves is currently disabled." + cecho "Finish your game or end your character to play in latest version." + else + cecho "Your save cannot be tranferred though because of incompatibility." + cecho "Finish your game or end your character to play in latest version." + fi cecho -n "--- any key to continue ---" - [[ -z "$WEBTILES" ]] && read -n 1 -t 5 -s - cecho - fi + [[ -z "$WEBTILES" ]] && read -n 1 -t 5 -s + cecho + fi fi else OUR_GAME_HASH="${LATEST_GAME_HASH}" diff --git a/chroot/bin/crawl-stable-launcher.sh b/chroot/bin/crawl-stable-launcher.sh index cca5ba42..c9f9525f 100755 --- a/chroot/bin/crawl-stable-launcher.sh +++ b/chroot/bin/crawl-stable-launcher.sh @@ -14,11 +14,11 @@ # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# along with this program. If not, see . # =========================================================================== # diff --git a/chroot/bin/init-webtiles.sh b/chroot/bin/init-webtiles.sh index 6b75424c..c1fae622 100755 --- a/chroot/bin/init-webtiles.sh +++ b/chroot/bin/init-webtiles.sh @@ -5,8 +5,8 @@ NAME=$1 VERSIONS="git $(seq 25 25 | sed 's/^/0./')" for v in $VERSIONS; do - cp --no-clobber "%%CHROOT_DGLDIR%%/data/crawl-$v-settings/init.txt" "%%CHROOT_RCFILESDIR%%/crawl-$v/$NAME.rc" - cp --no-clobber "%%CHROOT_DGLDIR%%/data/crawl-git.macro" "%%CHROOT_RCFILESDIR%%/crawl-$v/$NAME.macro" + cp --no-clobber "%%CHROOT_DGLDIR%%/data/crawl-$v-settings/init.txt" "%%CHROOT_RCFILESDIR%%/crawl-$v/$NAME.rc" + cp --no-clobber "%%CHROOT_DGLDIR%%/data/crawl-git.macro" "%%CHROOT_RCFILESDIR%%/crawl-$v/$NAME.macro" done cp --no-clobber "%%CHROOT_DGLDIR%%/data/crawl-dcssca-settings/init.txt" "%%CHROOT_RCFILESDIR%%/crawl-dcssca/$NAME.rc" diff --git a/chroot/bin/savegame-backup.sh b/chroot/bin/savegame-backup.sh index 1be82b1d..985d3547 100755 --- a/chroot/bin/savegame-backup.sh +++ b/chroot/bin/savegame-backup.sh @@ -11,11 +11,11 @@ # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# along with this program. If not, see . # =========================================================================== # @@ -58,7 +58,7 @@ savedir-containing() { local char="$1" local -a saves saves=($PREFIX/$BINARY_SAVE_NAME{,-*}/saves/$char{,-$USER_ID}.{cs,chr,sav}) - local savefile + local savefile savefile="$(first-existing-file "${saves[@]}")" [[ -n "$savefile" ]] && dirname "$savefile" return 0 @@ -131,14 +131,13 @@ if [[ -n "$SAVE_FOUND" && -f "$SAVE_FOUND" ]]; then if test $? -ne 0 then - echo -e " ${C_RED}failed!${C_NORMAL}" + echo -e " ${C_RED}failed!${C_NORMAL}" else - echo -e " ${C_GREEN}successful.${C_NORMAL}" - echo "- ${HTTP_LINK}/$TARNAME" - echo - echo "Please provide this link in your bug-report or give it to a developer." + echo -e " ${C_GREEN}successful.${C_NORMAL}" + echo "- ${HTTP_LINK}/$TARNAME" + echo + echo "Please provide this link in your bug-report or give it to a developer." fi else echo "Your character ($CHAR_NAME) was not found in $SAVES." fi - diff --git a/chroot/data/menus/crawl-0.25.txt b/chroot/data/menus/crawl-0.25.txt index 61ae7489..eadea354 100644 --- a/chroot/data/menus/crawl-0.25.txt +++ b/chroot/data/menus/crawl-0.25.txt @@ -20,4 +20,4 @@ A)dvanced options q) Return to main menu -=> +=> \ No newline at end of file diff --git a/chroot/data/menus/crawl-0.25_adv.txt b/chroot/data/menus/crawl-0.25_adv.txt index 92f5f446..069e3c7a 100644 --- a/chroot/data/menus/crawl-0.25_adv.txt +++ b/chroot/data/menus/crawl-0.25_adv.txt @@ -19,4 +19,4 @@ O) Reset options q) Return to previous menu -=> +=> \ No newline at end of file diff --git a/chroot/data/menus/crawl_git.txt b/chroot/data/menus/crawl_git.txt index ad01cba0..88d01fd8 100644 --- a/chroot/data/menus/crawl_git.txt +++ b/chroot/data/menus/crawl_git.txt @@ -20,4 +20,4 @@ A)dvanced options q) Return to main menu -=> +=> \ No newline at end of file diff --git a/chroot/data/menus/crawl_git_adv.txt b/chroot/data/menus/crawl_git_adv.txt index 7dda259c..00a0f21f 100644 --- a/chroot/data/menus/crawl_git_adv.txt +++ b/chroot/data/menus/crawl_git_adv.txt @@ -19,4 +19,4 @@ O) Reset options q) Return to previous menu -=> +=> \ No newline at end of file diff --git a/chroot/data/menus/experimental.txt b/chroot/data/menus/experimental.txt index 4c83d43b..a8798c63 100644 --- a/chroot/data/menus/experimental.txt +++ b/chroot/data/menus/experimental.txt @@ -15,4 +15,4 @@ without warning: don't get too attached to your character. Thanks for helping us evaluate potential new features! q) Return to trunk menu -=> +=> \ No newline at end of file diff --git a/chroot/data/menus/main_admin.txt b/chroot/data/menus/main_admin.txt index 881560fb..a2a7372e 100644 --- a/chroot/data/menus/main_admin.txt +++ b/chroot/data/menus/main_admin.txt @@ -20,4 +20,4 @@ G) GoonCrawl H) X-Crawl -=> +=> \ No newline at end of file diff --git a/chroot/data/menus/main_anon.txt b/chroot/data/menus/main_anon.txt index bb59a285..b57d935d 100644 --- a/chroot/data/menus/main_anon.txt +++ b/chroot/data/menus/main_anon.txt @@ -15,4 +15,4 @@ L) Login Q) Quit -=> +=> \ No newline at end of file diff --git a/chroot/data/menus/main_user.txt b/chroot/data/menus/main_user.txt index 09e638ae..196b6fbc 100644 --- a/chroot/data/menus/main_user.txt +++ b/chroot/data/menus/main_user.txt @@ -20,4 +20,4 @@ H) X-Crawl Z) Change password X) Change email address -=> +=> \ No newline at end of file diff --git a/chroot/sbin/install-stable.sh b/chroot/sbin/install-stable.sh index d0d327a9..bbfc592f 100755 --- a/chroot/sbin/install-stable.sh +++ b/chroot/sbin/install-stable.sh @@ -15,11 +15,11 @@ # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# along with this program. If not, see . # =========================================================================== # @@ -75,29 +75,29 @@ copy-data-files() { } create-dgl-directories() { - mkdir -p "$CHROOT/dgldir/inprogress/crawl-$VERSION-sprint/" - mkdir -p "$CHROOT/dgldir/inprogress/crawl-$VERSION-tut/" + mkdir -p "$CHROOT/dgldir/inprogress/crawl-$VERSION-sprint/" + mkdir -p "$CHROOT/dgldir/inprogress/crawl-$VERSION-tut/" mkdir -p "$CHROOT/dgldir/inprogress/crawl-$VERSION-descent/" - mkdir -p "$CHROOT/dgldir/inprogress/crawl-$VERSION-zotdef/" - mkdir -p "$CHROOT/dgldir/inprogress/crawl-$VERSION/" - mkdir -p "$CHROOT/dgldir/rcfiles/crawl-$VERSION/" - mkdir -p "$CHROOT/dgldir/data/crawl-$VERSION-settings/" + mkdir -p "$CHROOT/dgldir/inprogress/crawl-$VERSION-zotdef/" + mkdir -p "$CHROOT/dgldir/inprogress/crawl-$VERSION/" + mkdir -p "$CHROOT/dgldir/rcfiles/crawl-$VERSION/" + mkdir -p "$CHROOT/dgldir/data/crawl-$VERSION-settings/" } fix-chroot-directory-permissions() { - chown -R crawl:crawl "$CHROOT/crawl-master" - chown -R crawl:crawl "$CHROOT/dgldir" + chown -R crawl:crawl "$CHROOT/crawl-master" + chown -R crawl:crawl "$CHROOT/dgldir" } install-game() { mkdir -p $SAVEDIR/{,sprint,descent,zotdef} mkdir -p $DATADIR - create-dgl-directories - fix-chroot-directory-permissions + create-dgl-directories + fix-chroot-directory-permissions copy-game-binary copy-data-files - + chown -R $CRAWL_UGRP $SAVEDIR } diff --git a/chroot/sbin/install-trunk.sh b/chroot/sbin/install-trunk.sh index 91bd923a..e5dfebc6 100755 --- a/chroot/sbin/install-trunk.sh +++ b/chroot/sbin/install-trunk.sh @@ -15,11 +15,11 @@ # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# along with this program. If not, see . # =========================================================================== # @@ -109,7 +109,7 @@ install-game() { copy-game-binary copy-data-files link-logfiles - + chown -R $CRAWL_UGRP $SAVEDIR ln -snf $GAME_BINARY $CHROOT$CHROOT_CRAWL_BASEDIR/crawl-latest } @@ -178,7 +178,7 @@ if [[ -n "${SGV_MAJOR}" && -n "${SGV_MINOR}" ]]; then GAME_BINARY=$GAME-$REVISION BINARIES_DIR=$CHROOT$CHROOT_BINARIES - + WEBDIR=$CHROOT$CHROOT_CRAWL_BASEDIR/webserver GAMEDIR=$CHROOT$CHROOT_CRAWL_BASEDIR/$GAME_BINARY # Absolute path to save game directory diff --git a/chroot/sbin/remove-trunks.sh b/chroot/sbin/remove-trunks.sh index 024fe1a7..cc1820dd 100755 --- a/chroot/sbin/remove-trunks.sh +++ b/chroot/sbin/remove-trunks.sh @@ -11,11 +11,11 @@ # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# along with this program. If not, see . # =========================================================================== # @@ -103,47 +103,47 @@ list_hashes() cd $CHROOT/$BASE_DIR if verbose; then - echo "Date Version Amount Players" - echo "**************************************************************" + echo "Date Version Amount Players" + echo "**************************************************************" - for folder in $(savegame-dirs); do + for folder in $(savegame-dirs); do local hash=${folder/$GAME_BASE/} local version_detail="$(hash-version-detail $hash)" local save_count="$(count-saves-in-dir "$folder")" - /bin/ls -1tdl ${folder} 2>/dev/null | \ - sed "s/$GAME_BASE//g;" | \ - awk '{ printf "%3s %2s %s %17s %6s ", + /bin/ls -1tdl ${folder} 2>/dev/null | \ + sed "s/$GAME_BASE//g;" | \ + awk '{ printf "%3s %2s %s %17s %6s ", $6, $7, $8, "'"$version_detail"'", "'"$save_count"'" }' - for char in $(saves-in-dir "$folder" | strip-save-uid-extension) - do - echo -n "${char#$folder/saves/} " - done + for char in $(saves-in-dir "$folder" | strip-save-uid-extension) + do + echo -n "${char#$folder/saves/} " + done - echo - done + echo + done else - echo "Date Version Players in Games" - echo "*******************************************************************" + echo "Date Version Players in Games" + echo "*******************************************************************" - for folder in $(savegame-dirs) - do + for folder in $(savegame-dirs) + do local hash=${folder/$GAME_BASE/} local version_detail="$(hash-version-detail $hash)" local save_count="$(count-saves-in-dir "$folder" '')" local sprint_save_count="$(count-saves-in-dir "$folder" 'sprint')" local zotdef_save_count="$(count-saves-in-dir "$folder" 'zotdef')" - /bin/ls -1tdl ${folder} 2>/dev/null | \ - sed "s/$GAME_BASE//g;" | \ - awk '{ printf "%3s %2s %s %17s %6s in trunk, %3s in sprint, %3s in zotdef", $6, $7, $8, + /bin/ls -1tdl ${folder} 2>/dev/null | \ + sed "s/$GAME_BASE//g;" | \ + awk '{ printf "%3s %2s %s %17s %6s in trunk, %3s in sprint, %3s in zotdef", $6, $7, $8, "'"$version_detail"'", "'"$save_count"'", "'"$sprint_save_count"'", "'"$zotdef_save_count"'" }' - echo - done + echo + done fi } @@ -152,8 +152,8 @@ PARAMS="$(echo "$*" | sed 's/[$*\/();|+]//g')" if test $# -eq 0 then if prompts-enabled; then - echo "Usage: $(basename $0) [-q] [-v] [hash] [hash] ..." - echo + echo "Usage: $(basename $0) [-q] [-v] [hash] [hash] ..." + echo fi list_hashes echo @@ -179,34 +179,34 @@ do echo "$GAME_SAVEDIR contains save games, use -f to delete anyway" exit 1 fi - - if prompts-enabled; then - while { ps -fC $GAME_VER | awk '{ print $1" "$2"\t "$5" "$7"\t "$8" "$9" "$10 }' | grep ^"$DGL_USER"; } - do - echo "There are still active crawl processes running..." - echo "-- Press RETURN to try again --" - read - done - - echo "Removing ${version} from repository..." - echo "delete from versions where hash=\"${version}\";"| sqlite3 ${VERSIONS_DB} - rm $BINPATH/$GAME_VER - rm -r $BASE_DIR/$GAME_VER - else - if { ps -fC $GAME_VER | awk '{ print $1" "$2"\t "$5" "$7"\t "$8" "$9" "$10 }' | grep ^"$DGL_USER" >/dev/null; } - then - echo "Revision ${version} is being played..." - else - echo "Removing ${version} from repository..." - echo "delete from versions where hash=\"${version}\";"| sqlite3 ${VERSIONS_DB} - rm $BINPATH/$GAME_VER - rm -r $BASE_DIR/$GAME_VER - fi - fi + + if prompts-enabled; then + while { ps -fC $GAME_VER | awk '{ print $1" "$2"\t "$5" "$7"\t "$8" "$9" "$10 }' | grep ^"$DGL_USER"; } + do + echo "There are still active crawl processes running..." + echo "-- Press RETURN to try again --" + read + done + + echo "Removing ${version} from repository..." + echo "delete from versions where hash=\"${version}\";"| sqlite3 ${VERSIONS_DB} + rm $BINPATH/$GAME_VER + rm -r $BASE_DIR/$GAME_VER + else + if { ps -fC $GAME_VER | awk '{ print $1" "$2"\t "$5" "$7"\t "$8" "$9" "$10 }' | grep ^"$DGL_USER" >/dev/null; } + then + echo "Revision ${version} is being played..." + else + echo "Removing ${version} from repository..." + echo "delete from versions where hash=\"${version}\";"| sqlite3 ${VERSIONS_DB} + rm $BINPATH/$GAME_VER + rm -r $BASE_DIR/$GAME_VER + fi + fi else - echo "Revision ${version} not found..." + echo "Revision ${version} not found..." fi done echo -exit 0 \ No newline at end of file +exit 0 diff --git a/chroot/sbin/savegame-transfer.sh b/chroot/sbin/savegame-transfer.sh index 164e0fed..e9badfe8 100755 --- a/chroot/sbin/savegame-transfer.sh +++ b/chroot/sbin/savegame-transfer.sh @@ -11,11 +11,11 @@ # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# along with this program. If not, see . # =========================================================================== # @@ -37,9 +37,9 @@ PARAMS="$(echo "$*" | sed 's/[$*\();.|+-]//g')" if test ${#PARAMS} -eq 0 then - $(dirname $0)/remove-trunks.sh -v | grep -v "Usage:" - echo "Usage: $(basename $0) [charname] ..." - exit 1 + $(dirname $0)/remove-trunks.sh -v | grep -v "Usage:" + echo "Usage: $(basename $0) [charname] ..." + exit 1 fi LATEST_GAME_HASH="$(echo "select hash from versions order by time desc limit 1;" | sqlite3 ${VERSIONS_DB})" @@ -49,61 +49,61 @@ do CHAR_NAME="${char}" GAME_MODE="" PS_MOD="rc" - + SAVE_FOUND="$(/bin/ls -1rt ${PREFIX}/${BINARY_MAIN_NAME}-*/saves/${CHAR_NAME}-${USER_ID}.sav ${PREFIX}/${BINARY_MAIN_NAME}-*/saves/${CHAR_NAME}-${USER_ID}.chr ${PREFIX}/${BINARY_MAIN_NAME}-*/saves/${CHAR_NAME}{-${USER_ID},}.cs 2>/dev/null | head -n 1)" if test ${#SAVE_FOUND} -ne 0 then - OUR_GAME_HASH="$(echo ${SAVE_FOUND} | sed "s|${PREFIX}/${BINARY_MAIN_NAME}-\(.*\)/saves/${CHAR_NAME}.*|\1|")" - OUR_GAME_SV="$(echo select major,minor from versions where hash=\"${OUR_GAME_HASH}\"\; | sqlite3 -separator \. ${VERSIONS_DB})" - echo -n "Char \"${CHAR_NAME}\" in ${OUR_GAME_HASH} (${OUR_GAME_SV}). " - - if test "${OUR_GAME_HASH}" != "${LATEST_GAME_HASH}" - then - OUR_SGV_MAJOR="$(echo "select major from versions where hash=\"${OUR_GAME_HASH}\";" | sqlite3 ${VERSIONS_DB})" - POSSIBLE_GAME_HASH="$(echo "select hash from versions where major=${OUR_SGV_MAJOR} order by time desc limit 1;" | sqlite3 ${VERSIONS_DB})" - - if test "${OUR_GAME_HASH}" != "${POSSIBLE_GAME_HASH}" - then - POSSIBLE_GAME_SV="$(echo select major,minor from versions where hash=\"${POSSIBLE_GAME_HASH}\"\; | sqlite3 -separator \. ${VERSIONS_DB})" - echo -n "Moving to ${POSSIBLE_GAME_HASH} (${POSSIBLE_GAME_SV}):" - - if test "$(basename ${CHAR_NAME})" != "${CHAR_NAME}" - then - GAME_MODE="$(dirname ${CHAR_NAME})" - CHAR_NAME="$(basename ${CHAR_NAME})" - PS_MOD="${GAME_MODE}" - fi - - if { ps -fC ${BINARY_MAIN_NAME}-${OUR_GAME_HASH} | awk '{ print $8, $9, $10, $11 }' | grep "\-name ${CHAR_NAME} \-${PS_MOD}" &>/dev/null; } - then - echo -e " ${C_YELLOW}in use!${C_NORMAL}" - continue - fi - - if test -d ${PREFIX}/${BINARY_MAIN_NAME}-${POSSIBLE_GAME_HASH}/saves/${GAME_MODE} - then - mv -n ${PREFIX}/${BINARY_MAIN_NAME}-${OUR_GAME_HASH}/saves/${GAME_MODE}/${CHAR_NAME}* ${PREFIX}/${BINARY_MAIN_NAME}-${OUR_GAME_HASH}/saves/${GAME_MODE}/start-${CHAR_NAME}-ns.prf ${PREFIX}/${BINARY_MAIN_NAME}-${POSSIBLE_GAME_HASH}/saves/${GAME_MODE}/ - if test $? -eq 0 - then - echo -e " ${C_GREEN}successful.${C_NORMAL}" - else - echo -e " ${C_RED}failed1!${C_NORMAL}" - continue - fi - - else - echo -e " ${C_RED}failed2!${C_NORMAL}" - continue - fi - else - echo -e "${C_YELLOW}No transfer possible.${C_NORMAL}" - fi - else - echo "No transfer necessary." - fi + OUR_GAME_HASH="$(echo ${SAVE_FOUND} | sed "s|${PREFIX}/${BINARY_MAIN_NAME}-\(.*\)/saves/${CHAR_NAME}.*|\1|")" + OUR_GAME_SV="$(echo select major,minor from versions where hash=\"${OUR_GAME_HASH}\"\; | sqlite3 -separator \. ${VERSIONS_DB})" + echo -n "Char \"${CHAR_NAME}\" in ${OUR_GAME_HASH} (${OUR_GAME_SV}). " + + if test "${OUR_GAME_HASH}" != "${LATEST_GAME_HASH}" + then + OUR_SGV_MAJOR="$(echo "select major from versions where hash=\"${OUR_GAME_HASH}\";" | sqlite3 ${VERSIONS_DB})" + POSSIBLE_GAME_HASH="$(echo "select hash from versions where major=${OUR_SGV_MAJOR} order by time desc limit 1;" | sqlite3 ${VERSIONS_DB})" + + if test "${OUR_GAME_HASH}" != "${POSSIBLE_GAME_HASH}" + then + POSSIBLE_GAME_SV="$(echo select major,minor from versions where hash=\"${POSSIBLE_GAME_HASH}\"\; | sqlite3 -separator \. ${VERSIONS_DB})" + echo -n "Moving to ${POSSIBLE_GAME_HASH} (${POSSIBLE_GAME_SV}):" + + if test "$(basename ${CHAR_NAME})" != "${CHAR_NAME}" + then + GAME_MODE="$(dirname ${CHAR_NAME})" + CHAR_NAME="$(basename ${CHAR_NAME})" + PS_MOD="${GAME_MODE}" + fi + + if { ps -fC ${BINARY_MAIN_NAME}-${OUR_GAME_HASH} | awk '{ print $8, $9, $10, $11 }' | grep "\-name ${CHAR_NAME} \-${PS_MOD}" &>/dev/null; } + then + echo -e " ${C_YELLOW}in use!${C_NORMAL}" + continue + fi + + if test -d ${PREFIX}/${BINARY_MAIN_NAME}-${POSSIBLE_GAME_HASH}/saves/${GAME_MODE} + then + mv -n ${PREFIX}/${BINARY_MAIN_NAME}-${OUR_GAME_HASH}/saves/${GAME_MODE}/${CHAR_NAME}* ${PREFIX}/${BINARY_MAIN_NAME}-${POSSIBLE_GAME_HASH}/saves/${GAME_MODE}/ + if test $? -eq 0 + then + echo -e " ${C_GREEN}successful.${C_NORMAL}" + else + echo -e " ${C_RED}failed1!${C_NORMAL}" + continue + fi + + else + echo -e " ${C_RED}failed2!${C_NORMAL}" + continue + fi + else + echo -e "${C_YELLOW}No transfer possible.${C_NORMAL}" + fi + else + echo "No transfer necessary." + fi else - echo "Character \"${CHAR_NAME}\" not found." + echo "Character \"${CHAR_NAME}\" not found." fi done diff --git a/config.py b/config.py index b95265bd..c2d183a4 100644 --- a/config.py +++ b/config.py @@ -292,7 +292,7 @@ # If false, use traditional DES (but then only the first eight characters # are significant). crypt_algorithm = "6" -# If crypt_algorithm is true, the length of the salt string to use. If +# If crypt_algorithm is true, the length of the salt string to use. If # crypt_algorithm is false, a two-character salt is used. crypt_salt_length = 16 diff --git a/crawl-build/update-crawl-trunk-build.sh b/crawl-build/update-crawl-trunk-build.sh index 93bb3fbf..17bcc491 100755 --- a/crawl-build/update-crawl-trunk-build.sh +++ b/crawl-build/update-crawl-trunk-build.sh @@ -68,7 +68,7 @@ if [[ "$(uname)" != "Darwin" ]] && { ps -fC ${GAME}-${REVISION} | awk '{ print $1" "$2"\t "$5" "$7"\t "$8" "$9" "$10 }' | grep ^"$DGL_USER"; - } + } then abort-saying "There are already active instances of this version (${REVISION_FULL}) running" fi diff --git a/crawl-git.conf b/crawl-git.conf index 960d214b..4fc8e031 100644 --- a/crawl-git.conf +++ b/crawl-git.conf @@ -8,7 +8,7 @@ export GAME="crawl-git" CRAWL_BUILD_DIR=$DGL_CONF_HOME/crawl-build CRAWL_REPOSITORY_DIR=crawl-git-repository CRAWL_REPO=$DGL_CONF_HOME/crawl-build/$CRAWL_REPOSITORY_DIR -CRAWL_GIT_URL=git://github.com/crawl/crawl.git +CRAWL_GIT_URL=https://github.com/crawl/crawl.git export CHROOT_CRAWL_BINARY_PATH="/usr/games" export CRAWL_BINARY_PATH="$DGL_CHROOT$CHROOT_CRAWL_BINARY_PATH" diff --git a/dgamelaunch.conf b/dgamelaunch.conf index aaa6f2c2..c687e943 100644 --- a/dgamelaunch.conf +++ b/dgamelaunch.conf @@ -35,7 +35,7 @@ server_id = "DCSS Fork Collection" # $SERVERID replaced with the server_id string, as defined above. banner = "%%CHROOT_DGLDIR%%/data/dgl-banner" -# The following two options are fairly insecure. They will force us to +# The following two options are fairly insecure. They will force us to # load the password/group database into memory while still having root # privileges. Replace them with shed_uid/shed_gid entries as soon as # possible if you decide to use them. dgamelaunch will inform you of @@ -520,13 +520,13 @@ DEFINE { game_name = "Crawl (trunk)" short_name = "dcss-git" - game_args = "/bin/crawl-git-launcher.sh", + game_args = "/bin/crawl-git-launcher.sh", "-name", "%n", "-rc", "%rrcfiles/crawl-git/%n.rc", "-macro", "%rrcfiles/crawl-git/%n.macro", "-webtiles-socket", "%%CHROOT_CRAWL_BASEDIR%%/webserver/sockets/%n:dcss-git.sock", "-morgue", "%rmorgue/%n/" - + extra_info_file = "%rmorgue/%n/%n.dglwhere" # @@ -558,14 +558,14 @@ DEFINE { game_name = "Sprint (trunk)" short_name = "spr-git" - game_args = "/bin/crawl-git-launcher.sh", + game_args = "/bin/crawl-git-launcher.sh", "-name", "%n", "-rc", "%rrcfiles/crawl-git/%n.rc", "-macro", "%rrcfiles/crawl-git/%n.macro", "-webtiles-socket", "%%CHROOT_CRAWL_BASEDIR%%/webserver/sockets/%n:spr-git.sock", "-morgue", "%rmorgue/%n/", "-sprint" - + extra_info_file = "%rmorgue/%n/%n.dglwhere" # @@ -597,14 +597,14 @@ DEFINE { game_name = "Tutorial (trunk)" short_name = "tut-git" - game_args = "/bin/crawl-git-launcher.sh", + game_args = "/bin/crawl-git-launcher.sh", "-name", "%n", "-rc", "%rrcfiles/crawl-git/%n.rc", "-macro", "%rrcfiles/crawl-git/%n.macro", "-webtiles-socket", "%%CHROOT_CRAWL_BASEDIR%%/webserver/sockets/%n:tut-git.sock", "-morgue", "%rmorgue/%n/", "-tutorial" - + extra_info_file = "%rmorgue/%n/%n.dglwhere" # @@ -964,7 +964,7 @@ DEFINE { "-macro", "%rrcfiles/crawl-stoatsoup/%n.macro", "-webtiles-socket", "%%CHROOT_CRAWL_BASEDIR%%/webserver/sockets/%n:stoatsoup.sock", "-morgue", "%rmorgue/%n/" - + extra_info_file = "%rmorgue/%n/%n.dglwhere" # @@ -1069,5 +1069,3 @@ DEFINE { encoding = "UTF-8" } - - diff --git a/games.d/base.yaml b/games.d/base.yaml new file mode 100644 index 00000000..d87e8fb4 --- /dev/null +++ b/games.d/base.yaml @@ -0,0 +1,2 @@ +# Empty yml file for the default dgamelaunch-config setup + diff --git a/help/admin.txt b/help/admin.txt index 26290736..c73f0f68 100644 --- a/help/admin.txt +++ b/help/admin.txt @@ -4,4 +4,3 @@ dgl admin: Manages dgamelaunch admin users. Usage: dgl admin ls List admin users dgl admin add Make an admin dgl admin rm Make a regular (non-admin) user. - diff --git a/utils/testing-container/Dockerfile b/utils/testing-container/Dockerfile index a78c4fd4..a0012408 100644 --- a/utils/testing-container/Dockerfile +++ b/utils/testing-container/Dockerfile @@ -53,9 +53,7 @@ WORKDIR /home/crawl-dev # TODO: what are these directories in ~crawl-dev used for? `run` doesn't exist # on CAO? -RUN git config --global url."https://github".insteadOf git://github -RUN git config --global url."https://github.com".insteadOf "git://gitorious.org" - +RUN git config --global url.https://github.com/.insteadOf git://github.com/ # The unauthenticated git protocol on port 9418 is no longer supported. USER crawl-dev RUN mkdir logs \ @@ -87,6 +85,7 @@ COPY --chown=crawl-dev:crawl-dev ./chroot /home/crawl-dev/dgamelaunch-config/chr COPY --chown=crawl-dev:crawl-dev ./crawl-build /home/crawl-dev/dgamelaunch-config/crawl-build/ COPY --chown=crawl-dev:crawl-dev ./help /home/crawl-dev/dgamelaunch-config/help/ COPY --chown=crawl-dev:crawl-dev ./lib /home/crawl-dev/dgamelaunch-config/lib/ +COPY --chown=crawl-dev:crawl-dev ./games.d /home/crawl-dev/dgamelaunch-config/games.d/ COPY --chown=crawl-dev:crawl-dev ./config.py ./crawl-git.conf ./dgamelaunch.conf ./dgl-manage.conf sh-utils /home/crawl-dev/dgamelaunch-config/ COPY --chown=crawl-dev:crawl-dev ./utils/webtiles ./utils/trigger-rebuild.pl ./utils/auth-save-downloader.pl /home/crawl-dev/dgamelaunch-config/utils/ RUN ls -al && sed -i -e 's/"127.0.0.1"/"0.0.0.0"/' /home/crawl-dev/dgamelaunch-config/config.py diff --git a/utils/trigger-rebuild.pl b/utils/trigger-rebuild.pl index e1d3947d..66c472b3 100755 --- a/utils/trigger-rebuild.pl +++ b/utils/trigger-rebuild.pl @@ -180,4 +180,3 @@ () } main(); -