Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ipfs/kubo
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: a2af324e9f1a^
Choose a base ref
...
head repository: ipfs/kubo
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 302554ebd423
Choose a head ref
  • 2 commits
  • 4 files changed
  • 1 contributor

Commits on Jul 28, 2015

  1. find the get error quickly (WIP)

    to be removed
    
    License: MIT
    Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
    jbenet committed Jul 28, 2015
    Copy the full SHA
    a2af324 View commit details
  2. updated gobuilder dist

    Luzifer/gobuilder#52
    
    License: MIT
    Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
    jbenet committed Jul 28, 2015
    Copy the full SHA
    302554e View commit details
Showing with 34 additions and 3 deletions.
  1. +3 −3 cmd/ipfs/.gobuilder.yml
  2. +12 −0 core/commands/get.go
  3. +17 −0 thirdparty/tar/extractor.go
  4. +2 −0 unixfs/tar/reader.go
6 changes: 3 additions & 3 deletions cmd/ipfs/.gobuilder.yml
Original file line number Diff line number Diff line change
@@ -5,6 +5,6 @@ build_matrix:
build_tags:
- nofuse
artifacts:
- dist/README.md
- dist/LICENSE
- dist/install.sh
README.md: dist/README.md
LICENSE: dist/LICENSE
install.sh: dist/install.sh
12 changes: 12 additions & 0 deletions core/commands/get.go
Original file line number Diff line number Diff line change
@@ -130,6 +130,18 @@ may also specify the level of compression by specifying '-l=<1-9>'.

fmt.Printf("Saving file(s) to %s\n", outPath)

{

// consume the whole thing.
buf := make([]byte, 2048)
for {
_, err := outReader.Read(buf)
if err != nil {
panic(err.Error())
}
}
}

// TODO: get total length of files
bar := pb.New(0).SetUnits(pb.U_BYTES)
bar.Output = os.Stderr
17 changes: 17 additions & 0 deletions thirdparty/tar/extractor.go
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ package tar

import (
"archive/tar"
"fmt"
"io"
"os"
fp "path/filepath"
@@ -13,6 +14,20 @@ type Extractor struct {
}

func (te *Extractor) Extract(reader io.Reader) error {

// consume the whole thing.
buf := make([]byte, 2048)
for {
_, err := reader.Read(buf)
if err == io.EOF {
panic("eofed")
return nil
}
if err != nil {
return err
}
}

tarReader := tar.NewReader(reader)

// Check if the output path already exists, so we know whether we should
@@ -35,6 +50,8 @@ func (te *Extractor) Extract(reader io.Reader) error {
return err
}
if header == nil || err == io.EOF {
fmt.Println(header, err)
panic("ahhhhhhhh")
break
}

2 changes: 2 additions & 0 deletions unixfs/tar/reader.go
Original file line number Diff line number Diff line change
@@ -29,6 +29,8 @@ type Reader struct {
}

func NewReader(ctx cxt.Context, path path.Path, dag mdag.DAGService, dagnode *mdag.Node, compression int) (*Reader, error) {
ctx, cancel := cxt.WithTimeout(ctx, time.Second)
defer cancel()

reader := &Reader{
signalChan: make(chan struct{}),