GithubHelp home page GithubHelp logo

scripts's People

Contributors

ckujau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

scripts's Issues

checksum_file.sh: why do we store the filename within the xattr?

Currently we store the basename (the filename w/o the pathname) to the xattr as well, and I wonder why I did this. Let this issue sit here until I've thought this over and made up my mind.

The current format is, e.g. for Linux:

setfattr --name user.checksum."$DIGEST" --value "`$PROGRAM "$BASENAME"`" "$BASENAME"

Why don't we just do:

setfattr --name user.checksum."$DIGEST" --value "`$PROGRAM "$FILENAME" | cut -c-64`" "$FILENAME"

This way we may be able to omit the use of BASENAME altogether. But maybe there was a point in storing the basename in the first place?

Background: because the filename is stored with the xattr, once we rename the filename, the "check" operation will still pass, but the "get" operation will show the old filename. We could implement a "update-filename" operation or something like this, but we could also drop the filename from the xattr altogether, no?

$ date > foo
$ checksum_file.sh set foo
Setting user.checksum.sha256 on foo...
$ checksum_file.sh check foo
FILE: foo - OK
$ mv foo bar
$ checksum_file.sh check bar
FILE: bar - OK
$ checksum_file.sh check-set bar
INFO: checksum found for bar, not setting a new checksum.
$ checksum_file.sh get bar
user.checksum.sha256="a2b7681fcbd961f79e1ba6b66cdd9cb50289ff2692ccb1dbe978546febd5d2cb  foo"

Annoying error message fix - diff2html.sh : line 121

diff2html.patch

--- /old/diff2html.sh	2020-02-06 15:56:17.000000000 -0700
+++ /new/diff2html.sh	2020-02-06 15:24:27.000000000 -0700
@@ -118,7 +118,7 @@
 done
 IFS=$OIFS

-if [ $diffseen -eq 0  &&  $onlyseen -eq 0 ]; then
+if [[ $diffseen -eq 0  &&  $onlyseen -eq 0 ]]; then
 	printf '</span>'
 else
 	echo "</div>"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.