aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.am43
-rwxr-xr-xscripts/contributors.sh30
-rwxr-xr-xscripts/contrithanks.sh14
-rwxr-xr-xscripts/zsh.pl17
4 files changed, 75 insertions, 29 deletions
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
new file mode 100644
index 00000000..32dc1b9e
--- /dev/null
+++ b/scripts/Makefile.am
@@ -0,0 +1,43 @@
+#***************************************************************************
+# _ _ ____ _
+# Project ___| | | | _ \| |
+# / __| | | | |_) | |
+# | (__| |_| | _ <| |___
+# \___|\___/|_| \_\_____|
+#
+# Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+#
+# This software is licensed as described in the file COPYING, which
+# you should have received as part of this distribution. The terms
+# are also available at https://curl.haxx.se/docs/copyright.html.
+#
+# You may opt to use, copy, modify, merge, publish, distribute and/or sell
+# copies of the Software, and permit persons to whom the Software is
+# furnished to do so, under the terms of the COPYING file.
+#
+# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+# KIND, either express or implied.
+#
+###########################################################################
+ZSH_FUNCTIONS_DIR = @ZSH_FUNCTIONS_DIR@
+PERL = @PERL@
+
+ZSH_COMPLETION_FUNCTION_FILENAME = _curl
+
+all-local: $(ZSH_COMPLETION_FUNCTION_FILENAME)
+
+$(ZSH_COMPLETION_FUNCTION_FILENAME): zsh.pl
+if CROSSCOMPILING
+ @echo "NOTICE: we can't generate zsh completion when cross-compiling!"
+else # if not cross-compiling:
+ @if ! test -x "$(PERL)"; then echo "No perl: can't install zsh.pl"; exit 0; fi
+ $(PERL) $(srcdir)/zsh.pl $(top_builddir)/src/curl$(EXEEXT) > $@
+endif
+
+install-data-local:
+if CROSSCOMPILING
+ @echo "NOTICE: we can't install zsh completion when cross-compiling!"
+else # if not cross-compiling:
+ $(MKDIR_P) $(DESTDIR)$(ZSH_FUNCTIONS_DIR)
+ $(INSTALL_DATA) $(ZSH_COMPLETION_FUNCTION_FILENAME) $(DESTDIR)$(ZSH_FUNCTIONS_DIR)/$(ZSH_COMPLETION_FUNCTION_FILENAME)
+endif
diff --git a/scripts/contributors.sh b/scripts/contributors.sh
index 0840bfab..d62baade 100755
--- a/scripts/contributors.sh
+++ b/scripts/contributors.sh
@@ -6,11 +6,11 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
-# Copyright (C) 2013-2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+# Copyright (C) 2013-2016, Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
-# are also available at http://curl.haxx.se/docs/copyright.html.
+# are also available at https://curl.haxx.se/docs/copyright.html.
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
@@ -22,12 +22,9 @@
###########################################################################
#
-# This script shows all mentioned contributors from <hash> until HEAD. To aid
-# when writing RELEASE-NOTES and THANKS.
-#
-# Use --releasenotes to also include the names from the existing RELEASE-NOTES
-# file, which is handy when we've added names manually in there that should be
-# included in an updated list.
+# This script shows all mentioned contributors from the given <hash>/<tag>
+# until HEAD and adds the contributors already mentioned in the existing
+# RELEASE-NOTES.
#
start=$1
@@ -48,31 +45,26 @@ fi
# awk them into RELEASE-NOTES format
(
git log $start..HEAD | \
-egrep -i '(Author|Commit|by):' | \
+egrep -ai '(^Author|^Commit|by):' | \
cut -d: -f2- | \
cut '-d<' -f1 | \
tr , '\012' | \
sed 's/ and /\n/' | \
-sed -e 's/^ //' -e 's/ $//g'
+sed -e 's/^ //' -e 's/ $//g' -e 's/@users.noreply.github.com$/ on github/'
-if echo "$*" | grep -qw -- '--releasenotes';then
- # if --releasenotes was used
- # grep out the list of names from RELEASE-NOTES
- # split on ", "
- # remove leading white spaces
-grep "^ [^ \(]" RELEASE-NOTES| \
+grep -a "^ [^ \(]" RELEASE-NOTES| \
sed 's/, */\n/g'| \
sed 's/^ *//'
-fi
+
)| \
sed -f ./docs/THANKS-filter | \
-grep ' ' | \
+grep -a ' ' | \
sort -fu | \
awk '{
num++;
n = sprintf("%s%s%s,", n, length(n)?" ":"", $0);
#print n;
- if(length(n) > 78) {
+ if(length(n) > 77) {
printf(" %s\n", p);
n=sprintf("%s,", $0);
}
diff --git a/scripts/contrithanks.sh b/scripts/contrithanks.sh
index b7a16ca5..6ca7e832 100755
--- a/scripts/contrithanks.sh
+++ b/scripts/contrithanks.sh
@@ -6,11 +6,11 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
-# Copyright (C) 2013-2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+# Copyright (C) 2013-2016, Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
-# are also available at http://curl.haxx.se/docs/copyright.html.
+# are also available at https://curl.haxx.se/docs/copyright.html.
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
@@ -36,22 +36,22 @@ cat ./docs/THANKS
(
git log $start..HEAD | \
-egrep -i '(Author|Commit|by):' | \
+egrep -ai '(^Author|^Commit|by):' | \
cut -d: -f2- | \
cut '-d<' -f1 | \
tr , '\012' | \
sed 's/ and /\n/' | \
-sed -e 's/^ //' -e 's/ $//g'
+sed -e 's/^ //' -e 's/ $//g' -e 's/@users.noreply.github.com$/ on github/'
# grep out the list of names from RELEASE-NOTES
# split on ", "
# remove leading white spaces
-grep "^ [^ (]" RELEASE-NOTES| \
+grep -a "^ [^ (]" RELEASE-NOTES| \
sed 's/, */\n/g'| \
sed 's/^ *//'
)| \
sed -f ./docs/THANKS-filter | \
-grep ' ' | \
+grep -a ' ' | \
sort -fu | \
-grep -xvf ./docs/THANKS
+grep -aixvf ./docs/THANKS
diff --git a/scripts/zsh.pl b/scripts/zsh.pl
index 7520a15a..f0d8c195 100755
--- a/scripts/zsh.pl
+++ b/scripts/zsh.pl
@@ -38,14 +38,14 @@ sub parse_main_opts {
my ($cmd, $regex) = @_;
my @list;
- my @lines = split /\n/, `"$curl" $cmd`;
+ my @lines = call_curl($cmd);
foreach my $line (@lines) {
my ($short, $long, $arg, $desc) = ($line =~ /^$regex/) or next;
my $option = '';
- $desc =~ s/'/''/g if defined $desc;
+ $desc =~ s/'/'\\''/g if defined $desc;
$desc =~ s/\[/\\\[/g if defined $desc;
$desc =~ s/\]/\\\]/g if defined $desc;
@@ -74,4 +74,15 @@ sub parse_main_opts {
return @list;
}
-sub trim { my $s = shift; $s =~ s/^\s+|\s+$//g; return $s };
+sub trim { my $s = shift; $s =~ s/^\s+|\s+$//g; return $s };
+
+sub call_curl {
+ my ($cmd) = @_;
+ my $output = `"$curl" $cmd`;
+ if ($? == -1) {
+ die "Could not run curl: $!";
+ } elsif ((my $exit_code = $? >> 8) != 0) {
+ die "curl returned $exit_code with output:\n$output";
+ }
+ return split /\n/, $output;
+}