diff --git a/docs/examples/kubo-as-a-library/go.mod b/docs/examples/kubo-as-a-library/go.mod index 713861632a1..1333b7d07fc 100644 --- a/docs/examples/kubo-as-a-library/go.mod +++ b/docs/examples/kubo-as-a-library/go.mod @@ -9,7 +9,7 @@ toolchain go1.22.0 replace github.com/ipfs/kubo => ./../../.. require ( - github.com/ipfs/boxo v0.22.1-0.20240814075207-b27ba953ad58 + github.com/ipfs/boxo v0.22.1-0.20240820213309-f4259d68d2d1 github.com/ipfs/kubo v0.0.0-00010101000000-000000000000 github.com/libp2p/go-libp2p v0.36.2 github.com/multiformats/go-multiaddr v0.13.0 diff --git a/docs/examples/kubo-as-a-library/go.sum b/docs/examples/kubo-as-a-library/go.sum index 6a523489be4..75b6682b96b 100644 --- a/docs/examples/kubo-as-a-library/go.sum +++ b/docs/examples/kubo-as-a-library/go.sum @@ -266,8 +266,8 @@ github.com/ipfs-shipyard/nopfs/ipfs v0.13.2-0.20231027223058-cde3b5ba964c h1:7Uy github.com/ipfs-shipyard/nopfs/ipfs v0.13.2-0.20231027223058-cde3b5ba964c/go.mod h1:6EekK/jo+TynwSE/ZOiOJd4eEvRXoavEC3vquKtv4yI= github.com/ipfs/bbloom v0.0.4 h1:Gi+8EGJ2y5qiD5FbsbpX/TMNcJw8gSqr7eyjHa4Fhvs= github.com/ipfs/bbloom v0.0.4/go.mod h1:cS9YprKXpoZ9lT0n/Mw/a6/aFV6DTjTLYHeA+gyqMG0= -github.com/ipfs/boxo v0.22.1-0.20240814075207-b27ba953ad58 h1:3HLEGJd/jHeZGewrYa5JL0P1hOdCizVqpwMVkDRTLso= -github.com/ipfs/boxo v0.22.1-0.20240814075207-b27ba953ad58/go.mod h1:7feBHe9XsCCO7TGxAHIwwdgvDTcWARXP6SaD3XvqTXI= +github.com/ipfs/boxo v0.22.1-0.20240820213309-f4259d68d2d1 h1:zrQUhrACz8sezEAuY74BSbCojXoxAmSbMWeoqfwx0dI= +github.com/ipfs/boxo v0.22.1-0.20240820213309-f4259d68d2d1/go.mod h1:7feBHe9XsCCO7TGxAHIwwdgvDTcWARXP6SaD3XvqTXI= github.com/ipfs/go-bitfield v1.1.0 h1:fh7FIo8bSwaJEh6DdTWbCeZ1eqOaOkKFI74SCnsWbGA= github.com/ipfs/go-bitfield v1.1.0/go.mod h1:paqf1wjq/D2BBmzfTVFlJQ9IlFOZpg422HL0HqsGWHU= github.com/ipfs/go-bitswap v0.11.0 h1:j1WVvhDX1yhG32NTC9xfxnqycqYIlhzEzLXG/cU1HyQ= diff --git a/go.mod b/go.mod index f175984e12c..e0288210a41 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/hashicorp/go-version v1.6.0 github.com/ipfs-shipyard/nopfs v0.0.12 github.com/ipfs-shipyard/nopfs/ipfs v0.13.2-0.20231027223058-cde3b5ba964c - github.com/ipfs/boxo v0.22.1-0.20240814075207-b27ba953ad58 + github.com/ipfs/boxo v0.22.1-0.20240820213309-f4259d68d2d1 github.com/ipfs/go-block-format v0.2.0 github.com/ipfs/go-cid v0.4.1 github.com/ipfs/go-cidutil v0.1.0 diff --git a/go.sum b/go.sum index 570b445fa5e..812a1981cc2 100644 --- a/go.sum +++ b/go.sum @@ -330,8 +330,8 @@ github.com/ipfs-shipyard/nopfs/ipfs v0.13.2-0.20231027223058-cde3b5ba964c h1:7Uy github.com/ipfs-shipyard/nopfs/ipfs v0.13.2-0.20231027223058-cde3b5ba964c/go.mod h1:6EekK/jo+TynwSE/ZOiOJd4eEvRXoavEC3vquKtv4yI= github.com/ipfs/bbloom v0.0.4 h1:Gi+8EGJ2y5qiD5FbsbpX/TMNcJw8gSqr7eyjHa4Fhvs= github.com/ipfs/bbloom v0.0.4/go.mod h1:cS9YprKXpoZ9lT0n/Mw/a6/aFV6DTjTLYHeA+gyqMG0= -github.com/ipfs/boxo v0.22.1-0.20240814075207-b27ba953ad58 h1:3HLEGJd/jHeZGewrYa5JL0P1hOdCizVqpwMVkDRTLso= -github.com/ipfs/boxo v0.22.1-0.20240814075207-b27ba953ad58/go.mod h1:7feBHe9XsCCO7TGxAHIwwdgvDTcWARXP6SaD3XvqTXI= +github.com/ipfs/boxo v0.22.1-0.20240820213309-f4259d68d2d1 h1:zrQUhrACz8sezEAuY74BSbCojXoxAmSbMWeoqfwx0dI= +github.com/ipfs/boxo v0.22.1-0.20240820213309-f4259d68d2d1/go.mod h1:7feBHe9XsCCO7TGxAHIwwdgvDTcWARXP6SaD3XvqTXI= github.com/ipfs/go-bitfield v1.1.0 h1:fh7FIo8bSwaJEh6DdTWbCeZ1eqOaOkKFI74SCnsWbGA= github.com/ipfs/go-bitfield v1.1.0/go.mod h1:paqf1wjq/D2BBmzfTVFlJQ9IlFOZpg422HL0HqsGWHU= github.com/ipfs/go-bitswap v0.11.0 h1:j1WVvhDX1yhG32NTC9xfxnqycqYIlhzEzLXG/cU1HyQ= diff --git a/test/dependencies/go.mod b/test/dependencies/go.mod index 05e7d29c356..9c274063a48 100644 --- a/test/dependencies/go.mod +++ b/test/dependencies/go.mod @@ -113,7 +113,7 @@ require ( github.com/hexops/gotextdiff v1.0.3 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/ipfs/bbloom v0.0.4 // indirect - github.com/ipfs/boxo v0.22.1-0.20240814075207-b27ba953ad58 // indirect + github.com/ipfs/boxo v0.22.1-0.20240820213309-f4259d68d2d1 // indirect github.com/ipfs/go-block-format v0.2.0 // indirect github.com/ipfs/go-cid v0.4.1 // indirect github.com/ipfs/go-datastore v0.6.0 // indirect diff --git a/test/dependencies/go.sum b/test/dependencies/go.sum index 81b9ffd77b3..e1288c2b5d3 100644 --- a/test/dependencies/go.sum +++ b/test/dependencies/go.sum @@ -280,8 +280,8 @@ github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2 github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/ipfs/bbloom v0.0.4 h1:Gi+8EGJ2y5qiD5FbsbpX/TMNcJw8gSqr7eyjHa4Fhvs= github.com/ipfs/bbloom v0.0.4/go.mod h1:cS9YprKXpoZ9lT0n/Mw/a6/aFV6DTjTLYHeA+gyqMG0= -github.com/ipfs/boxo v0.22.1-0.20240814075207-b27ba953ad58 h1:3HLEGJd/jHeZGewrYa5JL0P1hOdCizVqpwMVkDRTLso= -github.com/ipfs/boxo v0.22.1-0.20240814075207-b27ba953ad58/go.mod h1:7feBHe9XsCCO7TGxAHIwwdgvDTcWARXP6SaD3XvqTXI= +github.com/ipfs/boxo v0.22.1-0.20240820213309-f4259d68d2d1 h1:zrQUhrACz8sezEAuY74BSbCojXoxAmSbMWeoqfwx0dI= +github.com/ipfs/boxo v0.22.1-0.20240820213309-f4259d68d2d1/go.mod h1:7feBHe9XsCCO7TGxAHIwwdgvDTcWARXP6SaD3XvqTXI= github.com/ipfs/go-block-format v0.2.0 h1:ZqrkxBA2ICbDRbK8KJs/u0O3dlp6gmAuuXUJNiW1Ycs= github.com/ipfs/go-block-format v0.2.0/go.mod h1:+jpL11nFx5A/SPpsoBn6Bzkra/zaArfSmsknbPMYgzM= github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s= diff --git a/test/sharness/t0047-add-mode-mtime.sh b/test/sharness/t0047-add-mode-mtime.sh index ebdae8343bf..520c692f3bc 100755 --- a/test/sharness/t0047-add-mode-mtime.sh +++ b/test/sharness/t0047-add-mode-mtime.sh @@ -167,6 +167,20 @@ test_file() { test $(stat -c "%a" "$OUTFILE") = 444 ' + # special case, because storing mode requires dag-pb envelope + # and when dealing with CIDv1 we can have 'raw' block instead of 'dag-pb' + # so it needs to be converted before adding attribute + test_expect_success "can add file mode to cidv1 raw block [$1]" ' + NAME=$(mk_name) && + HASH=$(date | ipfs add -q --cid-version 1 --raw-leaves=true) && + OUTFILE=$(mk_file "${NAME}") && + ipfs files cp "/ipfs/$HASH" /$NAME && + ipfs files chmod 445 /$NAME && + HASH2=$(ipfs files stat /$NAME|head -1) && + ipfs get -o "$OUTFILE" $HASH2 && + test $(stat -c "%a" "$OUTFILE") = 445 + ' + test_expect_success "can change file modification time [$1]" ' NAME=$(mk_name) && OUTFILE="$(mk_file "$NAME")" && @@ -180,6 +194,22 @@ test_file() { test $(stat -c "%Y" "$OUTFILE") -gt $NOW ' + # special case, because storing mtime requires dag-pb envelope + # and when dealing with CIDv1 we can have 'raw' block instead of 'dag-pb' + # so it needs to be converted to dag-pb before adding attribute + test_expect_success "can add file modification time to cidv1 raw block [$1]" ' + NAME=$(mk_name) && + OUTFILE="$(mk_file "$NAME")" && + EXPECTED="$CUSTOM_MTIME" && + HASH=$(date | ipfs add -q --cid-version 1 --raw-leaves=true) && + ipfs files cp "/ipfs/$HASH" /$NAME && + ipfs files touch --mtime=$EXPECTED /$NAME && + test $(ipfs files stat --format="" "/$NAME") -eq $EXPECTED && + HASH=$(ipfs files stat /$NAME|head -1) && + ipfs get -o "$OUTFILE" "$HASH" && + test $(stat -c "%Y" "$OUTFILE") -eq $EXPECTED + ' + test_expect_success "can change file modification time nanoseconds [$1]" ' NAME=$(mk_name) && echo test|ipfs files write --create /$NAME &&