Skip to content

Commit a177345

Browse files
authored
Merge pull request #3 from Rytisgit/feature/merge_crawl_origin
Feature/merge crawl origin
2 parents cfe71d7 + 4b539e4 commit a177345

34 files changed

+239
-224
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ itself
6161
2. `dgl create-chroot` command to set up a basic chroot jail with all the
6262
fixtures dgamelaunch wants (dgamelaunch already has a skeleton script
6363
that can serve as a basis, although this is unfortunately NetHack-biased).
64-
64+
6565
3. Support for installing different games, including fetching their sources
6666
from their respective source repositories, compiling, installing into the
6767
chroot, etc.

bin/compress-ttyrecs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ for ttyrec in "$TTYRECDIR"/*/*.ttyrec; do
3333
continue
3434
fi
3535
if bzip2 "$ttyrec"; then
36-
(( ++succ ))
36+
(( ++succ ))
3737
verbiate -n "+"
3838
else
3939
(( ++fail ))

bin/passwd.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ change-password() {
4242
local password_clear="$2"
4343

4444
assert-password-safe "$password_clear"
45-
local password_crypt
45+
local password_crypt
4646
password_crypt="$(perl -le 'print crypt($ARGV[0], substr($ARGV[0], 0, 2))' "$password_clear")"
4747
sqlite3 "$LOGIN_DB" <<EOF
4848
UPDATE dglusers
@@ -53,7 +53,7 @@ EOF
5353

5454
assert-sane-user-match() {
5555
local user=$1
56-
local count
56+
local count
5757
count=$(count-users "$user")
5858
if (( count != 1 )); then
5959
if (( count == 0 )); then
@@ -63,7 +63,7 @@ assert-sane-user-match() {
6363
fi
6464
fi
6565
}
66-
66+
6767
USER=$1
6868
assert-sane-user-match "$USER"
6969

bin/publish-conf.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@
55

66
# assert-chroot-exists
77
set -- "--confirm" "--match" "dgamelaunch.conf" "$@"
8-
# shellcheck source=crawl-git.conf
9-
source "$DGL_CONF_HOME/crawl-git.conf"
8+
source "$DGL_CONF_HOME/bin/publish.sh"

bin/publish-scripts.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@
55

66
# assert-chroot-exists
77
set -- "--confirm" "--skip" "dgamelaunch.conf" "$@"
8-
# shellcheck source=crawl-git.conf
9-
source "$DGL_CONF_HOME/crawl-git.conf"
8+
source "$DGL_CONF_HOME/bin/publish.sh"

bin/publish.pl

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,29 @@
2626
[ 'utils/trigger-rebuild.pl', '//usr/lib/cgi-bin' ],
2727
[ 'utils/webtiles', '//etc/init.d' ],
2828
[ 'config.py', "/crawl-master/webserver" ],
29+
[ 'config.yml', "/crawl-master/webserver" ],
30+
[ 'games.d/*.{yml,yaml}', "/crawl-master/webserver/games.d" ],
31+
[ 'banned_players.yml', "/crawl-master/webserver" ],
32+
[ 'banned_players.txt', "/crawl-master/webserver" ],
2933
[ 'chroot/data/menus/*.txt', "/dgldir/data/menus" ],
3034
[ 'chroot/data/*.{rc,macro}', "/dgldir/data" ],
3135
[ 'chroot/bin/*.sh', '/bin' ],
3236
[ 'chroot/sbin/*.sh', '/sbin' ]);
3337

38+
# if a file is in this list, it will be ignored if it doesn't exist, rather
39+
# than erroring. globs not expanded.
40+
my @OPTIONAL_TARGETS = ('config.yml',
41+
'banned_players.yml',
42+
'banned_players.txt');
43+
my @optional_skipped = ();
44+
45+
foreach my $targ ( @OPTIONAL_TARGETS ) {
46+
if (! -e $targ) {
47+
@COPY_TARGETS = grep($$_[0] !~ /\Q$targ/, @COPY_TARGETS);
48+
push(@optional_skipped, $targ);
49+
}
50+
}
51+
3452
if ($OPT{match}) {
3553
@COPY_TARGETS = grep($$_[0] =~ /\Q$OPT{match}/, @COPY_TARGETS);
3654
}
@@ -120,6 +138,9 @@ ()
120138
print("$index) $summary\n");
121139
$dirty = 1 if change_exists($stat);
122140
}
141+
if (@optional_skipped > 0) {
142+
print("Skipping optional files: @optional_skipped");
143+
}
123144
$dirty
124145
}
125146

bin/remove-trunks.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
#!/bin/bash
22

33
sudo -H "$DGL_CHROOT/sbin/remove-trunks.sh" $*
4-

bin/savegame-transfer-all.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,3 @@ for char in ${ALL_CHARS}
3030
do
3131
dgl savegame-transfer "${char}"
3232
done
33-

chroot/bin/crawl-git-launcher.sh

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
#
1515
# This program is distributed in the hope that it will be useful,
1616
# but WITHOUT ANY WARRANTY; without even the implied warranty of
17-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1818
# GNU Affero General Public License for more details.
1919
#
2020
# You should have received a copy of the GNU Affero General Public License
21-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
21+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
2222
# ===========================================================================
2323
#
2424

@@ -146,54 +146,54 @@ transfer-save() {
146146
local game_hash=$2
147147
local target="$CRAWL_GIT_DIR/$BINARY_BASE_NAME-$game_hash/$SAVES"
148148
local src_save_dir=$(dirname $save)
149-
149+
150150
wecho -n '{"msg":"show_dialog", "html":"'
151-
151+
152152
if [[ -d "$target" ]]; then
153153
# It's okay if moving the .prf fails (it might not exist one day).
154154
mv "$src_save_dir/start-$CHAR_NAME-ns.prf" "$target" 2>/dev/null || true
155155
mv -n "$src_save_dir/$CHAR_NAME".cs "$target"
156156

157-
if test $? -eq 0
158-
then
157+
if test $? -eq 0
158+
then
159159
wcat <<EOF
160160
<p>Transferring successful!</p>
161161
<input type='button' class='button' data-key=' ' value='Continue' style='float:right;'>
162162
"}
163163
EOF
164-
cecho ": successful!"
165-
cecho
166-
OUR_GAME_HASH="${game_hash}"
164+
cecho ": successful!"
165+
cecho
166+
OUR_GAME_HASH="${game_hash}"
167167
cecho -n "--- any key to continue ---"
168-
read -n 1 -t 5 -s
169-
cecho
170-
else
168+
read -n 1 -t 5 -s
169+
cecho
170+
else
171171
wcat <<EOF
172172
<p>Transferring failed!</p>
173173
<p>Transferring your save failed! Continuing with former version.</p>
174174
<input type='button' class='button' data-key=' ' value='Continue' style='float:right;'>
175175
"}
176176
EOF
177-
cecho ": failed!"
178-
cecho
179-
cecho "Transferring your save failed! Continuing with former version."
177+
cecho ": failed!"
178+
cecho
179+
cecho "Transferring your save failed! Continuing with former version."
180180
cecho -n "--- any key to continue ---"
181-
read -n 1 -s
182-
cecho
183-
fi
181+
read -n 1 -s
182+
cecho
183+
fi
184184
else
185185
wcat <<EOF
186186
<p>Transferring failed!</p>
187187
<p>Target version is corrupt! Continuing with former version.</p>
188188
<input type='button' class='button' data-key=' ' value='Continue' style='float:right;'>
189189
"}
190190
EOF
191-
cecho ": failed!"
192-
cecho
193-
cecho "Target version is corrupt! Continuing with former version."
191+
cecho ": failed!"
192+
cecho
193+
cecho "Target version is corrupt! Continuing with former version."
194194
cecho -n "--- any key to continue ---"
195-
read -n 1 -s
196-
cecho
195+
read -n 1 -s
196+
cecho
197197
fi
198198
wecho '{"msg":"hide_dialog"}'
199199
}
@@ -217,19 +217,19 @@ if [[ -n "$SAVE" ]]; then
217217
then
218218
current_ver="$(hash-description $OUR_GAME_HASH)"
219219
cecho "Hi, you have a $current_ver save game:"
220-
cecho
220+
cecho
221221

222-
OUR_SGV_MAJOR="$(major-version-for-game $OUR_GAME_HASH)"
223-
NEW_GAME_HASH="$(newest-version-with-major-version $OUR_SGV_MAJOR)"
222+
OUR_SGV_MAJOR="$(major-version-for-game $OUR_GAME_HASH)"
223+
NEW_GAME_HASH="$(newest-version-with-major-version $OUR_SGV_MAJOR)"
224224
new_ver="$(hash-description $NEW_GAME_HASH)"
225225

226226
if [[ "$OUR_GAME_HASH" != "$NEW_GAME_HASH" &&
227227
"$TRANSFER_ENABLED" == "1" ]]; then
228228
wecho '{"msg":"layer", "layer":"crt"}'
229229
wecho -n '{"msg":"show_dialog", "html":"'
230230

231-
if [[ "${NEW_GAME_HASH}" != "${LATEST_GAME_HASH}" ]]; then
232-
cecho "There's a newer version ($new_ver) that can load your save."
231+
if [[ "${NEW_GAME_HASH}" != "${LATEST_GAME_HASH}" ]]; then
232+
cecho "There's a newer version ($new_ver) that can load your save."
233233
cecho -n "[T]ransfer your save to this version?"
234234
wcat <<EOF
235235
<p>There's a newer version ($new_ver) that can load your save.</p>
@@ -239,39 +239,39 @@ if [[ -n "$SAVE" ]]; then
239239
"}
240240
EOF
241241
read -n 1 -s REPLY
242-
cecho
243-
else
242+
cecho
243+
else
244244
cecho -n "[T]ransfer your save to the latest version ($new_ver)?"
245245
wcat <<EOF
246246
<p>[T]ransfer your save to the latest version ($new_ver)?</p>
247247
<input type='button' class='button' data-key='N' value='No' style='float:right;'>
248248
<input type='button' class='button' data-key='T' value='Yes' style='float:right;'>
249249
"}
250250
EOF
251-
read -n 1 -s REPLY
252-
cecho
253-
fi
251+
read -n 1 -s REPLY
252+
cecho
253+
fi
254254
wecho '{"msg":"hide_dialog"}'
255255

256-
if test "$REPLY" = "t" -o "$REPLY" = "T" -o "$REPLY" = "y" -o "$REPLY" = "Y"
257-
then
258-
cecho -n "Transferring..."
256+
if test "$REPLY" = "t" -o "$REPLY" = "T" -o "$REPLY" = "y" -o "$REPLY" = "Y"
257+
then
258+
cecho -n "Transferring..."
259259
transfer-save "$SAVE" "$NEW_GAME_HASH"
260-
fi
261-
else
262-
if test "${TRANSFER_ENABLED}" != "1"
263-
then
264-
cecho "Transfering of saves is currently disabled."
265-
cecho "Finish your game or end your character to play in latest version."
266-
else
267-
cecho "Your save cannot be tranferred though because of incompatibility."
268-
cecho "Finish your game or end your character to play in latest version."
269-
fi
260+
fi
261+
else
262+
if test "${TRANSFER_ENABLED}" != "1"
263+
then
264+
cecho "Transfering of saves is currently disabled."
265+
cecho "Finish your game or end your character to play in latest version."
266+
else
267+
cecho "Your save cannot be tranferred though because of incompatibility."
268+
cecho "Finish your game or end your character to play in latest version."
269+
fi
270270

271271
cecho -n "--- any key to continue ---"
272-
[[ -z "$WEBTILES" ]] && read -n 1 -t 5 -s
273-
cecho
274-
fi
272+
[[ -z "$WEBTILES" ]] && read -n 1 -t 5 -s
273+
cecho
274+
fi
275275
fi
276276
else
277277
OUR_GAME_HASH="${LATEST_GAME_HASH}"

chroot/bin/crawl-stable-launcher.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
#
1515
# This program is distributed in the hope that it will be useful,
1616
# but WITHOUT ANY WARRANTY; without even the implied warranty of
17-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1818
# GNU Affero General Public License for more details.
1919
#
2020
# You should have received a copy of the GNU Affero General Public License
21-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
21+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
2222
# ===========================================================================
2323
#
2424

0 commit comments

Comments
 (0)