6
6
"fmt"
7
7
"io"
8
8
"os"
9
- "path/filepath"
10
9
"runtime"
11
10
"strings"
12
11
"sync"
@@ -20,7 +19,6 @@ import (
20
19
cid "github.com/ipfs/go-cid"
21
20
bstore "github.com/ipfs/go-ipfs-blockstore"
22
21
cmds "github.com/ipfs/go-ipfs-cmds"
23
- config "github.com/ipfs/go-ipfs-config"
24
22
)
25
23
26
24
type RepoVersion struct {
@@ -216,44 +214,11 @@ var repoFsckCmd = &cmds.Command{
216
214
Helptext : cmds.HelpText {
217
215
Tagline : "Remove repo lockfiles." ,
218
216
ShortDescription : `
219
- 'ipfs repo fsck' is a plumbing command that will remove repo and level db
220
- lockfiles, as well as the api file. This command can only run when no ipfs
221
- daemons are running.
217
+ 'ipfs repo fsck' is now a no-op.
222
218
` ,
223
219
},
224
220
Run : func (req * cmds.Request , res cmds.ResponseEmitter , env cmds.Environment ) error {
225
- configRoot , err := cmdenv .GetConfigRoot (env )
226
- if err != nil {
227
- return err
228
- }
229
-
230
- dsPath , err := config .DataStorePath (configRoot )
231
- if err != nil {
232
- return err
233
- }
234
-
235
- dsLockFile := filepath .Join (dsPath , "LOCK" ) // TODO: get this lockfile programmatically
236
- repoLockFile := filepath .Join (configRoot , fsrepo .LockFile )
237
- apiFile := filepath .Join (configRoot , "api" ) // TODO: get this programmatically
238
-
239
- log .Infof ("Removing repo lockfile: %s" , repoLockFile )
240
- log .Infof ("Removing datastore lockfile: %s" , dsLockFile )
241
- log .Infof ("Removing api file: %s" , apiFile )
242
-
243
- err = os .Remove (repoLockFile )
244
- if err != nil && ! os .IsNotExist (err ) {
245
- return err
246
- }
247
- err = os .Remove (dsLockFile )
248
- if err != nil && ! os .IsNotExist (err ) {
249
- return err
250
- }
251
- err = os .Remove (apiFile )
252
- if err != nil && ! os .IsNotExist (err ) {
253
- return err
254
- }
255
-
256
- return cmds .EmitOnce (res , & MessageOutput {"Lockfiles have been removed.\n " })
221
+ return cmds .EmitOnce (res , & MessageOutput {"`ipfs repo fsck` is deprecated and does nothing.\n " })
257
222
},
258
223
Type : MessageOutput {},
259
224
Encoders : cmds.EncoderMap {
0 commit comments