strip off file metadata in sqlar

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

strip off file metadata in sqlar

Peng Yu
The .sqlar files contain file metadata. I'd like two .sqlar files to
be exactly the same (`cmp` should return 0) when they store the same
content. Is it possible to strip off all metadata of stored files?
Thanks.

$ sqlite3 my.sqlar -Atv
-rwxr-xr-x        181  2019-08-27 15:18:27  main.sh

--
Regards,
Peng
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: strip off file metadata in sqlar

Warren Young
On Aug 27, 2019, at 9:21 AM, Peng Yu <[hidden email]> wrote:
>
> The .sqlar files contain file metadata. I'd like two .sqlar files to
> be exactly the same (`cmp` should return 0) when they store the same
> content. Is it possible to strip off all metadata of stored files?

[XY Problem][1].  Try sqldiff instead:

    https://www.sqlite.org/sqldiff.html


[1]: http://xyproblem.info/
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: strip off file metadata in sqlar

Peng Yu
Where is the binary or source code of sqldiff?

I don't find sqldiff in the package sqlite installed in homebrew. I
also don't find sqldiff after compiling
sqlite-autoconf-3290000.tar.gz.

> https://www.sqlite.org/sqldiff.html

--
Regards,
Peng
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: strip off file metadata in sqlar

Warren Young
On Aug 27, 2019, at 2:40 PM, Peng Yu <[hidden email]> wrote:
>
> Where is the binary or source code of sqldiff?

The source is part of the complete SQLite source tree:

    https://www.sqlite.org/cgi/src/doc/trunk/README.md

(As opposed to the amalgamation.)

You will then find it in tool/sqldiff.c, and you can build it with “make sqldiff” after configuring the tree as desribed on the above web page.

> I don't find sqldiff in the package sqlite installed in homebrew.

It’s a separate package: brew install sqldiff
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: strip off file metadata in sqlar

Peng Yu
I just need the return status of sqldiff (as `cmp -s`). Is there an
option to suppress all the screen output? Thanks.

On 8/27/19, Warren Young <[hidden email]> wrote:

> On Aug 27, 2019, at 2:40 PM, Peng Yu <[hidden email]> wrote:
>>
>> Where is the binary or source code of sqldiff?
>
> The source is part of the complete SQLite source tree:
>
>     https://www.sqlite.org/cgi/src/doc/trunk/README.md
>
> (As opposed to the amalgamation.)
>
> You will then find it in tool/sqldiff.c, and you can build it with “make
> sqldiff” after configuring the tree as desribed on the above web page.
>
>> I don't find sqldiff in the package sqlite installed in homebrew.
>
> It’s a separate package: brew install sqldiff
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>


--
Regards,
Peng
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: strip off file metadata in sqlar

Dominique Devienne
On Tue, Aug 27, 2019 at 11:46 PM Peng Yu <[hidden email]> wrote:

> I just need the return status of sqldiff (as `cmp -s`). Is there an
> option to suppress all the screen output? Thanks.
>

https://www.sqlite.org/cgi/src/artifact/7b9b7238284f0213

Doesn't look like it does. But redirecting to /dev/null or NUL would do.
Only problem is there are only two returns in main(), both returning 0;

But I guess the output of sqldiff is empty (or deterministic?) is the same,
so that output can be processed by something.

Adding a mode to sqldiff to return 0 on same or 1 on different should not
be difficult though. Adding short-circuiting to make it fast might be a
little harder. --DD
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users