• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Experimental package creation tool for MinGW.org


コミットメタ情報

リビジョン124bb57b04fa0d6f7c254478fb66b1238b953191 (tree)
日時2022-03-11 05:46:28
作者Keith Marshall <keith@user...>
コミッターKeith Marshall

ログメッセージ

Avoid accidental overwrite of pkgspec files.

* src/modules/options.sh (OUTPUT_STREAMING_OPTION): Rename as...
(write_stdout): ...this; set value to "true", when applicable.

* src/modules/mkspec.sh (write_stdout): Evaluate it.
(SPECSFILE_DIR, SPECSFILE): Identify pkgspec file as a composite of
this pair of shell variables; do NOT include any contribution from...
(RELEASE): ...this additional variable, even if it is assigned.
[! write_stdout]: Test for prior existence of pkgspec file;
abort when already present.

変更サマリ

差分

--- a/src/modules/mkspec.sh
+++ b/src/modules/mkspec.sh
@@ -32,10 +32,18 @@
3232 #
3333 # -----------------------------------------------------------------------------
3434 #
35-( test "${OUTPUT_STREAMING_OPTION+"set"}" = set || {
36- mkdir -p ${PACKAGE_SRCDIR-"."}/arch/${ARCH-"mingw32"}
37- SPECSFILE=$PACKAGE-$VERSION${RELEASE+"-$RELEASE"}${ARCH+"-$ARCH"}.pkgspec
38- exec > ${PACKAGE_SRCDIR-"."}/arch/${ARCH-"mingw32"}/$SPECSFILE
35+ local SPECSFILE SPECSFILE_DIR
36+ SPECSFILE_DIR=${PACKAGE_SRCDIR-"."}/arch/${ARCH-"mingw32"}
37+ SPECSFILE=$PACKAGE-$VERSION${ARCH+"-$ARCH"}.pkgspec
38+ ${write_stdout=false} || {
39+ test -e "$SPECSFILE_DIR/$SPECSFILE" && {
40+ error "file '$SPECSFILE' already exists"; exit 1
41+ }
42+ }
43+#
44+( $write_stdout || {
45+ mkdir -p "$SPECSFILE_DIR"
46+ exec > "$SPECSFILE_DIR/$SPECSFILE"
3947 }
4048
4149 test "${RELEASE+"set"}" = set && RELEASE_PREFIX="" || RELEASE_PREFIX="# "
--- a/src/modules/options.sh
+++ b/src/modules/options.sh
@@ -47,7 +47,7 @@
4747 opteval_verbose() { OPTION_VERBOSE=true; }
4848
4949 optdefine c stdout
50- opteval_stdout() { OUTPUT_STREAMING_OPTION=stdout; }
50+ opteval_stdout() { write_stdout=true; }
5151
5252 optdefine option requires_argument
5353 opteval_option() { option $optarg; }