From 2f1566b74f83ea33d156cce3cee60f137db58489 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erkin=20Batu=20Altunba=C5=9F?= Date: Wed, 11 Jul 2012 18:36:18 +0300 Subject: [PATCH 01/10] I tried to make it a bit more portable. I hope I didn't screw something up. --- ponysay | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ponysay b/ponysay index e50b0b1d..79e83391 100755 --- a/ponysay +++ b/ponysay @@ -1,13 +1,13 @@ #!/usr/bin/env bash -version=0.9 -SYSTEMPONIES=/usr/share/ponysay/ponies +version=0.10 +SYSTEMPONIES="/usr/share/ponysay/ponies" HOMEPONIES="${HOME}/.ponysay/ponies" pony="*" -wrap= +wrap="" if [ "$TERM" = "linux" ]; then - SYSTEMPONIES=/usr/share/ponysay/ttyponies + SYSTEMPONIES="/usr/share/ponysay/ttyponies" HOMEPONIES="${HOME}/.ponysay/ttyponies" fi @@ -66,7 +66,7 @@ say() { if [ "$PONYSAY_FULL_WIDTH" = 'no' ] || [ "$PONYSAY_FULL_WIDTH" = 'n' ] || [ "$PONYSAY_FULL_WIDTH" = '0' ]; then cat else - WIDTH=$((stty size <&2 || echo 0 0) | cut -d ' ' -f 2) + WIDTH=`(stty size <&2 || echo 0 0) | cut -d ' ' -f 2` ponysaytruncater $WIDTH 2>/dev/null || ${HOME}/.local/bin/ponysaytruncater $WIDTH 2>/dev/null || ./ponysaytruncater $WIDTH 2>/dev/null || @@ -79,7 +79,7 @@ say() { if [ "$PONYSAY_SHELL_LINES" = "" ]; then PONYSAY_SHELL_LINES=2 fi - head --lines=$(( $(stty size <&2 | cut -d ' ' -f 1) - $PONYSAY_SHELL_LINES )) + head --lines=`( \`stty size <&2 | cut -d ' ' -f 1\` - $PONYSAY_SHELL_LINES )` } if [ "$TERM" = "linux" ] || [ "$PONYSAY_TRUNCATE_HEIGHT" = 'yes' ] || [ "$PONYSAY_TRUNCATE_HEIGHT" = 'y' ] || [ "$PONYSAY_TRUNCATE_HEIGHT" = '1' ]; then @@ -106,7 +106,7 @@ do done shift $((OPTIND - 1)) -if ! hash $cmd &>/dev/null; then +hash $cmd &>/dev/null; if [ $? -ne 0 ]; then cat >&2 < Date: Wed, 11 Jul 2012 18:42:49 +0300 Subject: [PATCH 02/10] See comment on last edit. --- ponysay | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ponysay b/ponysay index 79e83391..bfe74b7e 100755 --- a/ponysay +++ b/ponysay @@ -79,7 +79,7 @@ say() { if [ "$PONYSAY_SHELL_LINES" = "" ]; then PONYSAY_SHELL_LINES=2 fi - head --lines=`( \`stty size <&2 | cut -d ' ' -f 1\` - $PONYSAY_SHELL_LINES )` + head --lines=$(( `stty size <&2 | cut -d ' ' -f 1` - $PONYSAY_SHELL_LINES )) } if [ "$TERM" = "linux" ] || [ "$PONYSAY_TRUNCATE_HEIGHT" = 'yes' ] || [ "$PONYSAY_TRUNCATE_HEIGHT" = 'y' ] || [ "$PONYSAY_TRUNCATE_HEIGHT" = '1' ]; then From 9b2e85c10d3dc7ad1142b95e49aeb4d8e6757b02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erkin=20Batu=20Altunba=C5=9F?= Date: Wed, 11 Jul 2012 18:49:45 +0300 Subject: [PATCH 03/10] A binary executable isn't a directory. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e9c32799..502f1b4d 100644 --- a/Makefile +++ b/Makefile @@ -41,4 +41,4 @@ uninstall: unlink "$(DESTDIR)/usr/share/man/man1/ponythink.1" clean: - rm -r "ponysaytruncater" + rm "ponysaytruncater" From cecfbf75e8b1cc930de4ac347496be9ebce88a84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erkin=20Batu=20Altunba=C5=9F?= Date: Thu, 12 Jul 2012 16:46:17 +0200 Subject: [PATCH 04/10] A tiny bit of tweaking in documents.See issue 22 to discuss. --- manpage.1 => manpage.6 | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) rename manpage.1 => manpage.6 (84%) diff --git a/manpage.1 b/manpage.6 similarity index 84% rename from manpage.1 rename to manpage.6 index e35603ff..4b76a699 100644 --- a/manpage.1 +++ b/manpage.6 @@ -2,7 +2,7 @@ .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) -.TH PONYSAY SECTION "July 4, 2012" +.TH PONYSAY 6 "July 12, 2012" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: @@ -84,26 +84,13 @@ Bugs can be reported in <\fBhttps://github.com/erkin/ponysay/issues\fP>. .br .SH AUTHOR ponysay was written by Erkin Batu Altunbaş -with contributions from Mattias Andrée, Sven-Hendrik Haase, Jan Alexander Steffens &a. -.\" See file CREDITS for full list +with major contributions from Mattias Andrée, Sven-Hendrik Haase, Jan Alexander Steffens et al. +.\" See file CREDITS for full list. .PP This manual page was written by Louis Taylor for the Debian project (and may be used by others), and edited by Mattias Andrée . .br -.SH COPYRIGHT -DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE -.br -Version 2, December 2004 .PP -Copyright (C) 2012 Erkin Batu Altunbaş -.PP -Everyone is permitted to copy and distribute verbatim or modified -copies of this license document, and changing it is allowed as long -as the name is changed. -.PP -DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE -.br -TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION -.PP -0. You just DO WHAT THE FUCK YOU WANT TO. +This program is licensed under WTFPL. +.\" See file COPYING to see the license. From c8c0aa155d6a90d3be2efc88a0224d8496acb0f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Andr=C3=A9e?= Date: Thu, 12 Jul 2012 16:58:05 +0300 Subject: [PATCH 05/10] Update master --- manpage.6 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manpage.6 b/manpage.6 index 4b76a699..e25a560b 100644 --- a/manpage.6 +++ b/manpage.6 @@ -80,7 +80,7 @@ want to truncate the output on the height even if you are not running \fIponysay Bugs can be reported in <\fBhttps://github.com/erkin/ponysay/issues\fP>. .SH SEE ALSO .BR cowsay (1), -.BR fortune (1). +.BR fortune (6). .br .SH AUTHOR ponysay was written by Erkin Batu Altunbaş From fc3d2d660a95244f11fa7bbb9a004a13e7f3cda0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Andr=C3=A9e?= Date: Thu, 12 Jul 2012 16:59:18 +0300 Subject: [PATCH 06/10] The manpage is currently in section 6, not section 1 (issue #22 is open) --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 502f1b4d..ca6a5e1c 100644 --- a/Makefile +++ b/Makefile @@ -25,8 +25,8 @@ install: all install "COPYING" "$(DESTDIR)/usr/share/licenses/ponysay/COPYING" mkdir -p "$(DESTDIR)/usr/share/man/man1" - install "manpage.1" "$(DESTDIR)/usr/share/man/man1/ponysay.1" - ln -sf "ponysay.1" "$(DESTDIR)/usr/share/man/man1/ponythink.1" + install "manpage.6" "$(DESTDIR)/usr/share/man/man1/ponysay.6" + ln -sf "ponysay.6" "$(DESTDIR)/usr/share/man/man1/ponythink.6" uninstall: rm -fr "$(DESTDIR)/usr/share/ponysay/ponies" @@ -37,8 +37,8 @@ uninstall: unlink "$(DESTDIR)/usr/share/zsh/site-functions/_ponysay"; unlink "$(DESTDIR)/usr/share/licenses/ponysay/COPYING" unlink "$(DESTDIR)/usr/share/bash-completion/completions/ponysay" - unlink "$(DESTDIR)/usr/share/man/man1/ponysay.1" - unlink "$(DESTDIR)/usr/share/man/man1/ponythink.1" + unlink "$(DESTDIR)/usr/share/man/man1/ponysay.6" + unlink "$(DESTDIR)/usr/share/man/man1/ponythink.6" clean: rm "ponysaytruncater" From 3347fa84c3dbab2b40ef683df2d7a57d548db2cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Andr=C3=A9e?= Date: Thu, 12 Jul 2012 16:59:47 +0300 Subject: [PATCH 07/10] missed one line --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ca6a5e1c..079092e2 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,7 @@ install: all mkdir -p "$(DESTDIR)/usr/share/licenses/ponysay/" install "COPYING" "$(DESTDIR)/usr/share/licenses/ponysay/COPYING" - mkdir -p "$(DESTDIR)/usr/share/man/man1" + mkdir -p "$(DESTDIR)/usr/share/man/man6" install "manpage.6" "$(DESTDIR)/usr/share/man/man1/ponysay.6" ln -sf "ponysay.6" "$(DESTDIR)/usr/share/man/man1/ponythink.6" From 9f4f748cf95407ba9fd4d8a8c347d735fab1416e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erkin=20Batu=20Altunba=C5=9F?= Date: Thu, 12 Jul 2012 17:07:22 +0300 Subject: [PATCH 08/10] ponysaytruncater seems to be writeprotected. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 079092e2..e5b870f6 100644 --- a/Makefile +++ b/Makefile @@ -41,4 +41,4 @@ uninstall: unlink "$(DESTDIR)/usr/share/man/man1/ponythink.6" clean: - rm "ponysaytruncater" + rm -f "ponysaytruncater" From dbfb357d7cea1732786c7cd49211910cc84e7e43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erkin=20Batu=20Altunba=C5=9F?= Date: Thu, 12 Jul 2012 19:06:41 +0200 Subject: [PATCH 09/10] makefile mistake man1 instead of man6 --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index e5b870f6..eac642f4 100644 --- a/Makefile +++ b/Makefile @@ -25,8 +25,8 @@ install: all install "COPYING" "$(DESTDIR)/usr/share/licenses/ponysay/COPYING" mkdir -p "$(DESTDIR)/usr/share/man/man6" - install "manpage.6" "$(DESTDIR)/usr/share/man/man1/ponysay.6" - ln -sf "ponysay.6" "$(DESTDIR)/usr/share/man/man1/ponythink.6" + install "manpage.6" "$(DESTDIR)/usr/share/man/man6/ponysay.6" + ln -sf "ponysay.6" "$(DESTDIR)/usr/share/man/man6/ponythink.6" uninstall: rm -fr "$(DESTDIR)/usr/share/ponysay/ponies" @@ -37,8 +37,8 @@ uninstall: unlink "$(DESTDIR)/usr/share/zsh/site-functions/_ponysay"; unlink "$(DESTDIR)/usr/share/licenses/ponysay/COPYING" unlink "$(DESTDIR)/usr/share/bash-completion/completions/ponysay" - unlink "$(DESTDIR)/usr/share/man/man1/ponysay.6" - unlink "$(DESTDIR)/usr/share/man/man1/ponythink.6" + unlink "$(DESTDIR)/usr/share/man/man6/ponysay.6" + unlink "$(DESTDIR)/usr/share/man/man6/ponythink.6" clean: rm -f "ponysaytruncater" From 0d7cbc70d75169e5debbe5c67b4eb8773835dd80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erkin=20Batu=20Altunba=C5=9F?= Date: Fri, 13 Jul 2012 02:18:53 +0200 Subject: [PATCH 10/10] tiny fix in help --- ponysay | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ponysay b/ponysay index bfe74b7e..7ec7943a 100755 --- a/ponysay +++ b/ponysay @@ -43,7 +43,7 @@ Options: -f[name] Select a pony (either a file name or a pony name.) -W[column] The screen column where the message should be wrapped. -See man ponysay(1) for more information. +See man ponysay(6) for more information. EOF }