Source files of fsfe.org, pdfreaders.org, freeyourandroid.org, ilovefs.org, drm.info, and test.fsfe.org. Contribute: https://fsfe.org/contribute/web/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

misc.sh 527B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/sh
  2. inc_misc=true
  3. [ -z "$inc_logging" ] && . "$basedir/build/logging.sh"
  4. print_help(){
  5. cat "$basedir/build/HELP"
  6. }
  7. match(){
  8. printf %s "$1" |egrep -q "$2"
  9. }
  10. debug(){
  11. if [ "$#" -ge 1 ]; then
  12. echo "$(date '+%F %T'): $@" |logappend debug >&2
  13. else
  14. logappend debug >&2
  15. fi
  16. }
  17. print_error(){
  18. echo "Error - $@" |logappend lasterror >&2
  19. echo "Run '$0 --help' to see usage instructions" >&2
  20. }
  21. die(){
  22. echo "$(date '+%F %T'): Fatal - $@" |logappend lasterror >&2
  23. date +%s |logstatus end_time
  24. exit 1
  25. }