New submission from Ben Franksen <[email protected]>:

3 patches for repository https://darcs.net/screened:

patch 030dd48b9dd2b31f439e364794f0a235a6892970
Author: Ben Franksen <[email protected]>
Date:   Tue Jan  7 12:38:30 CET 2025
  * allow to override global cache location by setting DARCS_CACHE_DIR

  The primary use case is to have a simple portable method to determine the
  global cache directory when running regression tests. However, its use is
  not necessarily limited to testing.

patch b9f0187d405c61399412f0c7f03187e446bd3faa
Author: Ben Franksen <[email protected]>
Date:   Tue Jan  7 12:54:45 CET 2025
  * use DARCS_CACHE_DIR in the test suite

patch 16b72b4996698e017c140366a17e747ca9575523
Author: Ben Franksen <[email protected]>
Date:   Sun Jul 14 11:50:26 CEST 2024
  * tests/failing-pristine-problems.sh is no longer failing

  We just have to take into account that pristine files may be provided by the
  cache, so we have to remove them there as well to make `darcs check` fail.

----------
files: 
allow-to-override-global-cache-location-by-setting-darcs_cache_dir.dpatch, 
patch-preview.txt
messages: 24153
nosy: bfrk
status: needs-screening
title: allow to override global cache location ... (and 2 more)

__________________________________
Darcs bug tracker <[email protected]>
<https://bugs.darcs.net/patch2446>
__________________________________
[allow to override global cache location by setting DARCS_CACHE_DIR
Ben Franksen <[email protected]>**20250107113830
 Ignore-this: f583a19feb90b580b079d94006a3e35faeed35585934153c741d5e97ff083e0160df686f16a85647
 
 The primary use case is to have a simple portable method to determine the
 global cache directory when running regression tests. However, its use is
 not necessarily limited to testing.
] hunk ./src/Darcs/Repository/Prefs.hs 303
-globalCacheDir | windows   = ((</> "cache2") `fmap`) `fmap` globalPrefsDir
-               | osx       = ((</> "darcs") `fmap`) `fmap` osxCacheDir
-               | otherwise = ((</> "darcs") `fmap`) `fmap` xdgCacheDir
+globalCacheDir = do
+    env <- getEnvironment
+    case lookup "DARCS_CACHE_DIR" env of
+      Nothing
+        | windows   -> ((</> "cache2") `fmap`) `fmap` globalPrefsDir
+        | osx       -> ((</> "darcs") `fmap`) `fmap` osxCacheDir
+        | otherwise -> ((</> "darcs") `fmap`) `fmap` xdgCacheDir
+      d -> return d
hunk ./src/Darcs/Repository/Prefs.hs 759
-      , "or `$XDG_CACHE_HOME/darcs` if the environment variable is set, see"
+      , "or `$DARCS_CACHE_DIR` if the environment variable is set,"
+      , "or else `$XDG_CACHE_HOME/darcs` if the environment variable is set, see"

[use DARCS_CACHE_DIR in the test suite
Ben Franksen <[email protected]>**20250107115445
 Ignore-this: 9b004898136ed57f107db1dcb031266ce5f6e20ccaed41824510c5c729d61646a213c3bc49ec277b
] 
<
[allow to override global cache location by setting DARCS_CACHE_DIR
Ben Franksen <[email protected]>**20250107113830
 Ignore-this: f583a19feb90b580b079d94006a3e35faeed35585934153c741d5e97ff083e0160df686f16a85647
 
 The primary use case is to have a simple portable method to determine the
 global cache directory when running regression tests. However, its use is
 not necessarily limited to testing.
] 
> hunk ./harness/Darcs/Test/Shell.hs 115
+          , ("DARCS_CACHE_DIR"           , EnvFilePath $ wd </> ".cache/darcs")
hunk ./tests/failing-issue1702-optimize-relink-vs-cache.sh 63
-inC=$(find $HOME/.cache/darcs/patches -name $patch)
+inC=$(find $DARCS_CACHE_DIR/patches -name $patch)
hunk ./tests/issue1210-no-global-cache-in-sources.sh 28
-cacheDir=$HOME/.cache/darcs
-
hunk ./tests/issue1210-no-global-cache-in-sources.sh 31
-not grep "$cacheDir" S/_darcs/prefs/sources
+not grep "$DARCS_CACHE_DIR" S/_darcs/prefs/sources

[tests/failing-pristine-problems.sh is no longer failing
Ben Franksen <[email protected]>**20240714095026
 Ignore-this: c3986c21c2ec8f5cc842e08ae9c1151d5aef4c4dcb39648af88749eaeb3a87ff17f1d5fc41cd260a
 
 We just have to take into account that pristine files may be provided by the
 cache, so we have to remove them there as well to make `darcs check` fail.
] 
<
[use DARCS_CACHE_DIR in the test suite
Ben Franksen <[email protected]>**20250107115445
 Ignore-this: 9b004898136ed57f107db1dcb031266ce5f6e20ccaed41824510c5c729d61646a213c3bc49ec277b
] 
> move ./tests/failing-pristine-problems.sh ./tests/repair-missing-pristine-files.sh
hunk ./tests/repair-missing-pristine-files.sh 42
+# also remove it from the cache
+find $DARCS_CACHE_DIR/pristine.hashed -name $roothash -exec rm -f {} \; || true
hunk ./tests/repair-missing-pristine-files.sh 47
-# At the time of writing this test goes wrong at the line above
-# I'm not 100% certain if the rest of it is right.
hunk ./tests/repair-missing-pristine-files.sh 51
+# also remove it from the cache
+find $DARCS_CACHE_DIR/pristine.hashed -name $wibblehash -exec rm -f {} \; || true

Attachment: allow-to-override-global-cache-location-by-setting-darcs_cache_dir.dpatch
Description: application/darcs-patch

_______________________________________________
darcs-devel mailing list
[email protected]
https://lists.darcs.net/mailman/listinfo/darcs-devel

Reply via email to