Branch: refs/heads/master Author: Enrico Tröger enrico.troeger@uvena.de Committer: GitHub noreply@github.com Date: Sat, 05 Aug 2023 21:03:59 UTC Commit: 2198888ba1cb5e2e86dc780cc2fa4ce56a719c8f https://github.com/geany/geany/commit/2198888ba1cb5e2e86dc780cc2fa4ce56a719c...
Log Message: ----------- Remove obsolete helper scripts (#3486)
* Remove obsolete helper scripts
scripts/changelist.pl: process ChangeLog which we do not use anymore scripts/cross-build-mingw.sh: old cross build script, replaced by #3315 scripts/rstrip-whitespace.py: probably unused scripts/fix-alignment.pl scripts/fix-cxx-comments.pl scripts/warning-summary.pl
Modified Paths: -------------- scripts/changelist.pl scripts/cross-build-mingw.sh scripts/fix-alignment.pl scripts/fix-cxx-comments.pl scripts/rstrip-whitespace.py scripts/warning-summary.pl
Modified: scripts/changelist.pl 135 lines changed, 0 insertions(+), 135 deletions(-) =================================================================== @@ -1,135 +0,0 @@ -#!/usr/bin/env perl -# Copyright: 2008, The Geany contributors -# License: GNU GPL V2 or later, as published by the Free Software Foundation, USA. -# Warranty: NONE - -# Searches a ChangeLog file for a line matching 'matchstring', then matches -# all lines until two consecutive empty lines are found. The process then -# repeats until all matching blocks of text are found. -# Results are printed in reverse, hence in chronological order (as ChangeLogs -# are usually written in reverse date order). -# -# The resulting lines are then formatted to be easier to read and edit into a -# NEWS file. - -# Example ChangeLog format: -#2009-04-03 Joe Author joe@example.net -# -# * src/file.c, src/file.h, -# src/another.c: -# Some change description, -# spanning several lines. -# * foo.c: Combined line. - -use strict; -use warnings; - -my $argc = $#ARGV + 1; -my ($matchstr, $infile); - -if ($argc == 1) -{ - ($infile) = @ARGV; - $matchstr = '.'; -} -elsif ($argc == 2) -{ - ($matchstr, $infile) = @ARGV; -} -else { - die <<END; -Usage: -$0 changelogfile >outfile -$0 matchstring changelogfile >outfile - - matchstring is a case-insensitive regular expression, e.g. 'joe|fred'. -END -} - -open(INPUT, $infile) - or die "Couldn't open $infile for reading: $!\n"; - -my $entry; # the current matching block of text -my @entries; # changelog entries, one per date - -# first parse each ChangeLog entry into an array - -my $found = 0; # if we're in a matching block of text -my $blank = 0; # whether the last line was empty - -while (<INPUT>) { - my $line = $_; # read a line, including \n char - - if (! $found) { - ($line =~ m/$matchstr/) and $found = 1; - } else { - if (length($line) <= 1) { # current line is empty - if ($blank > 0) { # previous line was also empty - push(@entries, $entry); # append entry - $entry = ""; - $found = 0; # now look for next match - $blank = 0; - } - else { - $blank = 1; - } - } - } - if ($found) { - $entry .= $line; - } -} -close(INPUT); - -# reformat entries -foreach $entry (reverse @entries) { - my @lines = split(/\n/, $entry); - my $fl = 0; # in file list lines - my $cm = 0; # in commit message lines - - foreach my $line (@lines){ - my $flset = $fl; - - # strip trailing space - $line =~ s/\s+$//g; - - if (!$cm){ - # check if in filelist - ($line =~ m/ * /) and $fl = 1; - # join filelist together on one line - $fl and ($line =~ s/^ / /); - if ($fl and ($line =~ m/:/)){ - $fl = 0; - # separate ' * foo.c: Some edit.' messages: - if (!($line =~ m/:$/)) { - ($line =~ s/:/:\n*/); - } - } - $fl and ($line =~ m/,$/) or $fl = 0; - } - if (!$flset){ - # Asterisk commit messages - if (!$cm and ($line =~ m/^ /)){ - $cm = 1; - $line =~ s/^( )/$1* /; - } else { - $cm and ($line =~ s/^( )/$1 /); # indent continuing lines - } - $cm and ($line =~ m/.$/) and $cm = 0; - } - #~ print $fl.','.$cm.','.$line."\n"; next; # debug - - # change file list start char to easily distinguish between file list and commit messages - $line =~ s/^ * /@ /g; - # strip <email> from date line - $line =~ s/^([0-9-]+.*?)\s+<.+>$/$1/g; - # remove indent - $line =~ s/^ //g; - - if ($line ne ""){ - print $line; - (!$fl) and print "\n"; - } - } - print "\n"; -}
Modified: scripts/cross-build-mingw.sh 98 lines changed, 0 insertions(+), 98 deletions(-) =================================================================== @@ -1,98 +0,0 @@ -#!/bin/sh -# A script to automate setup and build for Windows cross-compilation -# -# What it does: -# 1) prepare a build directory -# 2) download and unpacked the dependencies -# (see http://www.gtk.org/download/win32.php) -# 2.1) fixup the unpacked pkg-config file paths -# 3) setup the few required paths -# 4) configure with sensible options for this -# 5) build -# 6) install in a local directory -# 7) pack the installation in a ZIP file, ready to be used -# (but does not pack the dependencies) - -# You may change those -HOST=i686-w64-mingw32 -GTK_BUNDLE_ZIP="https://download.geany.org/contrib/gtk/gtk+-bundle_3.8.2-20131001_win32.zip" -BUILDDIR=_build-cross-mingw -CONFIGUREFLAGS="--enable-nls" -MAKEFLAGS="${MAKEFLAGS:--j2}" - -while getopts '32b:h' o; do - case "$o" in - b) BUILDDIR="$OPTARG";; - h) - cat <<EOF -USAGE: $0 [-b DIR] [-h] - --b DIR Use DIR as build directory --h Show this help and exit -EOF - exit 0;; - *) echo "Invalid option $o (see -h)">&2; exit 1;; - esac -done -shift $((OPTIND - 1)) - -# USAGE: fetch_and_unzip URL DEST_PREFIX -fetch_and_unzip() -{ - local basename=${1##*/} - curl -L -# "$1" > "$basename" - unzip -qn "$basename" -d "$2" - rm -f "$basename" -} - -if test -d "$BUILDDIR"; then - cat >&2 <<EOF -** Directory "$BUILDDIR/" already exists. -If it was created by this tool and just want to build, simply run make: - $ make -C "$BUILDDIR/_build/" - -If however you want to recreate it, please remove it first: - $ rm -rf "$BUILDDIR/" -EOF - exit 1 -fi - -set -e -set -x - - -test -f configure -# check if the host tools are available, because configure falls back -# on default non-prefixed tools if they are missing, and it can spit -# quite a lot of subtle errors. also avoids going further if something -# is obviously missing. -type "$HOST-gcc" - -SRCDIR="$PWD" - -mkdir "$BUILDDIR" -cd "$BUILDDIR" - -mkdir _deps - -fetch_and_unzip "$GTK_BUNDLE_ZIP" _deps - -# fixup the prefix= in the pkg-config files -sed -i "s%^(prefix=).*$%\1$PWD/_deps%" _deps/lib/pkgconfig/*.pc - -export PKG_CONFIG_PATH="$PWD/_deps/lib/pkgconfig/" -export CPPFLAGS="-I$PWD/_deps/include" -export LDFLAGS="-L$PWD/_deps/lib" - -mkdir _build -cd _build -"$SRCDIR/configure" \ - --host=$HOST \ - --disable-silent-rules \ - --prefix="$PWD/../_install" \ - $CONFIGUREFLAGS || { - cat config.log - exit 1 -} -make $MAKEFLAGS -make $MAKEFLAGS install
Modified: scripts/fix-alignment.pl 108 lines changed, 0 insertions(+), 108 deletions(-) =================================================================== @@ -1,108 +0,0 @@ -#!/usr/bin/env perl -# Copyright: 2009 The Geany contributors -# License: GNU GPL V2 or later, as published by the Free Software Foundation, USA. -# Warranty: NONE - -# Re-align C source code for Geany. -# Doesn't handle indents/blank lines/anything complicated ;-) - -use strict; -use warnings; - -use Getopt::Std; - -my %args = (); -getopts('w', %args); -my $opt_write = $args{'w'}; - -my $argc = $#ARGV + 1; -my $scriptname = $0; - -(($argc == 1) or ($argc >= 1 and $opt_write)) or die <<END; -Usage: -$scriptname sourcefile [>outfile] - Print formatted output to STDOUT or outfile. - Warning: do not use the same file for outfile. - -$scriptname -w sourcefile(s) - Writes to the file(s) in-place. - Warning: backup your file(s) first or use clean version control files. -END - - -sub parse($) -{ - my ($infile) = @_; - my @lines; - - open(INPUT, $infile) or die "Couldn't open $infile for reading: $!\n"; - - while (<INPUT>) { - my $line = $_; # read a line, including \n char - - # strip trailing space & newline - $line =~ s/\s+$//g; - - # for now, don't process lines with comments, strings, preproc non-defines, overflowed lines or chars - # multi-line comment internal lines are skipped only if they start with '* '. - if (!($line =~ m,/*|*/|//|"|\$|',) and !($line =~ m/^\s*(*\s|#[^d])/)) { - # make binary operators have *one* space each side - # operators must have longer variants first otherwise trailing operators can be broken e.g. "+ =" - # '*' ignored as could be pointer - my $ops = '<<=,<<,>>=,>>,<=,>=,<,>,||,|=,|,&&,&=,-=,+=,+,*=,/=,/,==,!=,%=,%,^=,^,='; - $ops =~ s/([|*+])/\$1/g; # escape regex chars - $ops =~ s/,/|/g; - $line =~ s/([\w)]]) ?($ops) ?([\w(]|$)/$1 $2 $3/g; - - # space binary operators that can conflict with unaries with cast and/or 'return -1/&foo' - # '-' could be unary "(gint)-j" - # '&' could be address-of "(type*)&foo" - $line =~ s/([\w]])(-|&) ?([\w(]|$)/$1 $2 $3/g; - - # space ternary conditional operator - $line =~ s/ ?? ?(.+?) ?: ?/ ? $1 : /g; - - # space comma operator (allowing for possible alignment space afterwards) - $line =~ s/ ?,(\S)/, $1/g; - - # space after statements - my $statements = 'for|if|while|switch'; - $line =~ s/\b($statements)\b\s*/$1 /g; - - # no space on inside of brackets - $line =~ s/(\s+/(/g; - $line =~ s/(\S)\s+)/$1)/g; - - # enforce 'fn(void);' in prototypes - $line =~ s/^(\w.+\w());$/$1void);/; - } - # strip trailing space again (e.g. a trailing operator now has space afterwards) - $line =~ s/\s+$//g; - - push(@lines, $line); - } - close(INPUT); - - my $text = join("\n", @lines); - undef @lines; # free memory - $text .= "\n"; - - # 1+ newline -> 2 newlines after function - $text =~ s/^}\n\n+([^\n])/}\n\n\n$1/gm; - - if (!$opt_write) { - print $text; - } - else { - open(OUTPUT, ">$infile") or die "Couldn't open $infile for writing: $!\n"; - print OUTPUT $text; - close(OUTPUT); - } -} - - -foreach my $infile (@ARGV) -{ - parse($infile); -} -
Modified: scripts/fix-cxx-comments.pl 78 lines changed, 0 insertions(+), 78 deletions(-) =================================================================== @@ -1,78 +0,0 @@ -#!/usr/bin/env perl -# fix-cxx-comments.pl -# Copyright (c) 2008, Daniel Richard G. <skunk(at)iskunk(dot)org> -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of the author nor the names of -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -use strict; -use warnings; - -sub xform($$$) -{ - my ($a, $b, $c) = @_; - - $a =~ s!///!/**!; - $b =~ s!(\a\s*)///!$1 **!g; - $c =~ s!///! **!; - - $a =~ s!//!/*!; - $b =~ s!(\a\s*)//!$1 *!g; - $c =~ s!//! *!; - - $c .= ' */'; - - return $a . $b . $c . "\a"; -} - -sub fix_cxx_comments() -{ - s/\r//g; # This is Unix, not DOS - s/[\t ]+$//g; # Remove trailing whitespace - s/\n/\a/g; # Convert file to single line - - # Process multi-line comments: - # $1 = first line of comment, $3 = last line, $2 = lines in between - s! (\a\s*//[^\a]*) ((?:\a\s*//[^\a]*)*) (\a\s*//[^\a]*)\a !xform($1,$2,$3)!egx; - - # Process /// single-line comments - s! (\a\s*)///(\s?)([^\a]*)\a !$1/**$2$3$2*/\a!gx; - s! (\s+)///(\s?)([^\a]*)\a !$1/**$2$3$2*/\a!gx; - - # Process // single-line comments - s! (\a\s*)//(\s?)([^\a]*)\a !$1/*$2$3$2*/\a!gx; - s! (\s+)//(\s?)([^\a]*)\a !$1/*$2$3$2*/\a!gx; - - s/\a/\n/g; # Convert back to multiple lines -} - -{ - local $/; - $_ = <>; - fix_cxx_comments(); - print; -} -
Modified: scripts/rstrip-whitespace.py 23 lines changed, 0 insertions(+), 23 deletions(-) =================================================================== @@ -1,23 +0,0 @@ -#!/usr/bin/env python - -import sys - -filenames = sys.argv[1:] - -def backup_file (fn): - open ("%s~" % fn, "w").write (open (fn, "r").read ()) - -for fn in filenames: - #backup_file (fn) - contents = open (fn, "r").read () - lines = contents.split ('\n') - with open (fn, "w") as fobj: - for line in lines: - line = line.rstrip () - fobj.write ("%s\n" % line) - contents = open (fn, "r").read () - contents.rstrip () - while contents[-1] in " \t\r\n": - contents = contents[:-1] - open (fn, "w").write ("%s\n" % contents) -
Modified: scripts/warning-summary.pl 78 lines changed, 0 insertions(+), 78 deletions(-) =================================================================== @@ -1,78 +0,0 @@ -#!/usr/bin/env perl -# warning-summary.pl -# Copyright (c) 2008, Daniel Richard G. <skunk(at)iskunk(dot)org> -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of the author nor the names of -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -use strict; -use warnings; - -use encoding 'utf8'; - -binmode(STDIN, ":utf8"); - -open(OUT, "| sort | uniq -c | sort -nr"); -binmode(OUT, ":utf8"); - -while (<>) -{ - /warning:/ || next; - /near initialization for/ && next; - /shadowed declaration is here/ && next; - /(this will be reported only once per input file)/ && next; - - s/^.*: warning: //g; - - tr/\x{2018}\x{2019}/''/; - - s/\barg(ument|) \d+\b/arg$1 N/g; - - s/\b(type|function|variable|enumeration value|declaration of|argument N of|parameter|type of|type of bit-field|prototype for) '[^']+'/$1 'blah'/g; - - s/"[^"]+" (is not defined)/"BLAH" $1/g; - - s/'[^']+' (defined but not used)/'blah' $1/g; - - s/format '%\w+'/format '%blah'/g; - - s/'%\w+' printf format/'%blah' printf format/g; - - s/'\d+'/'NNN'/g; - - s/'[^']+' (declared 'static' but never defined)/'blah' $1/g; - - s/(missing braces around initializer for) '\w+'/$1 'blah'/g; - - s/(missing initializer for member) '\w+::\w+'/$1 'Foo::bar'/g; - - print OUT; -} - -close(OUT); - -# end warning-summary.pl -
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).