remove unused scripts (#1198)

This commit is contained in:
PJ Fanning 2024-03-16 23:48:26 +01:00 committed by GitHub
parent d72584801d
commit 537669243e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 0 additions and 254 deletions

View file

@ -1,69 +0,0 @@
#!/bin/sh
exec scala "$0" "$@"
!#
/*
* Usage:
* authors.scala tag1 tag2
*
* or if on non unixy os:
* scala authors.scala tag1 tag2
*
* requires scala 2.13.x+ and command line git on path
*/
import scala.sys.process._
require(args.length == 2, "usage: authors prevTag currTag")
val gitCmd = "git log --no-merges --shortstat -z --minimal -w -C " + args(0) + ".." + args(1)
case class Stats(name: String, email: String, commits: Int = 0, inserts: Int = 0, deletes: Int = 0, filesChanged: Int = 0)
val AuthorExp = """Author: (.*) <([^>]+)>""".r
val FilesExp = """(\d+)\sfile[s]? changed""".r
val InsertionsExp = """(\d+)\sinsertion[s]?\(\+\)""".r
val DeletionsExp = """(\d+)\sdeletion[s]?\(-\)""".r
val entries = gitCmd.lazyLines_!.foldLeft("")(_ + "\n" + _).split('\u0000')
val map = entries.foldLeft(Map.empty[String, Stats]) { (map, entry) =>
val lines = entry.trim.split('\n')
val authorLine = lines(1)
val summary = lines.last
val statsEntry = authorLine match {
case AuthorExp(name, email) =>
map.get(name.toLowerCase).orElse {
// look for same email, but different name
map.values.find(_.email.equalsIgnoreCase(email)).orElse {
Some(Stats(name, email))
}
}
case _ =>
println(s"Unparseable author line: \n$authorLine\n in entry $entry")
None
}
val updatedEntry =
statsEntry.map(entry => summary.trim.split(',').map(_.trim).foldLeft(entry.copy(commits = entry.commits + 1)) {
case (entry, FilesExp(f)) => entry.copy(filesChanged = entry.filesChanged + f.toInt)
case (entry, InsertionsExp(a)) => entry.copy(inserts = entry.inserts + a.toInt)
case (entry, DeletionsExp(d)) => entry.copy(deletes = entry.deletes + d.toInt)
case (entry, uff) =>
println(s"Couldn't parse summary section for $entry '$uff'")
entry
})
updatedEntry.fold(
map
)(entry => map + (entry.name.toLowerCase -> entry))
}
val sorted = map.values.toSeq.sortBy(s => (s.commits, s.inserts + s.deletes)).reverse
println("commits added removed")
sorted.foreach { entry =>
println("%7d%7d%9d %s".format(entry.commits, entry.inserts, entry.deletes, entry.name))
}

View file

@ -1,23 +0,0 @@
#!/bin/sh
find . -name "*.java" |while read line
do
expand $line > $line.new
mv -f $line.new $line
done
find . -name "*.scala" |while read line
do
expand $line > $line.new
mv -f $line.new $line
done
find . -name "*.html" |while read line
do
expand $line > $line.new
mv -f $line.new $line
done
find . -name "*.xml" |while read line
do
expand $line > $line.new
mv -f $line.new $line
done
echo "converted all tabs to 2 spaces"
exit 0

View file

@ -1,6 +0,0 @@
#!/bin/sh
find . -name *.scala -exec dos2unix {} \;
find . -name *.java -exec dos2unix {} \;
find . -name *.html -exec dos2unix {} \;
find . -name *.xml -exec dos2unix {} \;
find . -name *.conf -exec dos2unix {} \;

View file

@ -1,32 +0,0 @@
#!/bin/bash
#
# Finds fixed tickets in repository
#
# This script takes Organization, Repository, Github username, Password as inputs.
# It writes all the closed tickets in "closed-issues.txt" file.
#
read -p "Organization: " ORG; read -p "Repository: " REPO; read -p "Github username: " USER; read -s -p "Password: " PASS
CLOSED_FILE="closed-issues.txt"
if [[ ! -e $CLOSED_FILE ]]; then
for (( i = 1 ; i < 200; i++ )); do
URL="https://api.github.com/repos/$ORG/$REPO/issues?state=closed&page=$i&per_page=100"
echo "fetching $URL"
HEADERS=""
{ HEADERS=$(curl -vs -u "$USER:$PASS" "$URL" 2>&1 1>&3-); } 3> >(grep -oP "(?<=^[[:space:]]{4}\"number\":[[:space:]])([0-9]{1,5})" >> $CLOSED_FILE)
echo "$HEADERS"
if [[ ! "$HEADERS" == *"rel=\"next\""* ]]; then
break
fi
done
else
echo "$CLOSED_FILE found"
fi
ISSUE_PATTERN="[^&A-Za-z](#)([0-9]{1,5})($|[^0-9A-Za-z])"
grep -rn --include=\*.{scala,java} -E "$ISSUE_PATTERN" . | while read LINE; do
if [[ $LINE =~ $ISSUE_PATTERN ]]; then
if grep -xq ${BASH_REMATCH[2]} $CLOSED_FILE; then
echo "$LINE"
fi
fi
done

View file

@ -1,31 +0,0 @@
#!/bin/sh
# flush rules
ipfw del pipe 1
ipfw del pipe 2
ipfw -q -f flush
ipfw -q -f pipe flush
if [ "$1" == "" ]; then
echo "Options: ip-mod.sh slow"
echo " ip-mod.sh block"
echo " ip-mod.sh reset"
echo " ip-mod.sh restore"
exit
elif [ "$1" == "restore" ]; then
echo "restoring normal network"
exit
elif [ "$1" == "slow" ]; then
# simulate slow connection <to specific hosts>
echo "enabling slow connection"
ipfw add pipe 1 ip from any to any
ipfw add pipe 2 ip from any to any
ipfw pipe 1 config bw 60KByte/s delay 350ms
ipfw pipe 2 config bw 60KByte/s delay 350ms
elif [ "$1" == "block" ]; then
echo "enabling blocked connections"
ipfw add 1 deny tcp from any to any 1024-65535
elif [ "$1" == "reset" ]; then
echo "enabling reset connections"
ipfw add 1 reset tcp from any to any 1024-65535
fi

View file

@ -1 +0,0 @@
wc -l `find . -name \*.scala -print`

View file

@ -1,25 +0,0 @@
#!/usr/bin/env bash
#
# Utility to make log files from multi-node tests easier to analyze.
# Replaces jvm names and host:port with corresponding logical role name.
#
# Use with 0, 1 or 2 arguments.
#
# When using 0 arguments it reads from standard input
# and writes to standard output.
#
# With 1 argument it reads from the file specified in the first argument
# and writes to standard output.
#
# With 2 arguments it reads the file specified in the first argument
# and writes to the file specified in the second argument.
#
# You can also replace the contents of the clipboard instead of using files
# by supplying `clipboard` as argument
#
# check for an sbt command
type -P sbt &> /dev/null || fail "sbt command not found"
sbt "project remote-tests" "test:run-main org.apache.pekko.remote.testkit.LogRoleReplace $1 $2"

View file

@ -1,61 +0,0 @@
#!/usr/bin/env bash
#
# Generates statistics for release notes
#
# get the source location for this script; handles symlinks
function get_script_path {
local source="${BASH_SOURCE[0]}"
while [ -h "${source}" ] ; do
source="$(readlink "${source}")";
done
echo ${source}
}
# path, name, and dir for this script
declare -r script_path=$(get_script_path)
declare -r script_name=$(basename "${script_path}")
declare -r script_dir="$(cd -P "$(dirname "${script_path}")" && pwd)"
# print usage info
function usage {
echo "Usage: ${script_name} <tag-from> <tag-to> <milestone-name>"
echo "Example: ${script_name} v2.3.2 v2.3.3 2.3.3"
}
declare -r tag1=$1
declare -r tag2=$2
declare -r milestone_name=$3
declare -r tag_range="$tag1..$tag2"
declare authors=$($script_dir/authors.pl $tag_range)
declare author_count=$(echo "$authors" | wc -l | grep -o '[1-9].*')
declare diff_short=$(git diff --shortstat $tag_range | grep -o '[1-9].*')
declare script_user_agent="User-Agent: Akka-Stats-Script"
declare open_milestones=$(curl -s -H "$script_user_agent" "https://api.github.com/repos/apache/incubator-pekko/milestones?state=open")
declare closed_milestones=$(curl -s -H "$script_user_agent" "https://api.github.com/repos/apache/incubator-pekko/milestones?state=closed")
declare milestone_id=$(echo "$open_milestones$closed_milestones" | sed 's/"description"/\n/g' | perl -ne 'm/number":([0-9]+),"title":"(.+?)",/ && print "$1,$2\n"' | grep "$milestone_name" | cut -d"," -f 1)
declare tickets=$(curl -s -H "$script_user_agent" "https://api.github.com/repos/apache/incubator-pekko/issues?milestone=$milestone_id&state=all&per_page=100" | sed 's/"comments"/\n/g' | perl -ne 'm/number":([0-9]+),"title":"(.+?)",/ && print " - *$1* $2\n"' | sort -n)
declare ticket_count=$(echo "$tickets" | wc -l | grep -o '[1-9].*')
echo "$tag1 compared to Pekko $tag2":
echo "* $ticket_count tickets closed"
echo "* $diff_short"
echo "* X pages of docs vs Y in $tag1"
echo "* … and a total of $author_count committers!"
echo ""
echo "Fixed Tickets:"
echo "$tickets"
echo ""
echo "Credits:"
echo "commits added removed"
echo "$authors"

View file

@ -1,2 +0,0 @@
#!/bin/sh
sed -i '' 's/[[:space:]]*$//g' **/*.scala

View file

@ -1,4 +0,0 @@
#!/bin/bash
# Locate akka.serialization.Serializer.identifier()
find . -name *.scala | xargs grep "def identifier =" * | sort