Difference between revisions of "Free Software Directory:Participate/Script aid"

From Free Software Directory
Jump to: navigation, search
(Created script page.)
 
(Added usage and notes.)
Line 1: Line 1:
 +
You're welcome to contribute to this script and add your name and contact information to the copyright notice of the script.
 +
 +
== Usage ==
 +
 +
Best if you take the complete corresponding source of the project being evaluated (''e.g.'': with <code>git</code>, you can accomplish this using the <code>--recurse-submodules=yes</code>
 +
 +
<pre style="white-space: pre-wrap">
 +
git --recurse-submodules="yes" [Some git repository.]
 +
cd [Directory created by git]
 +
[Script aid.] > [Desired text file to store output.]; printf '\a'
 +
</pre>
 +
 +
<code>printf '\a'</code> can be replaced by a command to play an audio file of your choice.
 +
 +
Now leave the script to do its work and wait for the sound clue to continue working on the evaluation.
 +
 +
== Notes ==
 +
 +
* The script is originally meant to be POSIX-compliant.
 +
* The script always takes the current working directory as basis of operation.
 +
* Be aware of '''binary''' and '''huge''' outputs.
 +
* When reading contents of the files in search for a match, all the lines matched will be prefixed by their number and a colon. The last line has the relative path of the file containing the lines. After this, the cycle is restarted immediately to the next file, so that '''there are no blank lines'''.
 +
* Be aware of false-positives.
 +
* Be aware that, due to our lack of knowledge on various spoken languages, some things might not be found by the script.
 +
 +
== Script ==
 +
 
<pre style="white-space: pre-wrap">
 
<pre style="white-space: pre-wrap">
 
# FSD Participation Aid: Helps user evaluate entries for the Free Software Directory.
 
# FSD Participation Aid: Helps user evaluate entries for the Free Software Directory.
Line 45: Line 72:
 
grep -in \
 
grep -in \
 
'\(©\)\|\((c)\)\|\(copyleft\)\|\(copyright\)\|\(licen\)\|\([^[:alnum:]]cc\)\|\([^[:alnum:]][al]\?gpl\)\|\([^[:alnum:]]fdl\)' \
 
'\(©\)\|\((c)\)\|\(copyleft\)\|\(copyright\)\|\(licen\)\|\([^[:alnum:]]cc\)\|\([^[:alnum:]][al]\?gpl\)\|\([^[:alnum:]]fdl\)' \
'{}' \; -exec printf "" -print
+
'{}' \; -print
  
 
printf '\n'
 
printf '\n'

Revision as of 13:52, 26 August 2016

You're welcome to contribute to this script and add your name and contact information to the copyright notice of the script.

Usage

Best if you take the complete corresponding source of the project being evaluated (e.g.: with git, you can accomplish this using the --recurse-submodules=yes

git --recurse-submodules="yes" [Some git repository.]
cd [Directory created by git]
[Script aid.] > [Desired text file to store output.]; printf '\a'

printf '\a' can be replaced by a command to play an audio file of your choice.

Now leave the script to do its work and wait for the sound clue to continue working on the evaluation.

Notes

  • The script is originally meant to be POSIX-compliant.
  • The script always takes the current working directory as basis of operation.
  • Be aware of binary and huge outputs.
  • When reading contents of the files in search for a match, all the lines matched will be prefixed by their number and a colon. The last line has the relative path of the file containing the lines. After this, the cycle is restarted immediately to the next file, so that there are no blank lines.
  • Be aware of false-positives.
  • Be aware that, due to our lack of knowledge on various spoken languages, some things might not be found by the script.

Script

# FSD Participation Aid: Helps user evaluate entries for the Free Software Directory.
# Copyright © 2016 Adonay "adfeno" Felipe Nogueira <adfeno@openmailbox.org> <https://libreplanet.org/wiki/User:Adfeno>
# 
# Copyright (C) 1996 X Consortium
# 
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
# 
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
# 
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# 
# Except as contained in this notice, the name of the X Consortium shall
# not be used in advertising or otherwise to promote the sale, use or
# other dealings in this Software without prior written authorization
# from the X Consortium.
# 
# X Window System is a trademark of X Consortium, Inc.

printf '\n'
echo "Path tree starting from: ${PWD}"
printf '\n'

find "." ! \( -type d \) -exec \
	file -i '{}' \;

printf '\n'
echo "Possible licensing and copyright information found."
printf '\n'

find "." ! \( -type d \) -exec \
	grep -in \
		'\(©\)\|\((c)\)\|\(copyleft\)\|\(copyright\)\|\(licen\)\|\([^[:alnum:]]cc\)\|\([^[:alnum:]][al]\?gpl\)\|\([^[:alnum:]]fdl\)' \
'{}' \; -print

printf '\n'
echo "Possible HTML/JavaScript events found."
printf '\n'

find "." ! \( -type d \) -exec \
	grep -in \
		'\(onabort\)\|\(onafterprint\)\|\(onautocomplete\)\|\(onautocompleteerror\)\|\(onbeforeprint\)\|\(onbeforeunload\)\|\(onblur\)\|\(oncancel\)\|\(oncanplay\)\|\(oncanplaythrough\)\|\(onchange\)\|\(onclick\)\|\(onclose\)\|\(oncontextmenu\)\|\(oncuechange\)\|\(ondblclick\)\|\(ondrag\)\|\(ondragend\)\|\(ondragenter\)\|\(ondragexit\)\|\(ondragleave\)\|\(ondragover\)\|\(ondragstart\)\|\(ondrop\)\|\(ondurationchange\)\|\(onemptied\)\|\(onended\)\|\(onerror\)\|\(onfocus\)\|\(onhashchange\)\|\(oninput\)\|\(oninvalid\)\|\(onkeydown\)\|\(onkeypress\)\|\(onkeyup\)\|\(onlanguagechange\)\|\(onload\)\|\(onloadeddata\)\|\(onloadedmetadata\)\|\(onloadstart\)\|\(onmessage\)\|\(onmousedown\)\|\(onmouseenter\)\|\(onmouseleave\)\|\(onmousemove\)\|\(onmouseout\)\|\(onmouseover\)\|\(onmouseup\)\|\(onmousewheel\)\|\(onoffline\)\|\(ononline\)\|\(onpagehide\)\|\(onpageshow\)\|\(onpause\)\|\(onplay\)\|\(onplaying\)\|\(onpopstate\)\|\(onprogress\)\|\(onratechange\)\|\(onreadystatechange\)\|\(onreset\)\|\(onresize\)\|\(onscroll\)\|\(onseeked\)\|\(onseeking\)\|\(onselect\)\|\(onshow\)\|\(onsort\)\|\(onstalled\)\|\(onstorage\)\|\(onsubmit\)\|\(onsuspend\)\|\(ontimeupdate\)\|\(ontoggle\)\|\(onunload\)\|\(onvolumechange\)\|\(onwaiting\)' \
'{}' \; -print


Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the page “GNU Free Documentation License”.

The copyright and license notices on this page only apply to the text on this page. Any software or copyright-licenses or other similar notices described in this text has its own copyright notice and license, which can usually be found in the distribution or license text itself.