@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Cleanup unused cowsay files (related to legacy Perl binary version)

Summary:
Premising that Remarkup supports a fully-featured cowsay generator (!)... since 2015 this awesome
thing no longer requires a binary cowsay command, since everything was rewritten in the core:

c705c8011e964945a6f73ae78087e188de0bd71f

So, some files from the legacy cowsay version in Perl can be safely removed.

We still thank the original author Tony Monroe for the original version in Perl (dated 2000),
and Evan Priestley for the re-implementation in PHP.

Probably nobody knows about this feature. This may change in the future. See T15401.

Closes T15418

Test Plan:
Try some awesome cows to verify that everything still works. For instance:

```
cowsay {{{
hello
}}}
```

```
cowsay (think=yes,eyes=XX,tongue=^^) {{{
hello
}}}
```

```
cowsay (cow=stegosaurus) {{{
hello
}}}
```

If nothing explodes, yuppie! Cowsay still works.

Credits to the original version in Perl remained in place.

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

Subscribers: avivey, speck, tobiaswiese, Matthew, Cigaryno

Maniphest Tasks: T15418

Differential Revision: https://we.phorge.it/D25242

+8 -534
-15
externals/cowsay/INSTALL
··· 1 - ================= 2 - Installing cowsay 3 - ================= 4 - 5 - If you really want to get things installed a nice and pretty way, 6 - 7 - sh install.sh 8 - 9 - It will ask approximately one question. If you can't answer it, 10 - you need serious help. 11 - 12 - If the install goes well, you can start cowing immediately! Just 13 - be sure to read the manual page first... 14 - 15 - $Id: INSTALL,v 1.1 1999/08/14 08:03:17 tony Exp $
-11
externals/cowsay/MANIFEST
··· 1 - ChangeLog Changes to recent versions. 2 - INSTALL Instructions for installing cowsay. 3 - LICENSE The license for use and redistribution of cowsay. 4 - MANIFEST This file. 5 - README Read this first. Really. 6 - Wrap.pm.diff Diff for Text/Wrap.pm. 7 - cows/* Support files used by cowsay. 8 - cowsay Main cowsay executable. 9 - cowsay.1 Main cowsay manual page. 10 - install.sh cowsay installation script. 11 - pgp_public_key.txt Verify the signature file with this key.
+8
externals/cowsay/README
··· 36 36 -- Tony Monroe (tony@nog.net) 37 37 38 38 $Id: README,v 1.3 2000/05/28 06:24:46 tony Exp $ 39 + 40 + ---- 41 + 42 + In September 2015, Phabricator imported the Perl version of cowsay 43 + in the core, to use its nice template files. Anyway, the logic now 44 + is not in Perl. It was re-implemented in PHP, here: 45 + 46 + src/infrastructure/markup/interpreter/PhabricatorRemarkupCowsayBlockInterpreter.php
-47
externals/cowsay/Wrap.pm.diff
··· 1 - *** Wrap.pm.in Thu May 22 00:21:42 1997 2 - --- Wrap.pm Fri Nov 12 10:00:15 1999 3 - *************** 4 - *** 3,9 **** 5 - require Exporter; 6 - 7 - @ISA = (Exporter); 8 - ! @EXPORT = qw(wrap); 9 - @EXPORT_OK = qw($columns); 10 - 11 - $VERSION = 97.011701; 12 - --- 3,9 ---- 13 - require Exporter; 14 - 15 - @ISA = (Exporter); 16 - ! @EXPORT = qw(wrap fill); 17 - @EXPORT_OK = qw($columns); 18 - 19 - $VERSION = 97.011701; 20 - *************** 21 - *** 66,71 **** 22 - --- 66,90 ---- 23 - 24 - print "-----------$r---------\n" if $debug;; 25 - return $r; 26 - + } 27 - + 28 - + ## Copied up from below. 29 - + sub fill 30 - + { 31 - + my ($ip, $xp, @raw) = @_; 32 - + my @para; 33 - + my $pp; 34 - + 35 - + for $pp (split(/\n\s+/, join("\n",@raw))) { 36 - + $pp =~ s/\s+/ /g; 37 - + my $x = wrap($ip, $xp, $pp); 38 - + push(@para, $x); 39 - + } 40 - + 41 - + # if paragraph_indent is the same as line_indent, 42 - + # separate paragraphs with blank lines 43 - + 44 - + return join ($ip eq $xp ? "\n\n" : "\n", @para); 45 - } 46 - 47 - 1;
-187
externals/cowsay/cowsay
··· 1 - #%BANGPERL% 2 - 3 - ## 4 - ## Cowsay 3.03 5 - ## 6 - ## This file is part of cowsay. (c) 1999-2000 Tony Monroe. 7 - ## 8 - 9 - use Text::Tabs qw(expand); 10 - use Text::Wrap qw(wrap fill $columns); 11 - use File::Basename; 12 - use Getopt::Std; 13 - use Cwd; 14 - 15 - $version = "3.03"; 16 - $progname = basename($0); 17 - $eyes = "oo"; 18 - $tongue = " "; 19 - $cowpath = $ENV{'COWPATH'} || '%PREFIX%/share/cows'; 20 - @message = (); 21 - $thoughts = ""; 22 - 23 - ## Yeah, this is rude, I know. But hopefully it gets around a nasty 24 - ## little version dependency. 25 - 26 - $Text::Wrap::initial_tab = 8; 27 - $Text::Wrap::subsequent_tab = 8; 28 - $Text::Wrap::tabstop = 8; 29 - 30 - ## One of these days, we'll get it ported to Windows. Yeah, right. 31 - 32 - if (($^O eq "MSWin32") or ($^O eq "Windows_NT")) { ## Many perls, eek! 33 - $pathsep = ';'; 34 - } else { 35 - $pathsep = ':'; 36 - } 37 - 38 - %opts = ( 39 - 'e' => 'oo', 40 - 'f' => 'default.cow', 41 - 'n' => 0, 42 - 'T' => ' ', 43 - 'W' => 40, 44 - ); 45 - 46 - getopts('bde:f:ghlLnNpstT:wW:y', \%opts); 47 - 48 - &display_usage if $opts{'h'}; 49 - &list_cowfiles if $opts{'l'}; 50 - 51 - $borg = $opts{'b'}; 52 - $dead = $opts{'d'}; 53 - $greedy = $opts{'g'}; 54 - $paranoid = $opts{'p'}; 55 - $stoned = $opts{'s'}; 56 - $tired = $opts{'t'}; 57 - $wired = $opts{'w'}; 58 - $young = $opts{'y'}; 59 - $eyes = substr($opts{'e'}, 0, 2); 60 - $tongue = substr($opts{'T'}, 0, 2); 61 - $the_cow = ""; 62 - 63 - &slurp_input; 64 - $Text::Wrap::columns = $opts{'W'}; 65 - @message = ($opts{'n'} ? expand(@message) : 66 - split("\n", fill("", "", @message))); 67 - &construct_balloon; 68 - &construct_face; 69 - &get_cow; 70 - print @balloon_lines; 71 - print $the_cow; 72 - 73 - sub list_cowfiles { 74 - my $basedir; 75 - my @dirfiles; 76 - chop($basedir = cwd); 77 - for my $d (split(/$pathsep/, $cowpath)) { 78 - print "Cow files in $d:\n"; 79 - opendir(COWDIR, $d) || die "$0: Cannot open $d\n"; 80 - for my $file (readdir COWDIR) { 81 - if ($file =~ s/\.cow$//) { 82 - push(@dirfiles, $file); 83 - } 84 - } 85 - closedir(COWDIR); 86 - print wrap("", "", sort @dirfiles), "\n"; 87 - @dirfiles = (); 88 - chdir($basedir); 89 - } 90 - exit(0); 91 - } 92 - 93 - sub slurp_input { 94 - unless ($ARGV[0]) { 95 - chomp(@message = <STDIN>); 96 - } else { 97 - &display_usage if $opts{'n'}; 98 - @message = join(' ', @ARGV); 99 - } 100 - } 101 - 102 - sub maxlength { 103 - my ($l, $m); 104 - $m = -1; 105 - for my $i (@_) { 106 - $l = length $i; 107 - $m = $l if ($l > $m); 108 - } 109 - return $m; 110 - } 111 - 112 - sub construct_balloon { 113 - my $max = &maxlength(@message); 114 - my $max2 = $max + 2; ## border space fudge. 115 - my $format = "%s %-${max}s %s\n"; 116 - my @border; ## up-left, up-right, down-left, down-right, left, right 117 - if ($0 =~ /think/i) { 118 - $thoughts = 'o'; 119 - @border = qw[ ( ) ( ) ( ) ]; 120 - } elsif (@message < 2) { 121 - $thoughts = '\\'; 122 - @border = qw[ < > ]; 123 - } else { 124 - $thoughts = '\\'; 125 - if ($V and $V gt v5.6.0) { # Thanks, perldelta. 126 - @border = qw[ / \\ \\ / | | ]; 127 - } else { 128 - @border = qw[ / \ \ / | | ]; 129 - } 130 - } 131 - push(@balloon_lines, 132 - " " . ("_" x $max2) . " \n" , 133 - sprintf($format, $border[0], $message[0], $border[1]), 134 - (@message < 2 ? "" : 135 - map { sprintf($format, $border[4], $_, $border[5]) } 136 - @message[1 .. $#message - 1]), 137 - (@message < 2 ? "" : 138 - sprintf($format, $border[2], $message[$#message], $border[3])), 139 - " " . ("-" x $max2) . " \n" 140 - ); 141 - } 142 - 143 - sub construct_face { 144 - if ($borg) { $eyes = "=="; } 145 - if ($dead) { $eyes = "xx"; $tongue = "U "; } 146 - if ($greedy) { $eyes = "\$\$"; } 147 - if ($paranoid) { $eyes = "@@"; } 148 - if ($stoned) { $eyes = "**"; $tongue = "U "; } 149 - if ($tired) { $eyes = "--"; } 150 - if ($wired) { $eyes = "OO"; } 151 - if ($young) { $eyes = ".."; } 152 - } 153 - 154 - sub get_cow { 155 - ## 156 - ## Get a cow from the specified cowfile; otherwise use the default cow 157 - ## which was defined above in $the_cow. 158 - ## 159 - my $f = $opts{'f'}; 160 - my $full = ""; 161 - if ($opts{'f'} =~ m,/,) { 162 - $full = $opts{'f'}; 163 - } else { 164 - for my $d (split(/:/, $cowpath)) { 165 - if (-f "$d/$f") { 166 - $full = "$d/$f"; 167 - last; 168 - } elsif (-f "$d/$f.cow") { 169 - $full = "$d/$f.cow"; 170 - last; 171 - } 172 - } 173 - if ($full eq "") { 174 - die "$progname: Could not find $f cowfile!\n"; 175 - } 176 - } 177 - do $full; 178 - die "$progname: $@\n" if $@; 179 - } 180 - 181 - sub display_usage { 182 - die <<EOF; 183 - cow{say,think} version $version, (c) 1999 Tony Monroe 184 - Usage: $progname [-bdgpstwy] [-h] [-e eyes] [-f cowfile] 185 - [-l] [-n] [-T tongue] [-W wrapcolumn] [message] 186 - EOF 187 - }
-168
externals/cowsay/cowsay.1
··· 1 - .\" 2 - .\" cowsay.1 3 - .\" 4 - .\" $Id: cowsay.1,v 1.4 1999/11/04 19:50:40 tony Exp $ 5 - .\" 6 - .\" This file is part of cowsay. (c) 1999 Tony Monroe. 7 - .\" 8 - .ds Nm Cowsay 9 - .ds nm cowsay 10 - .ds Vn 3.02 11 - .TH \*(nm 1 "$Date: 1999/11/04 19:50:40 $" 12 - .SH NAME 13 - \*(nm/cowthink \- configurable speaking/thinking cow (and a bit more) 14 - .SH SYNOPSIS 15 - cowsay 16 - .RB [ \-e 17 - .IR eye_string ] 18 - .RB [ \-f 19 - .IR cowfile ] 20 - .RB [ \-h ] 21 - .RB [ \-l ] 22 - .RB [ \-n ] 23 - .RB [ \-T 24 - .IR tongue_string ] 25 - .RB [ \-W 26 - .IR column ] 27 - .RB [ \-bdgpstwy ] 28 - .SH DESCRIPTION 29 - .I Cowsay 30 - generates an ASCII picture of a cow saying something provided by the 31 - user. If run with no arguments, it accepts standard input, word-wraps 32 - the message given at about 40 columns, and prints the cow saying the 33 - given message on standard output. 34 - .PP 35 - To aid in the use of arbitrary messages with arbitrary whitespace, 36 - use the 37 - .B \-n 38 - option. If it is specified, the given message will not be 39 - word-wrapped. This is possibly useful if you want to make the cow 40 - think or speak in figlet(6). If 41 - .B \-n 42 - is specified, there must not be any command-line arguments left 43 - after all the switches have been processed. 44 - .PP 45 - The 46 - .B \-W 47 - specifies roughly (where the message should be wrapped. The default 48 - is equivalent to 49 - .B \-W 40 50 - i.e. wrap words at or before the 40th column. 51 - .PP 52 - If any command-line arguments are left over after all switches have 53 - been processed, they become the cow's message. The program will not 54 - accept standard input for a message in this case. 55 - .PP 56 - There are several provided modes which change the appearance of the 57 - cow depending on its particular emotional/physical state. The 58 - .B \-b 59 - option initiates Borg mode; 60 - .B \-d 61 - causes the cow to appear dead; 62 - .B \-g 63 - invokes greedy mode; 64 - .B \-p 65 - causes a state of paranoia to come over the cow; 66 - .B \-s 67 - makes the cow appear thoroughly stoned; 68 - .B \-t 69 - yields a tired cow; 70 - .B \-w 71 - is somewhat the opposite of 72 - .BR \-t , 73 - and initiates wired mode; 74 - .B \-y 75 - brings on the cow's youthful appearance. 76 - .PP 77 - The user may specify the 78 - .B \-e 79 - option to select the appearance of the cow's eyes, in which case 80 - the first two characters of the argument string 81 - .I eye_string 82 - will be used. The default eyes are 'oo'. The tongue is similarly 83 - configurable through 84 - .B \-T 85 - and 86 - .IR tongue_string ; 87 - it must be two characters and does not appear by default. However, 88 - it does appear in the 'dead' and 'stoned' modes. Any configuration 89 - done by 90 - .B \-e 91 - and 92 - .B \-T 93 - will be lost if one of the provided modes is used. 94 - .PP 95 - The 96 - .B \-f 97 - option specifies a particular cow picture file (``cowfile'') to 98 - use. If the cowfile spec contains '/' then it will be interpreted 99 - as a path relative to the current directory. Otherwise, cowsay 100 - will search the path specified in the 101 - .B COWPATH 102 - environment variable. 103 - To list all cowfiles on the current 104 - .BR COWPATH , 105 - invoke 106 - .B \*(nm 107 - with the 108 - .B \-l 109 - switch. 110 - .PP 111 - If the program is invoked as 112 - .B cowthink 113 - then the cow will think its message instead of saying it. 114 - .PP 115 - .SH COWFILE FORMAT 116 - A cowfile is made up of a simple block of 117 - .BR perl (1) 118 - code, which assigns a picture of a cow to the variable 119 - .BR $the_cow . 120 - Should you wish to customize the eyes or the tongue of the cow, 121 - then the variables 122 - .B $eyes 123 - and 124 - .B $tongue 125 - may be used. The trail leading up to the cow's message balloon is 126 - composed of the character(s) in the 127 - .B $thoughts 128 - variable. Any backslashes must be reduplicated to prevent 129 - interpolation. The name of a cowfile should end with 130 - .BR .cow , 131 - otherwise it is assumed not to be a cowfile. Also, at-signs (``@'') 132 - must be backslashed because that is what Perl 5 expects. 133 - .PP 134 - .SH COMPATIBILITY WITH OLDER VERSIONS 135 - .PP 136 - What older versions? :-) 137 - .PP 138 - Version 3.x is fully backward-compatible with 2.x versions. If 139 - you're still using a 1.x version, consider upgrading. And tell me 140 - where you got the older versions, since I didn't exactly put them 141 - up for world-wide access. 142 - .PP 143 - Oh, just so you know, this manual page documents version \*(Vn of 144 - cowsay. 145 - .SH ENVIRONMENT 146 - The COWPATH environment variable, if present, will be used to search 147 - for cowfiles. It contains a colon-separated list of directories, 148 - much like 149 - .B PATH or 150 - .BR MANPATH . 151 - It should always contain the 152 - .B /usr/local/share/cows 153 - directory, or at least a directory with a file called 154 - .B default.cow 155 - in it. 156 - .SH FILES 157 - .B %PREFIX%/share/cows 158 - holds a sample set of cowfiles. If your 159 - .B COWPATH 160 - is not explicitly set, it automatically contains this directory. 161 - .SH BUGS 162 - If there are any, please notify the author at the address below. 163 - .SH AUTHOR 164 - Tony Monroe (tony@nog.net), with suggestions from Shannon 165 - Appel (appel@CSUA.Berkeley.EDU) and contributions from Anthony Polito 166 - (aspolito@CSUA.Berkeley.EDU). 167 - .SH SEE ALSO 168 - perl(1), wall(1), nwrite(1), figlet(6)
-92
externals/cowsay/install.sh
··· 1 - #!/bin/sh 2 - 3 - ## 4 - ## install.sh 5 - ## 6 - ## Installation script for cowsay. 7 - ## 8 - ## $Id: install.sh,v 1.5 1999/11/01 20:19:21 tony Exp $ 9 - ## 10 - ## This file is part of cowsay. (c) 1999 Tony Monroe. 11 - ## 12 - 13 - rcs_id='$Id: install.sh,v 1.5 1999/11/01 20:19:21 tony Exp $' 14 - 15 - filelist='cows' 16 - 17 - cat <<DOG 18 - =================== 19 - cowsay Installation 20 - =================== 21 - 22 - Searching for useful perl executables... 23 - DOG 24 - 25 - backdoor=$1 26 - 27 - pathdirs=`echo $PATH | tr : " "` 28 - for p in $pathdirs; do 29 - set $p/perl $p/perl5* 30 - while [ ! -z "$1" ]; do 31 - if [ -x "$1" ]; then 32 - echo Found perl in $1 33 - perls="$perls $1" 34 - fi 35 - shift 36 - done 37 - done 38 - for perl in $perls; do 39 - if $perl -MText::Wrap -e0 >/dev/null 2>&1; then 40 - echo Found a good perl in $perl 41 - goodperls="$goodperls $perl" 42 - fi 43 - done 44 - echo The following perl executables will run cowsay: 45 - echo $goodperls 46 - echo I recommend the latest stable perl you can find. 47 - set $goodperls 48 - if [ -z "$1" ]; then 49 - echo Ack! You do not have Perl 5 installed correctly! 50 - echo Get thee to CPAN! 51 - exit 1 52 - fi 53 - usethisperl=$1 54 - echo I will be using $1 because I know it will work. 55 - 56 - echo Now I need an installation prefix. I will use /usr/local unless 57 - printf "you give me a better idea here: " 58 - if [ -n "$backdoor" ]; then 59 - prefix=$backdoor 60 - printf "%s (specified on command line)\n" $prefix 61 - else 62 - read prefix 63 - fi 64 - 65 - PREFIX=${prefix:-/usr/local} 66 - 67 - echo Okay, time to install this puppy. 68 - 69 - echo s,%BANGPERL%,!$usethisperl,\; > install.pl 70 - echo s,%PREFIX%,$PREFIX,\; >> install.pl 71 - set -x 72 - mkdir -p $PREFIX/bin || (mkdir $PREFIX; mkdir $PREFIX/bin) 73 - $usethisperl -p install.pl cowsay > $PREFIX/bin/cowsay 74 - chmod a+x $PREFIX/bin/cowsay 75 - ln -s cowsay $PREFIX/bin/cowthink 76 - mkdir -p $PREFIX/man/man1 || ($mkdir $PREFIX; mkdir $PREFIX/man; mkdir $PREFIX/man/man1) 77 - $usethisperl -p install.pl cowsay.1 > $PREFIX/man/man1/cowsay.1 78 - chmod a+r $PREFIX/man/man1/cowsay.1 79 - ln -s cowsay.1 $PREFIX/man/man1/cowthink.1 80 - mkdir -p $PREFIX/share/cows || (mkdir $PREFIX; mkdir $PREFIX/share; mkdir $PREFIX/share/cows) 81 - tar -cf - $filelist | (cd $PREFIX/share && tar -xvf -) 82 - set +x 83 - 84 - echo Okay, let us see if the install actually worked. 85 - 86 - if [ ! -f $PREFIX/share/cows/default.cow ]; then 87 - echo The default cow file did not make it across! 88 - echo Ooops, it failed...sorry! 89 - exit 1 90 - fi 91 - 92 - echo Installation complete! Enjoy the cows!
-14
externals/cowsay/pgp_public_key.txt
··· 1 - -----BEGIN PGP PUBLIC KEY BLOCK----- 2 - Version: 2.6.2 3 - 4 - mQCNAzNS+H4AAAEEAMilCcxLMIqMNXhZoeHjbeJGnHoKP0JpKDejz66qBlDwP+du 5 - FvVBHkyNIuU3orKe7l/aXIR8TcpjrxdcmrjjzwuB1aV48V4swT7v9UXvv9YP41Pd 6 - 1pXYXNelXHmE0eKSfcnkkFmYTJBXPaPNTJ3rpZpZOEW3SfgrrheqQm6w/6IJAAUR 7 - tBpUb255IE1vbnJvZSA8dG9ueUBub2cubmV0PrQdVG9ueSBNb25yb2UgPHRtb25y 8 - b2VAbm9nLm5ldD6JAJUDBRA2bDA5F6pCbrD/ogkBASOZA/9XtYSpcPjpi62MTEZl 9 - l+wV1svtlUlPvKkDE7FB9bwnMbF1FgGhTe/H4/8qDu20m5eGxMX58Ri7HPXWjjJ/ 10 - CrUWMzGVbg1JBkgh+d9QvEywmR0j4WezaifW1nCbxk0GrW1PjJyGb3kx7vrIF1Km 11 - xt6VwxTgfJzjIioBJFb4EiDyaLQnVG9ueSBNb25yb2UgPHRtb25yb2VAQ1NVQS5C 12 - ZXJrZWxleS5FRFU+ 13 - =WpM4 14 - -----END PGP PUBLIC KEY BLOCK-----