File tree 2 files changed +21
-2
lines changed
cabal-install/src/Distribution/Client 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -1172,7 +1172,9 @@ readNoIndexCache verbosity index = do
1172
1172
Left msg -> do
1173
1173
warn verbosity $
1174
1174
concat
1175
- [ " Parsing the index cache failed ("
1175
+ [ " Parsing the index cache for repo \" "
1176
+ , unRepoName (repoName repo)
1177
+ , " \" failed ("
1176
1178
, msg
1177
1179
, " ). "
1178
1180
, " Trying to regenerate the index cache..."
@@ -1184,6 +1186,8 @@ readNoIndexCache verbosity index = do
1184
1186
1185
1187
-- we don't hash cons local repository cache, they are hopefully small
1186
1188
Right res -> return res
1189
+ where
1190
+ RepoIndex _ctxt repo = index
1187
1191
1188
1192
-- | Read the 'Index' cache from the filesystem. Throws IO exceptions
1189
1193
-- if any arise and returns Left on invalid input.
@@ -1195,7 +1199,11 @@ readIndexCache' index
1195
1199
Right . read00IndexCache <$> BSS. readFile (cacheFile index)
1196
1200
1197
1201
readNoIndexCache' :: Index -> IO (Either String NoIndexCache )
1198
- readNoIndexCache' index = structuredDecodeFileOrFail (cacheFile index)
1202
+ readNoIndexCache' index = do
1203
+ exists <- doesFileExist (cacheFile index)
1204
+ if exists
1205
+ then structuredDecodeFileOrFail (cacheFile index)
1206
+ else pure $ Left " No index cache exists yet"
1199
1207
1200
1208
-- | Write the 'Index' cache to the filesystem
1201
1209
writeIndexCache :: Index -> Cache -> IO ()
Original file line number Diff line number Diff line change
1
+ synopsis: Create `noindex.cache` file if missing
2
+ packages: cabal-install
3
+ prs: #10730
4
+ issues: #9891
5
+ significance:
6
+
7
+ description: {
8
+
9
+ - Local+noindex repositories will have their `noindex.cache` file created the first time they are accessed.
10
+
11
+ }
You can’t perform that action at this time.
0 commit comments