├── .act-github └── workflows │ └── use-github-actions.yml ├── .appveyor.yml ├── .github └── workflows │ ├── use-github-actions.yml │ └── windows-x64.yml ├── .gitignore ├── .gitmodules ├── .travis.yml ├── CI-testing ├── continuous-integration-testing.pl ├── gh-actions--windows-yml--from-p5-UV.yml └── translate-travis.yml-to-github-actions.py ├── CONTRIBUTING.asciidoc ├── CREDITS.asciidoc ├── LICENSE ├── README.asciidoc ├── fortune-mod ├── .clang-format ├── .tidyallrc ├── CMakeLists.txt ├── COPYING.txt ├── ChangeLog ├── INDEX ├── INSTALL.asciidoc ├── Notes ├── Offensive ├── README ├── TODO ├── cmake │ ├── PLACEHOLDER │ ├── rinutils_bootstrap.cmake │ └── shlomif_common_bootstrap.cmake ├── config.h.in ├── cookie-files ├── datfiles │ ├── CMakeLists.txt │ ├── art │ ├── ascii-art │ ├── computers │ ├── cookie │ ├── data │ │ ├── rules-of-acquisition-gen.pl │ │ ├── rules-of-acquisition-gen.sh │ │ └── rules-of-acquisition.csv │ ├── debian │ ├── definitions │ ├── disclaimer │ ├── drugs │ ├── education │ ├── ethnic │ ├── food │ ├── fortunes │ ├── goedel │ ├── humorists │ ├── kids │ ├── knghtbrd │ ├── law │ ├── linux │ ├── literature │ ├── love │ ├── magic │ ├── medicine │ ├── men-women │ ├── miscellaneous │ ├── news │ ├── off │ │ ├── CMakeLists.txt │ │ ├── rotated │ │ │ └── PLACEHOLDER │ │ └── unrotated │ │ │ ├── art │ │ │ ├── astrology │ │ │ ├── atheism │ │ │ ├── black-humor │ │ │ ├── cookie │ │ │ ├── debian │ │ │ ├── definitions │ │ │ ├── drugs │ │ │ ├── ethnic │ │ │ ├── fortunes │ │ │ ├── hphobia │ │ │ ├── knghtbrd │ │ │ ├── limerick │ │ │ ├── linux │ │ │ ├── misandry │ │ │ ├── miscellaneous │ │ │ ├── misogyny │ │ │ ├── politics │ │ │ ├── privates │ │ │ ├── racism │ │ │ ├── religion │ │ │ ├── riddles │ │ │ ├── sex │ │ │ ├── songs-poems │ │ │ ├── vulgarity │ │ │ └── zippy │ ├── paradoxum │ ├── people │ ├── perl │ ├── pets │ ├── platitudes │ ├── politics │ ├── pratchett │ ├── riddles │ ├── science │ ├── shlomif-fav │ ├── songs-poems │ ├── sports │ ├── startrek │ ├── tao │ ├── the-x-files-taglines │ ├── translate-me │ ├── wisdom │ ├── work │ └── zippy ├── fortune.desktop ├── fortune │ ├── fortune.c │ ├── gen-fortune-docbook-page.pl │ └── process-fortune-man-template.pl ├── run-tests.pl ├── tests │ ├── data │ │ └── valgrind.t │ ├── fortune-m-test.py │ ├── scripts │ │ ├── OLD-AND-UNUSED--check-fortune-file.sh │ │ └── split-valgrind.pl │ └── t │ │ ├── check-cookies.t │ │ ├── check-rinutils.t │ │ ├── lib │ │ └── FortTestInst.pm │ │ ├── test-fortune-h-flag.t │ │ ├── test-fortune-m--wetpaint.t │ │ ├── test-fortune-m.t │ │ ├── test-fortune-o-rot.t │ │ ├── test-fortune-percent.t │ │ ├── tidyall.t │ │ └── trailing-space-and-CRs.t ├── util │ ├── FortuneMod │ │ └── ManPage │ │ │ └── Generate │ │ │ └── App.pm │ ├── README.randstr │ ├── README.rot │ ├── find_duplicate_fortunes.py │ ├── fortmod_gen_manpage.pl │ ├── fortune-mod-common.h │ ├── fortune-util-set-outfn.h │ ├── fortune-util.h │ ├── getopt.c │ ├── getopt.h │ ├── randstr.c │ ├── randstr.docbook5.xml │ ├── rot.c │ ├── rot.pl │ ├── strfile.c │ ├── strfile.docbook5.xml │ ├── strfile.h │ └── unstr.c └── ver.txt └── scripts ├── Tatzer └── debian-packaging ├── build-fortune-mod-debian-package--using-docker.pl ├── build-rinutils-debian-package--using-docker.pl ├── docker-test.pl ├── pbuilderrc └── test-debian-package-using-docker.pl /.act-github/workflows/use-github-actions.yml: -------------------------------------------------------------------------------- 1 | # This file is GENERATED BY 2 | # CI-testing/translate-travis.yml-to-github-actions.py 3 | jobs: 4 | pcre2: 5 | runs-on: ubuntu-latest 6 | steps: 7 | - uses: actions/checkout@v2 8 | with: 9 | submodules: 'true' 10 | - run: sudo apt-get update -qq 11 | - run: sudo apt-get --no-install-recommends install -y eatmydata 12 | - run: sudo eatmydata apt-get --no-install-recommends install -y asciidoc 13 | cmake cpanminus dbtoepub docbook-xsl docbook-xsl-ns gcc libperl-dev 14 | librecode-dev make perl valgrind xsltproc xz-utils zip libpcre2-dev 15 | - run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)"; 16 | } ; local_lib_shim ; cpanm local::lib 17 | - run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)"; 18 | } ; local_lib_shim ; eval "$(perl -Mlocal::lib=$HOME/perl_modules)" 19 | - run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)"; 20 | } ; local_lib_shim ; cpanm App::Docmake Code::TidyAll::Plugin::ClangFormat 21 | Code::TidyAll::Plugin::Flake8 Code::TidyAll::Plugin::TestCount File::Find::Object 22 | List::Util Path::Tiny Perl::Critic Perl::Tidy Test::Code::TidyAll 23 | Test::Differences Test::RunValgrind Test::TrailingSpace Test::Trap 24 | - run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)"; 25 | } ; local_lib_shim ; true 26 | - run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)"; 27 | } ; local_lib_shim ; perl -ln -i -E 'print unless /^\[ClangFormat\]$/../^$/' 28 | fortune-mod/.tidyallrc 29 | - run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)"; 30 | } ; local_lib_shim ; export FORTUNE_TEST_TIDY=1 31 | - run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)"; 32 | } ; local_lib_shim ; perl CI-testing/continuous-integration-testing.pl 33 | --pcre 34 | - run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)"; 35 | } ; local_lib_shim ; rm -fr B 36 | test-fortune: 37 | runs-on: ubuntu-latest 38 | steps: 39 | - uses: actions/checkout@v2 40 | with: 41 | submodules: 'true' 42 | - run: sudo apt-get update -qq 43 | - run: sudo apt-get --no-install-recommends install -y eatmydata 44 | - run: sudo eatmydata apt-get --no-install-recommends install -y asciidoc 45 | cmake cpanminus dbtoepub docbook-xsl docbook-xsl-ns gcc libperl-dev 46 | librecode-dev make perl valgrind xsltproc xz-utils zip 47 | - run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)"; 48 | } ; local_lib_shim ; cpanm local::lib 49 | - run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)"; 50 | } ; local_lib_shim ; eval "$(perl -Mlocal::lib=$HOME/perl_modules)" 51 | - run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)"; 52 | } ; local_lib_shim ; cpanm App::Docmake Code::TidyAll::Plugin::ClangFormat 53 | Code::TidyAll::Plugin::Flake8 Code::TidyAll::Plugin::TestCount File::Find::Object 54 | List::Util Path::Tiny Perl::Critic Perl::Tidy Test::Code::TidyAll 55 | Test::Differences Test::RunValgrind Test::TrailingSpace Test::Trap 56 | - run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)"; 57 | } ; local_lib_shim ; true 58 | - run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)"; 59 | } ; local_lib_shim ; perl -ln -i -E 'print unless /^\[ClangFormat\]$/../^$/' 60 | fortune-mod/.tidyallrc 61 | - run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)"; 62 | } ; local_lib_shim ; export FORTUNE_TEST_TIDY=1 63 | - run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)"; 64 | } ; local_lib_shim ; perl CI-testing/continuous-integration-testing.pl 65 | - run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)"; 66 | } ; local_lib_shim ; rm -fr B 67 | name: use-github-actions 68 | 'on': 69 | - push 70 | -------------------------------------------------------------------------------- /.appveyor.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Shamelessly taken from https://github.com/plicease/Dist-Zilla-PluginBundle-Author-Plicease/blob/master/.appveyor.yml 3 | # Thanks! 4 | clone_folder: c:\projects\fortune-mod 5 | environment: 6 | global: 7 | MSYSTEM: MINGW64 8 | VERBOSE: "1" 9 | image: Visual Studio 2019 10 | install: 11 | # Trying to disable to check if it is already installed. 12 | # - choco install strawberryperl 13 | - cmd: "IF NOT EXIST C:\\strawberry ( 14 | echo \"strawberryperl is not installed. Please fix appveyor.yml\" 15 | exit 1 16 | )" 17 | - c:\msys64\usr\bin\bash -lc "pacman --noconfirm -Syuu" 18 | - SET PATH=C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;%PATH% 19 | - perl -v 20 | - IF NOT EXIST C:\Perl5 mkdir C:\Perl5 21 | - SET PATH=C:\msys64\mingw64\bin;C:\msys64\bin;C:\Perl5\bin;C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;%PATH% 22 | - SET PERL5LIB=%PERL5LIB%;C:/Perl5/lib/perl5 23 | - SET PERL_LOCAL_LIB_ROOT=C:/Perl5 24 | - SET PERL_MB_OPT=--install_base C:/Perl5 25 | - SET PERL_MM_OPT=INSTALL_BASE=C:/Perl5 26 | - cpanm --notest App::Docmake Code::TidyAll::Plugin::ClangFormat Code::TidyAll::Plugin::Flake8 Code::TidyAll::Plugin::TestCount File::Find::Object List::Util Path::Tiny Perl::Critic Perl::Tidy Test::Code::TidyAll Test::Differences Test::RunValgrind Test::TrailingSpace Test::Trap 27 | - if not exist C:\libtap mkdir C:\libtap 28 | - dir C:\ 29 | - dir C:\msys64 30 | - dir C:\msys64\mingw64 31 | - dir C:\msys64\mingw64\bin 32 | - copy C:\msys64\mingw64\bin\mingw32-make.exe C:\msys64\mingw64\bin\make.exe 33 | - perl -v 34 | - git clone https://github.com/shlomif/rinutils rinutils 35 | - mkdir rinutils\b 36 | - cd rinutils\b 37 | - set CMAKE_MAKE_PROGRAM=C:\strawberry\c\bin\gmake.exe 38 | - cmake -G "MinGW Makefiles" -DWITH_TEST_SUITE=OFF -DCMAKE_MAKE_PROGRAM=%CMAKE_MAKE_PROGRAM% -DCMAKE_INSTALL_PREFIX=C:\libtap .. 39 | - echo %PATH% 40 | - gmake 41 | - gmake install 42 | - SET MYOLDPATH_=%PATH% 43 | - mkdir ..\b32 44 | - cd ..\b32 45 | - cmake -G "MinGW Makefiles" -DWITH_TEST_SUITE=OFF -DCMAKE_MAKE_PROGRAM=%CMAKE_MAKE_PROGRAM% -DCMAKE_INSTALL_PREFIX=C:\libtap32 .. 46 | - echo %PATH% 47 | - gmake 48 | - gmake install 49 | - SET PATH=%MYOLDPATH_% 50 | - cd ..\..\ 51 | - C:\cygwin64\setup-x86_64.exe -qgnNdO -l C:\cygwin64\var\cache\setup -R c:\cygwin64 -s http://cygwin.mirror.constant.com -P docbook-xml -P docbook-xsl -P doxygen -P libxml2 -P libxslt 52 | build: off 53 | test_script: 54 | - set CMAKE_MAKE_PROGRAM=C:\strawberry\c\bin\gmake.exe 55 | # Removing for now because it is too much trouble on windows. 56 | # - set FCS_TEST_BUILD=1 57 | - set CPATH=c:\mingw64\include;c:\msys64\mingw64\include 58 | - set LIBRARY_PATH=c:\mingw64\lib;c:\msys64\mingw64\lib 59 | - set PATH=%PATH%;c:\mingw64\lib;c:\mingw64\bin;c:\msys64\mingw64\lib;c:\msys64\mingw64\bin 60 | # Python3 confuses the recode build so only add it here. 61 | - SET PATH=%PATH%;C:\Python35-x64 62 | - SET FORTUNE_TEST_DEBUG=1 63 | - SET DOCMAKE_PATH_PREFIX="C:\cygwin64\bin;" 64 | - SET SKIP_RINUTILS_INSTALL=1 65 | - perl CI-testing/continuous-integration-testing.pl --gen="MSYS Makefiles" 66 | shallow_clone: true 67 | -------------------------------------------------------------------------------- /.github/workflows/use-github-actions.yml: -------------------------------------------------------------------------------- 1 | # This file is GENERATED BY 2 | # CI-testing/translate-travis.yml-to-github-actions.py 3 | jobs: 4 | pcre2: 5 | runs-on: ubuntu-latest 6 | steps: 7 | - uses: actions/checkout@v2 8 | with: 9 | submodules: 'true' 10 | - run: sudo apt-get update -qq 11 | - run: sudo apt-get --no-install-recommends install -y eatmydata 12 | - run: sudo eatmydata apt-get --no-install-recommends install -y asciidoc 13 | cmake cpanminus dbtoepub docbook-xsl docbook-xsl-ns gcc libperl-dev 14 | librecode-dev make perl valgrind xsltproc xz-utils zip libpcre2-dev 15 | - run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)"; 16 | } ; local_lib_shim ; cpanm local::lib 17 | - run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)"; 18 | } ; local_lib_shim ; eval "$(perl -Mlocal::lib=$HOME/perl_modules)" 19 | - run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)"; 20 | } ; local_lib_shim ; cpanm App::Docmake Code::TidyAll::Plugin::ClangFormat 21 | Code::TidyAll::Plugin::Flake8 Code::TidyAll::Plugin::TestCount File::Find::Object 22 | List::Util Path::Tiny Perl::Critic Perl::Tidy Test::Code::TidyAll 23 | Test::Differences Test::RunValgrind Test::TrailingSpace Test::Trap 24 | - run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)"; 25 | } ; local_lib_shim ; true 26 | - run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)"; 27 | } ; local_lib_shim ; perl -ln -i -E 'print unless /^\[ClangFormat\]$/../^$/' 28 | fortune-mod/.tidyallrc 29 | - run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)"; 30 | } ; local_lib_shim ; export FORTUNE_TEST_TIDY=1 31 | - run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)"; 32 | } ; local_lib_shim ; perl CI-testing/continuous-integration-testing.pl 33 | --pcre 34 | - run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)"; 35 | } ; local_lib_shim ; rm -fr B 36 | test-fortune: 37 | runs-on: ubuntu-latest 38 | steps: 39 | - uses: actions/checkout@v2 40 | with: 41 | submodules: 'true' 42 | - run: sudo apt-get update -qq 43 | - run: sudo apt-get --no-install-recommends install -y eatmydata 44 | - run: sudo eatmydata apt-get --no-install-recommends install -y asciidoc 45 | cmake cpanminus dbtoepub docbook-xsl docbook-xsl-ns gcc libperl-dev 46 | librecode-dev make perl valgrind xsltproc xz-utils zip 47 | - run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)"; 48 | } ; local_lib_shim ; cpanm local::lib 49 | - run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)"; 50 | } ; local_lib_shim ; eval "$(perl -Mlocal::lib=$HOME/perl_modules)" 51 | - run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)"; 52 | } ; local_lib_shim ; cpanm App::Docmake Code::TidyAll::Plugin::ClangFormat 53 | Code::TidyAll::Plugin::Flake8 Code::TidyAll::Plugin::TestCount File::Find::Object 54 | List::Util Path::Tiny Perl::Critic Perl::Tidy Test::Code::TidyAll 55 | Test::Differences Test::RunValgrind Test::TrailingSpace Test::Trap 56 | - run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)"; 57 | } ; local_lib_shim ; true 58 | - run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)"; 59 | } ; local_lib_shim ; perl -ln -i -E 'print unless /^\[ClangFormat\]$/../^$/' 60 | fortune-mod/.tidyallrc 61 | - run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)"; 62 | } ; local_lib_shim ; export FORTUNE_TEST_TIDY=1 63 | - run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)"; 64 | } ; local_lib_shim ; perl CI-testing/continuous-integration-testing.pl 65 | - run: local_lib_shim() { eval "$(perl -Mlocal::lib=$HOME/perl_modules)"; 66 | } ; local_lib_shim ; rm -fr B 67 | name: use-github-actions 68 | 'on': 69 | - push 70 | -------------------------------------------------------------------------------- /.github/workflows/windows-x64.yml: -------------------------------------------------------------------------------- 1 | # This file is GENERATED BY 2 | # CI-testing/translate-travis.yml-to-github-actions.py 3 | jobs: 4 | perl: 5 | runs-on: windows-latest 6 | steps: 7 | - name: Setup perl 8 | uses: shogo82148/actions-setup-perl@v1 9 | with: 10 | distribution: strawberry 11 | perl-version: ${{ matrix.perl-version }} 12 | - name: Set git to use LF 13 | run: 'git config --global core.autocrlf false 14 | 15 | git config --global core.eol lf 16 | 17 | ' 18 | - uses: actions/checkout@v2 19 | with: 20 | submodules: 'true' 21 | - name: perl -V 22 | run: perl -V 23 | - uses: cygwin/cygwin-install-action@master 24 | with: 25 | packages: docbook-xml docbook-xsl doxygen libxml2 libxslt 26 | - name: install cpanm and mult modules 27 | uses: perl-actions/install-with-cpanm@v1 28 | with: 29 | install: 'App::Docmake 30 | 31 | Code::TidyAll::Plugin::ClangFormat 32 | 33 | Code::TidyAll::Plugin::Flake8 34 | 35 | Code::TidyAll::Plugin::TestCount 36 | 37 | File::Find::Object 38 | 39 | List::Util 40 | 41 | Path::Tiny 42 | 43 | Perl::Critic 44 | 45 | Perl::Tidy 46 | 47 | Test::Code::TidyAll 48 | 49 | Test::Differences 50 | 51 | Test::RunValgrind 52 | 53 | Test::TrailingSpace 54 | 55 | Test::Trap' 56 | - name: Set up MinGW 57 | uses: e-t-l/setup-mingw@patch-1 58 | with: 59 | platform: x64 60 | - name: install and test_script code 61 | run: '@echo on 62 | 63 | SET MSYSTEM=MINGW64 64 | 65 | SET VERBOSE=1 66 | 67 | c:\msys64\usr\bin\bash -lc "pacman --noconfirm -Sy mingw-w64-x86_64-libsystre" 68 | || ( echo Failed & exit /B 1 ) 69 | 70 | IF NOT EXIST C:\strawberry ( echo "strawberryperl is not installed. 71 | Please fix appveyor.yml" exit 1 ) || ( echo Failed & exit /B 1 ) 72 | 73 | c:\msys64\usr\bin\bash -lc "pacman --noconfirm -Syuu" || ( echo Failed 74 | & exit /B 1 ) 75 | 76 | SET PATH=C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;%PATH% 77 | 78 | perl -v || ( echo Failed & exit /B 1 ) 79 | 80 | IF NOT EXIST C:\Perl5 mkdir C:\Perl5 || ( echo Failed & exit /B 1 81 | ) 82 | 83 | SET PATH=C:\msys64\mingw64\bin;C:\msys64\bin;C:\Perl5\bin;C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;%PATH% 84 | 85 | SET PERL5LIB=%PERL5LIB%;C:/Perl5/lib/perl5 86 | 87 | SET PERL_LOCAL_LIB_ROOT=C:/Perl5 88 | 89 | SET PERL_MB_OPT=--install_base C:/Perl5 90 | 91 | SET PERL_MM_OPT=INSTALL_BASE=C:/Perl5 92 | 93 | call C:\strawberry\perl\bin\cpanm --notest App::Docmake Code::TidyAll::Plugin::ClangFormat 94 | Code::TidyAll::Plugin::Flake8 Code::TidyAll::Plugin::TestCount File::Find::Object 95 | List::Util Path::Tiny Perl::Critic Perl::Tidy Test::Code::TidyAll 96 | Test::Differences Test::RunValgrind Test::TrailingSpace Test::Trap 97 | || ( echo Failed & exit /B 1 ) 98 | 99 | if not exist C:\libtap mkdir C:\libtap || ( echo Failed & exit /B 100 | 1 ) 101 | 102 | dir C:\ || ( echo Failed & exit /B 1 ) 103 | 104 | dir C:\msys64 || ( echo Failed & exit /B 1 ) 105 | 106 | dir C:\msys64\mingw64 || ( echo Failed & exit /B 1 ) 107 | 108 | dir C:\msys64\mingw64\bin || ( echo Failed & exit /B 1 ) 109 | 110 | perl -v || ( echo Failed & exit /B 1 ) 111 | 112 | git clone https://github.com/shlomif/rinutils rinutils || ( echo Failed 113 | & exit /B 1 ) 114 | 115 | mkdir rinutils\b || ( echo Failed & exit /B 1 ) 116 | 117 | cd rinutils\b || ( echo Failed & exit /B 1 ) 118 | 119 | set CMAKE_MAKE_PROGRAM=C:\strawberry\c\bin\gmake.exe 120 | 121 | cmake -G "MinGW Makefiles" -DWITH_TEST_SUITE=OFF -DCMAKE_MAKE_PROGRAM=%CMAKE_MAKE_PROGRAM% 122 | -DCMAKE_INSTALL_PREFIX=C:\libtap .. || ( echo Failed & exit /B 1 ) 123 | 124 | echo %PATH% || ( echo Failed & exit /B 1 ) 125 | 126 | gmake || ( echo Failed & exit /B 1 ) 127 | 128 | gmake install || ( echo Failed & exit /B 1 ) 129 | 130 | SET MYOLDPATH_=%PATH% 131 | 132 | mkdir ..\b32 || ( echo Failed & exit /B 1 ) 133 | 134 | cd ..\b32 || ( echo Failed & exit /B 1 ) 135 | 136 | cmake -G "MinGW Makefiles" -DWITH_TEST_SUITE=OFF -DCMAKE_MAKE_PROGRAM=%CMAKE_MAKE_PROGRAM% 137 | -DCMAKE_INSTALL_PREFIX=C:\libtap32 .. || ( echo Failed & exit /B 1 138 | ) 139 | 140 | echo %PATH% || ( echo Failed & exit /B 1 ) 141 | 142 | gmake || ( echo Failed & exit /B 1 ) 143 | 144 | gmake install || ( echo Failed & exit /B 1 ) 145 | 146 | SET PATH=%MYOLDPATH_% 147 | 148 | cd ..\..\ || ( echo Failed & exit /B 1 ) 149 | 150 | set CMAKE_MAKE_PROGRAM=C:\strawberry\c\bin\gmake.exe 151 | 152 | set CPATH=c:\mingw64\include;c:\msys64\mingw64\include 153 | 154 | set LIBRARY_PATH=c:\mingw64\lib;c:\msys64\mingw64\lib 155 | 156 | set PATH=%PATH%;c:\mingw64\lib;c:\mingw64\bin;c:\msys64\mingw64\lib;c:\msys64\mingw64\bin 157 | 158 | SET PATH=%PATH%;C:\Python35-x64 159 | 160 | SET FORTUNE_TEST_DEBUG=1 161 | 162 | SET DOCMAKE_PATH_PREFIX="C:\cygwin\bin;" 163 | 164 | SET SKIP_RINUTILS_INSTALL=1 165 | 166 | perl CI-testing/continuous-integration-testing.pl --gen="MinGW Makefiles" 167 | || ( echo Failed & exit /B 1 ) 168 | 169 | ' 170 | shell: cmd 171 | strategy: 172 | fail-fast: true 173 | matrix: 174 | perl-version: 175 | - '5.30' 176 | name: windows-x64 177 | 'on': 178 | - push 179 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /fortune-mod/cmake/Shlomif_Common.cmake 2 | /fortune-mod/datfiles/rules-of-acquisition 3 | /fortune-mod/fortune/fortune.6 4 | /fortune-mod/fortune/fortune_with_offensive.docbook5.xml 5 | /fortune-mod/fortune/fortune_with_offensive.template.man 6 | /fortune-mod/fortune/fortune_without_offensive.docbook5.xml 7 | /fortune-mod/fortune/fortune_without_offensive.template.man 8 | /fortune-mod/rinutils/ 9 | /fortune-mod/tests/t/valgrind0*.t 10 | /fortune-mod/util/randstr.man 11 | /fortune-mod/util/strfile.man 12 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "fortune-mod/rinutils"] 2 | path = fortune-mod/rinutils 3 | url = https://github.com/shlomif/rinutils 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | addons: 2 | apt: 3 | packages: 4 | - asciidoc 5 | - cmake 6 | - cpanminus 7 | - dbtoepub 8 | - docbook-xsl 9 | - docbook-xsl-ns 10 | - gcc 11 | - libperl-dev 12 | - librecode-dev 13 | - make 14 | - perl 15 | - valgrind 16 | - xsltproc 17 | - xz-utils 18 | - zip 19 | before_install: 20 | - cpanm local::lib 21 | - eval "$(perl -Mlocal::lib=$HOME/perl_modules)" 22 | - cpanm App::Docmake Code::TidyAll::Plugin::ClangFormat Code::TidyAll::Plugin::Flake8 Code::TidyAll::Plugin::TestCount File::Find::Object List::Util Path::Tiny Perl::Critic Perl::Tidy Test::Code::TidyAll Test::Differences Test::RunValgrind Test::TrailingSpace Test::Trap 23 | cache: 24 | directories: 25 | - $HOME/perl_modules 26 | - $HOME/tidyall_d 27 | dist: focal 28 | install: 29 | # Required to avoid default travis "cpanm ." booboo. 30 | - "true" 31 | language: perl 32 | os: linux 33 | perl: 34 | - "5.30" 35 | script: 36 | - "perl -ln -i -E 'print unless /^\\[ClangFormat\\]$/../^$/' fortune-mod/.tidyallrc" 37 | - "export FORTUNE_TEST_TIDY=1" 38 | - "perl CI-testing/continuous-integration-testing.pl" 39 | - "rm -fr B" 40 | -------------------------------------------------------------------------------- /CI-testing/continuous-integration-testing.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use 5.014; 4 | use strict; 5 | use warnings; 6 | use autodie; 7 | 8 | use Path::Tiny qw/ path cwd /; 9 | use Getopt::Long qw/ GetOptions /; 10 | 11 | sub do_system 12 | { 13 | my ($args) = @_; 14 | 15 | my $cmd = $args->{cmd}; 16 | print "Running [@$cmd]\n"; 17 | if ( system(@$cmd) ) 18 | { 19 | die "Running [@$cmd] failed!"; 20 | } 21 | } 22 | my $cwd = cwd(); 23 | 24 | my $IS_WIN = ( $^O eq "MSWin32" ); 25 | my $MAKE = $IS_WIN ? 'gmake' : 'make'; 26 | 27 | my $SEP = $IS_WIN ? "\\" : '/'; 28 | my $SUDO = $IS_WIN ? '' : 'sudo'; 29 | 30 | my $cmake_gen; 31 | my $pcre; 32 | GetOptions( 'gen=s' => \$cmake_gen, 'pcre' => \$pcre, ) 33 | or die 'Wrong options'; 34 | 35 | local $ENV{RUN_TESTS_VERBOSE} = 1; 36 | if ( defined $cmake_gen ) 37 | { 38 | $ENV{CMAKE_GEN} = $cmake_gen; 39 | } 40 | 41 | sub _transform 42 | { 43 | return shift(@_) =~ s%\\%\\\\%gr; 44 | } 45 | mkdir('B'); 46 | chdir('B'); 47 | 48 | my $cmake_common_args = 49 | "" . ( defined($cmake_gen) ? qq# -G "$cmake_gen" # : "" ) . ( 50 | defined( $ENV{CMAKE_MAKE_PROGRAM} ) 51 | ? " -DCMAKE_MAKE_PROGRAM=$ENV{CMAKE_MAKE_PROGRAM} " 52 | : "" 53 | 54 | ) 55 | . ( $pcre ? " -D USE_PCRE=TRUE " : "" ) 56 | . ( $IS_WIN ? " -DCMAKE_BUILD_TYPE=Debug " : "" ); 57 | 58 | if ( !$ENV{SKIP_RINUTILS_INSTALL} ) 59 | { 60 | do_system( 61 | { 62 | cmd => [ qw#git clone https://github.com/shlomif/rinutils#, ] 63 | } 64 | ); 65 | do_system( 66 | { 67 | cmd => [ 68 | qq#cd rinutils && mkdir B && cd B && cmake # 69 | . $cmake_common_args 70 | . " -DWITH_TEST_SUITE=OFF " 71 | . ( $IS_WIN ? " -DCMAKE_INSTALL_PREFIX=C:/foo " : '' ) 72 | . qq# .. && $SUDO $MAKE install# 73 | ] 74 | } 75 | ); 76 | } 77 | do_system( { cmd => [ "cmake", "--version" ] } ); 78 | my $CMAKE_PREFIX_PATH; 79 | 80 | if ($IS_WIN) 81 | { 82 | $CMAKE_PREFIX_PATH = join ";", ( map { ; $IS_WIN ? "c:$_" : $_ } ("/foo") ); 83 | 84 | ( $ENV{CMAKE_PREFIX_PATH} //= '' ) .= ";$CMAKE_PREFIX_PATH;"; 85 | 86 | # ( $ENV{PKG_CONFIG_PATH} //= '' ) .= ";C:\\foo\\lib\\pkgconfig;"; 87 | ( $ENV{PKG_CONFIG_PATH} //= '' ) .= 88 | ";/foo/lib/pkgconfig/;/c/foo/lib/pkgconfig/"; 89 | $ENV{RINUTILS_INCLUDE_DIR} = "C:/foo/include"; 90 | 91 | # for warning flags. 92 | $ENV{FCS_GCC} = 1; 93 | } 94 | chdir($cwd); 95 | $cwd->child('B')->remove_tree( { safe => 0, } ); 96 | 97 | my $WIN32_TARGET_ARCH = "-DTARGET_ARCH=x86_64-w64-mingw32"; # -G Ninja .. 98 | my $WIN32__DOUBLE_AMPERSAND__PROPER_HANDLING__NEEDED_PREFIX = "cd . &&"; 99 | print "PATH = <<$ENV{PATH}>>\n"; 100 | do_system( 101 | { 102 | cmd => [ 103 | "$WIN32__DOUBLE_AMPERSAND__PROPER_HANDLING__NEEDED_PREFIX mkdir B && cd B && cmake" 104 | . ( 105 | defined($CMAKE_PREFIX_PATH) 106 | ? ( " -DCMAKE_PREFIX_PATH=" . _transform($CMAKE_PREFIX_PATH) ) 107 | : '' 108 | ) 109 | . " " 110 | . ( 111 | $IS_WIN 112 | ? ( $cmake_common_args 113 | . " $WIN32_TARGET_ARCH -DCMAKE_INSTALL_PREFIX=c:/foo " 114 | . "-DUSE_WIN32_REGEX_LIBS=TRUE " 115 | . "../fortune-mod && $MAKE && $MAKE install && $MAKE check" 116 | ) 117 | : ( $cmake_common_args 118 | . " ../fortune-mod && $MAKE && $MAKE check" ) 119 | ) 120 | ] 121 | } 122 | ); 123 | if ($IS_WIN) 124 | { 125 | my $gdb_cmds_fn = "cmds.gdb"; 126 | path($gdb_cmds_fn)->spew_utf8("r\nbt\nq\n"); 127 | my $gdb_prefix = "gdb --command=$gdb_cmds_fn"; 128 | $gdb_prefix = ''; 129 | do_system( 130 | { 131 | cmd => [ 132 | "$WIN32__DOUBLE_AMPERSAND__PROPER_HANDLING__NEEDED_PREFIX $gdb_prefix c:/foo/games/fortune.exe" 133 | ] 134 | } 135 | ); 136 | } 137 | -------------------------------------------------------------------------------- /CI-testing/gh-actions--windows-yml--from-p5-UV.yml: -------------------------------------------------------------------------------- 1 | name: windows 2 | 'on': 3 | push: 4 | branches: 5 | - '*' 6 | tags-ignore: 7 | - '*' 8 | pull_request: 9 | jobs: 10 | perl: 11 | runs-on: windows-latest 12 | strategy: 13 | fail-fast: true 14 | matrix: 15 | perl-version: 16 | - '5.30' 17 | # - '5.28' 18 | # - '5.26' 19 | # - '5.24' 20 | # - '5.22' 21 | # - '5.20' 22 | # - '5.18' 23 | # - '5.16' 24 | # - '5.14' 25 | steps: 26 | - name: Setup perl 27 | uses: shogo82148/actions-setup-perl@v1 28 | with: 29 | perl-version: ${{ matrix.perl-version }} 30 | distribution: strawberry 31 | - name: Set git to use LF 32 | run: | 33 | git config --global core.autocrlf false 34 | git config --global core.eol lf 35 | - uses: actions/checkout@v2 36 | with: 37 | submodules: "true" 38 | - name: perl -V 39 | run: perl -V 40 | - name: Install Alien::libuv 41 | run: | 42 | cpanm ExtUtils::Manifest App::cpanminus 43 | cpanm --notest Alien::Base::Wrapper 44 | cpanm --notest --installdeps Alien::libuv 45 | cpanm --notest Alien::libuv 46 | - name: Install Module::Build::Using::PkgConfig 47 | run: cpanm --notest Module::Build::Using::PkgConfig 48 | - name: Install Dependencies 49 | run: cpanm --notest --installdeps -v . 50 | - name: Run Tests 51 | run: cpanm --testonly -v . 52 | -------------------------------------------------------------------------------- /CONTRIBUTING.asciidoc: -------------------------------------------------------------------------------- 1 | How to contribute to fortune-mod 2 | ========================================== 3 | Shlomi Fish 4 | :Date: 2021-04-01 5 | :Revision: $Id$ 6 | 7 | All quality contributions are welcome, including small typo fixes. 8 | Note that we will review changesets, and may require amendments if we 9 | detect any problems. 10 | 11 | A list of current open tasks can be found in the 12 | https://github.com/shlomif/fortune-mod/blob/master/README.asciidoc[README] 13 | 14 | Pull requests through GitHub are accepted. You can also send “diff -u” 15 | patches to https://www.shlomifish.org/me/contact-me/[Shlomi Fish]. 16 | 17 | If possible, please create a dedicated branch for any changes. This 18 | isn't a deal breaker though, as it is an easy fix with git. Moreover, every 19 | atomic change should preferably be in its own git commit. 20 | 21 | Moreover, note that new fortunes should preferably include source URLs or references for citation. This is given https://www.explainxkcd.com/wiki/index.php/285:_Wikipedian_Protester[Wikepedia’s citation policy] and https://en.wikiquote.org/w/index.php?title=Bill_Gates&oldid=3534967#Misattributed[Bill Gates’ complaint about misattributed]. 22 | 23 | Happy hacking! 24 | -------------------------------------------------------------------------------- /CREDITS.asciidoc: -------------------------------------------------------------------------------- 1 | fortune-mod's Credits, Authors, and Contributors 2 | ========================================== 3 | Shlomi Fish 4 | :Date: 2020-02-27 5 | :Revision: $Id$ 6 | 7 | * https://www.shlomifish.org/[Shlomi Fish]: maintaining fortune-mod 8 | from version 2.0.0 onwards. 9 | 10 | * Amy A. Lewis - contributing to the original fortune-mod. 11 | 12 | * Dennis L. Clark - contributing to the original fortune-mod. 13 | 14 | * https://en.wikipedia.org/wiki/Ken_Arnold[Ken Arnold] - writing 15 | the original "fortune" program for BSD which fortune-mod 16 | was derived from. 17 | 18 | * https://rrt.sc3d.org/[Reuben Thomas] - adopting 19 | https://github.com/rrthomas/recode[Recode] which made converting 20 | fortune-mod to avoid using it unnecessary. 21 | 22 | * irc://irc.freenode.net/#cmake[#cmake] and especially ngalditz - 23 | providing help diagnosing a run time failure on MS Windows and 24 | recommending https://github.com/lucasg/Dependencies/ . 25 | 26 | * https://github.com/lucasg[lucasg] for writing 27 | https://github.com/lucasg/Dependencies/ . 28 | 29 | * http://www.catb.org/esr/[Eric S. Raymond] for writing 30 | http://www.catb.org/~esr/doclifter/[doclifter] which made the 31 | task of converting the man pages from nroff to DocBook 5/XML 32 | easier in version 3. 33 | 34 | * https://travis-ci.org/[Travis-CI] for providing a CI service. 35 | 36 | * https://www.appveyor.com/[AppVeyor] for providing CI/CD for running 37 | the tests on Windows. 38 | 39 | * https://dave.org.uk/[Dave Cross] for introducing CI to Shlomi Fish 40 | in https://perlhacks.com/2012/03/you-must-hate-version-control-systems/[one of his blog posts] 41 | 42 | * https://metacpan.org/author/BINGOS[Chris Williams] - helping to 43 | fix the AppVeyor-CI build. 44 | 45 | * https://packages.debian.org/en/sid/fortune-mod[Debian packagers]: 46 | providing patches and fixes. 47 | 48 | * https://src.fedoraproject.org/rpms/fortune-mod[Fedora packagers]: 49 | providing patches and fixes. 50 | 51 | * Pull Requests sent: 52 | ** https://github.com/shlomif/fortune-mod/pull/39 53 | ** https://github.com/shlomif/fortune-mod/pull/38 54 | ** https://github.com/shlomif/fortune-mod/pull/36 55 | ** https://github.com/shlomif/fortune-mod/pull/32 56 | ** https://github.com/shlomif/fortune-mod/pull/31 57 | ** https://github.com/shlomif/fortune-mod/pull/30 58 | ** And others 59 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1986, 1993 3 | * The Regents of the University of California. All rights reserved. 4 | * 5 | * This code is derived from software contributed to Berkeley by 6 | * Ken Arnold. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 3. All advertising materials mentioning features or use of this software 17 | * must display the following acknowledgement: 18 | * This product includes software developed by the University of 19 | * California, Berkeley and its contributors. 20 | * 4. Neither the name of the University nor the names of its contributors 21 | * may be used to endorse or promote products derived from this software 22 | * without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 25 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 | * SUCH DAMAGE. 35 | */ 36 | 37 | /* Modified September, 1995, Amy A. Lewis 38 | * 1: removed all file-locking dreck. Unnecessary 39 | * 2: Fixed bug that made fortune -f report a different list than 40 | * fortune with any other parameters, or none, and which forced 41 | * the program to read only one file (named 'fortunes') 42 | * 3: removed the unnecessary print_file_list() 43 | * 4: Added "OFFDIR" to pathnames.h as the directory in which offensive 44 | * fortunes are kept. This considerably simplifies our life by 45 | * permitting us to dispense with a lot of silly tests for the string 46 | * "-o" at the end of a filename. 47 | * 5: I think the problems with trying to find filenames were fixed by 48 | * the change in the way that offensive files are defined. Two birds, 49 | * one stone! 50 | * 6: Calculated probabilities for all files, so that -f will print them. 51 | */ 52 | 53 | /* Changes Copyright (c) 1997 Dennis L. Clark. All rights reserved. 54 | * 55 | * The changes in this file may be freely redistributed, modified or 56 | * included in other software, as long as both the above copyright 57 | * notice and these conditions appear intact. 58 | */ 59 | 60 | /* Modified May 1997, Dennis L. Clark (dbugger@progsoc.uts.edu.au) 61 | * + Various portability fixes 62 | * + Percent selection of files with -a now works on datafiles which 63 | * appear in both unoffensive and offensive directories (see man page 64 | * for details) 65 | * + The -s and -l options are now more consistent in their 66 | * interpretation of fortune length 67 | * + The -s and -l options can now be combined wit the -m option 68 | */ 69 | 70 | /* Modified Jul 1999, Pablo Saratxaga 71 | * - added use of the LANG variables; now if called without argument 72 | * it will choose (if they exist) fortunes in the users' language. 73 | * (that is, under a directory $LANG/ under the main fortunes directory 74 | * 75 | * Added to debian by Alastair McKinstry, , 2002-07-31 76 | */ 77 | -------------------------------------------------------------------------------- /README.asciidoc: -------------------------------------------------------------------------------- 1 | == fortune-mod Maintenance Version and Ongoing Development 2 | 3 | [link=https://travis-ci.com/shlomif/fortune-mod] 4 | image::https://travis-ci.com/shlomif/fortune-mod.svg?branch=master[Travis-CI Build Status] 5 | 6 | [link=https://ci.appveyor.com/project/shlomif/fortune-mod/branch/master] 7 | image::https://ci.appveyor.com/api/projects/status/0pbvqd1xa7777aoo/branch/master?svg=true[AppVeyor Build status] 8 | 9 | This GitHub repository maintains the sources for fortune-mod, a version 10 | of https://en.wikipedia.org/wiki/Fortune_%28Unix%29[the UNIX “fortune” 11 | command]. `fortune` is a command-line utility which displays a random 12 | quotation from a collection of quotes. This collection is read from the 13 | local https://en.wikipedia.org/wiki/File_system[file system] and does 14 | not require network access. A large collection of quotes is provided in 15 | the download and installed by default, but more quote collections can be 16 | added by the user. 17 | 18 | The canonical repository for the time being is: 19 | https://github.com/shlomif/fortune-mod . In the future, we may create a 20 | GitHub organization for it, and move the sources there. 21 | 22 | For more information about it, you can contact 23 | https://www.shlomifish.org/[Shlomi Fish] . 24 | 25 | === Installation 26 | 27 | On Fedora and other rpm-based distributions: 28 | 29 | .... 30 | sudo dnf install fortune-mod 31 | .... 32 | 33 | ( RHEL and CentOS users may opt to try https://github.com/shlomif/fortune-mod/issues/47#issuecomment-917565752[the EPEL packages]. ) 34 | 35 | On Arch Linux and derivatives: 36 | 37 | .... 38 | sudo pacman -S fortune-mod 39 | .... 40 | 41 | On Alpine Linux: 42 | 43 | .... 44 | curl -sL https://alpine.swee.codes/install.sh | doas sh # assumes you have doas and curl packages installed, and you aren't root 45 | doas apk add fortune-mod 46 | .... 47 | 48 | On Debian, and derivatives (e.g: Ubuntu, Linux Mint): 49 | 50 | 51 | .... 52 | curl -sL https://swee.codes/repo.sh | sudo bash 53 | sudo apt install fortune-mod-shlomif 54 | .... 55 | 56 | This setups https://swee.codes/linuxrepos[this apt repository] to make sure you have the latest version. 57 | 58 | If you are content with using a very old version, you can use: 59 | 60 | .... 61 | sudo apt install fortune-mod 62 | .... 63 | 64 | ==== Building from Sources 65 | 66 | See https://github.com/shlomif/fortune-mod/blob/master/fortune-mod/INSTALL.asciidoc[the INSTALL.asciidoc file]. You might also wish to consult the GitHub Actions-based Continuous Integration procedures 67 | 68 | === Release Tarballs 69 | 70 | Release tarballs can be found at 71 | https://www.shlomifish.org/open-source/projects/fortune-mod/arcs/[this 72 | directory] for now. 73 | 74 | Based on https://github.com/shlomif/fortune-mod/issues/10[this reported 75 | bug]: 76 | 77 | One can find the official release tarballs of fortune-mod as prepared by 78 | CPack there. They have a proper containing directory. One can also 79 | download these tarballs from the 80 | https://github.com/shlomif/fortune-mod/releases[GitHub releases page]. 81 | However, please do not use the auto-generated “Source code (zip)” and “Source 82 | code (tar.gz)” downloads, which are both incomplete, and have extra 83 | directories inside. 84 | 85 | === Sample usage 86 | 87 | .... 88 | $ fortune 89 | Enthusiasm is one of the most important 90 | ingredients a volunteer project runs on. 91 | -- Andreas Schuldei 92 | $ 93 | .... 94 | 95 | === History 96 | 97 | I believe fortune-mod was originally forked from the NetBSD version of fortune, 98 | and ported to run on Linux systems. For some time, it was maintained at the 99 | currently offline redellipse-dot-net inside a 100 | http://en.wikipedia.org/wiki/GNU_arch[GNU Arch] (= an old version control 101 | system) repository, and version 1.99.1 was released as a tarball. 102 | 103 | This maintenance version was initiated by Shlomi Fish, who decided to 104 | maintain it, given he is a fan of the fortune command. It started by 105 | importing the unpacked source of the fortune-mod-1.99.1.tar tarball from 106 | the Mageia Linux .src.rpm into an empty git repository, and proceeding 107 | from there. 108 | 109 | === Why does running "fortune" fails? 110 | 111 | There are several possible causes for that. 112 | 113 | One of them is the fact that the “fortune” executable was placed in 114 | an unusual path, for example +/usr/games/fortune+ rather than +/usr/bin/fortune+. 115 | If so, it sometimes need to be invoked using the full path. 116 | 117 | === What is the difference between fortune-mod and the "normal" fortune? 118 | 119 | fortune-mod (= "fortune modified") was the name of a fork of the 120 | original NetBSD fortune, which was done in order to port the code to 121 | Linux and apply some other changes. If you are using a Linux 122 | distribution, chances are that the `fortune` executable's package *is* 123 | fortune-mod (although in the case of Debian-and-derivatives it is likely 124 | very out-of-date as of September 2020). 125 | 126 | === Why is it written in C? Can't it be written in Perl, awk, Python, etc.? 127 | 128 | The answer has several parts: 129 | 130 | First of all, note that according to 131 | https://en.wikipedia.org/wiki/Fortune_%28Unix%29[the wikipedia page], the 132 | original “fortune” was created in 1979. This is before the first version of 133 | perl was released in 1987, or those of python, ruby, or Lua, which were 134 | released later, and when UNIX-running computers were more underpowered than 135 | they are today. 136 | 137 | Secondly, you can find some reimplementations of fortune here: 138 | 139 | * https://metacpan.org/pod/distribution/PerlPowerTools/bin/fortune[Perl] 140 | * https://github.com/bmc/fortune[Python] 141 | * https://github.com/jvzantvoort/fortune[Go-Lang] (and not too serious) 142 | * https://github.com/cafkafk/fortune-kind[fortune-kind in Rust-Lang] (under AGPL and with filtered data) 143 | 144 | You may be able to get them to work with the data files of fortune-mod 145 | and other fortune collections, but note that we have not closely 146 | reviewed their source codes. 147 | 148 | Thirdly, most of the value (and relative data size) of the tarball is in 149 | the quotes collection. 150 | 151 | Fourthly, a native executable might still provide a 152 | https://tonsky.me/blog/disenchantment/[better user-experience]. However, 153 | note that I have yet to perform a stresstest benchmark, and I doubt it will 154 | matter too much for “fortune”'s common use case. 155 | 156 | Finally, note that fortune’s runtime algorithm is not as straightforward as one 157 | may believe, making use of “.dat” files that contain counts and offsets of 158 | the fortune “cookies”. 159 | 160 | === Why did you convert the buildsystem to CMake? 161 | 162 | See: 163 | 164 | * https://github.com/shlomif/fortune-mod/pull/54 165 | * https://twitter.com/shlomif/status/1330457762191511554 166 | 167 | == What was already done. 168 | 169 | . fortune-mod-1.99.1 was imported into the repository from the Mageia 170 | tarball as the tag `fortune-mod-1.99.1`. 171 | . Converted the build system to 172 | https://en.wikipedia.org/wiki/CMake[CMake] . 173 | . Converted the source files to UTF-8. 174 | . Added some tests. 175 | . Removed trailing whitespace. 176 | . Reformatted long (> 80 chars) lines. 177 | . Fixed some typos. 178 | . Added https://travis-ci.org/[Travis-CI] testing. 179 | . Added valgrind tests and fixed some memory leaks. 180 | . Released fortune-mod-1.99.3, fortune-mod-1.99.4, v2.0.0 and up to 181 | version 2.26.0 and beyond. 182 | . Fixed some C compiler warnings encountered with the GCC compiler flags 183 | of 184 | https://github.com/shlomif/shlomif-cmake-modules[Shlomif_Common]. 185 | . Added a build-time option to remove the “-o” (= “offensive”) flag, 186 | inspired by a set of patches on the Fedora package. 187 | . Applied some downstream patches. 188 | . Fixed as many “clang -Weverything” warnings as possible. 189 | . lib-recode became maintained again at 190 | https://github.com/rrthomas/recode (thanks to @rrthomas ) thus 191 | preventing a switch to something else. 192 | . Got the build and tests to pass on 193 | https://ci.appveyor.com/project/shlomif/fortune-mod[AppVeyor/MS Windows] 194 | (with some appreciated help). 195 | . Found and fixed some security issues: 196 | * Seem to have affected some Linux distributions as well as FreeBSD and 197 | NetBSD. 198 | ** Was already fixed in OpenBSD 199 | * https://bugs.mageia.org/show_bug.cgi?id=26567 200 | * https://advisories.mageia.org/MGASA-2020-0199.html 201 | * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246050 202 | * https://github.com/shlomif/fortune-mod/commit/fe182a25663261be6e632a2824f6fd653d1d8f45 203 | * https://github.com/shlomif/fortune-mod/commit/540c495f57e441b745038061a3cfa59e3a97bf33 204 | * https://github.com/shlomif/fortune-mod/commit/acd338098071bddfa1d21f87e1813727031428ea 205 | . Reformatted the C code using 206 | https://clang.llvm.org/docs/ClangFormat.html[clang-format]. 207 | . Moved some cookies to/from the offensive collection. 208 | . Added new cookies. 209 | 210 | == What remains to be done. 211 | 212 | . Fix more typos (issue reports and pull-requests are welcome.) 213 | . Add more quotes / fortune cookies (issue reports and pull-requests are welcome.). 214 | . Prepare packages for the new releases for 215 | https://pkgs.org/download/fortune-mod[downstream distributions/Operating 216 | Systems]. 217 | 218 | == Links 219 | 220 | * https://www.shlomifish.org/humour/fortunes/[Shlomi Fish’s Fortune 221 | Cookie Files] - on his site, containing links to many other collections 222 | of fortune cookies. 223 | * https://web-cpan.shlomifish.org/modules/XML-Grammar-Fortune/[XML-Grammar-Fortune] 224 | - an XML grammar for collections of quotes, allowing one to generate 225 | XHTML or plaintext. 226 | * http://www.anvari.org/fortune/[Anvari.org’s web interface to “fortune”] 227 | - with many collections. 228 | -------------------------------------------------------------------------------- /fortune-mod/.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | BasedOnStyle: LLVM 3 | AlignAfterOpenBracket: DontAlign 4 | BreakBeforeBraces: Custom 5 | IndentWidth: 4 6 | SortIncludes: false 7 | BraceWrapping: 8 | AfterClass: true 9 | AfterControlStatement: true 10 | AfterEnum: true 11 | AfterFunction: true 12 | AfterExternBlock: false 13 | AfterNamespace: true 14 | AfterStruct: true 15 | BeforeCatch: true 16 | BeforeElse: true 17 | -------------------------------------------------------------------------------- /fortune-mod/.tidyallrc: -------------------------------------------------------------------------------- 1 | [ClangFormat] 2 | select = **/*.{c,h} 3 | 4 | [PerlCritic] 5 | ignore = rinutils/t/lib/Rinutils/InlineWrap.pm 6 | select = **/*.{pl,pm,t} 7 | 8 | [PerlTidy] 9 | argv = -ci=4 -bl -cti=0 --character-encoding=none 10 | ignore = rinutils/run-tests.pl rinutils/t/lib/Rinutils/InlineWrap.pm **/t/valgrind*.t 11 | select = **/*.{pl,pm,t} 12 | 13 | [TestCount] 14 | select = **/*.t 15 | -------------------------------------------------------------------------------- /fortune-mod/COPYING.txt: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1986, 1993 3 | * The Regents of the University of California. All rights reserved. 4 | * 5 | * This code is derived from software contributed to Berkeley by 6 | * Ken Arnold. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 3. All advertising materials mentioning features or use of this software 17 | * must display the following acknowledgement: 18 | * This product includes software developed by the University of 19 | * California, Berkeley and its contributors. 20 | * 4. Neither the name of the University nor the names of its contributors 21 | * may be used to endorse or promote products derived from this software 22 | * without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 25 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 | * SUCH DAMAGE. 35 | */ 36 | 37 | /* Modified September, 1995, Amy A. Lewis 38 | * 1: removed all file-locking dreck. Unnecessary 39 | * 2: Fixed bug that made fortune -f report a different list than 40 | * fortune with any other parameters, or none, and which forced 41 | * the program to read only one file (named 'fortunes') 42 | * 3: removed the unnecessary print_file_list() 43 | * 4: Added "OFFDIR" to pathnames.h as the directory in which offensive 44 | * fortunes are kept. This considerably simplifies our life by 45 | * permitting us to dispense with a lot of silly tests for the string 46 | * "-o" at the end of a filename. 47 | * 5: I think the problems with trying to find filenames were fixed by 48 | * the change in the way that offensive files are defined. Two birds, 49 | * one stone! 50 | * 6: Calculated probabilities for all files, so that -f will print them. 51 | */ 52 | 53 | /* Changes Copyright (c) 1997 Dennis L. Clark. All rights reserved. 54 | * 55 | * The changes in this file may be freely redistributed, modified or 56 | * included in other software, as long as both the above copyright 57 | * notice and these conditions appear intact. 58 | */ 59 | 60 | /* Modified May 1997, Dennis L. Clark (dbugger@progsoc.uts.edu.au) 61 | * + Various portability fixes 62 | * + Percent selection of files with -a now works on datafiles which 63 | * appear in both unoffensive and offensive directories (see man page 64 | * for details) 65 | * + The -s and -l options are now more consistent in their 66 | * interpretation of fortune length 67 | * + The -s and -l options can now be combined wit the -m option 68 | */ 69 | 70 | /* Modified Jul 1999, Pablo Saratxaga 71 | * - added use of the LANG variables; now if called without argument 72 | * it will choose (if they exist) fortunes in the users' language. 73 | * (that is, under a directory $LANG/ under the main fortunes directory 74 | * 75 | * Added to debian by Alastair McKinstry, , 2002-07-31 76 | */ 77 | -------------------------------------------------------------------------------- /fortune-mod/INDEX: -------------------------------------------------------------------------------- 1 | This is fortune-mod, an feature-enhanced fortune derived from sources 2 | found in NetBSD. You can also find out more about this package in the 3 | following files: 4 | 5 | README 6 | A list of announcements and important information for fortune-mod. 7 | 8 | INSTALL 9 | How to configure, compile and install fortune-mod. 10 | 11 | TODO 12 | Ideas for future development of fortune-mod. 13 | 14 | ChangeLog 15 | A revision history of fortune-mod. 16 | 17 | Notes 18 | Discussion of the behavior of fortune (obsolete for this 19 | version) and conventions for formatting fortune entries, 20 | from NetBSD fortune. 21 | 22 | Offensive 23 | Discussion on the "offensive" fortune files distributed in this 24 | package. 25 | 26 | cookie-files 27 | A list of the fortune files (both inoffensive and offensive) 28 | distributed in this package. 29 | -------------------------------------------------------------------------------- /fortune-mod/INSTALL.asciidoc: -------------------------------------------------------------------------------- 1 | INSTALL file for fortune-mod 2 | ============================ 3 | Shlomi Fish 4 | :Date: 2016-12-29 5 | 6 | Quick and Dirty Compilation 7 | --------------------------- 8 | 9 | fortune-mod uses CMake ( http://www.cmake.org/ ) 10 | for its build system. Version 3.2 or later is required. 11 | 12 | You will also need: 13 | 14 | 1. librecode (= the "recode" library) from https://github.com/rrthomas/Recode - version 3.7 or later. 15 | 16 | 2. rinutils from https://github.com/shlomif/rinutils (should be bundled with 17 | fortune-mod's source. 18 | 19 | 3. cmocka from https://cmocka.org/ (for testing only). 20 | 21 | Next, run: 22 | 23 | mkdir build 24 | cd build 25 | cmake-gui .. # For the GUI configuration applet 26 | 27 | Or: 28 | 29 | ccmake .. # For the Curses-based configuration applet 30 | 31 | With a fallback to: 32 | 33 | cmake .. # Non-interactive application. 34 | 35 | This will build and install all the executables and install the fortune 36 | collections. 37 | 38 | Installing under Win32 39 | ---------------------- 40 | 41 | Consult the CMake documentation for generating a Visual C++ , MinGW32 42 | etc. compatible makefile or project. It may only work under cygwin or similar 43 | environment. 44 | 45 | Testing 46 | ------- 47 | 48 | The tests require the File::Find::Object Perl module 49 | (libfile-find-object-perl in Debian and derivatives), Test::Differences 50 | (libtest-differences-perl), 51 | Path::Tiny ( libpath-tiny-perl ), and Test::RunValgrind (from CPAN). 52 | 53 | To test fortune-mod, you need to: 54 | 55 | 1. Configure it. 56 | 57 | 2. Build it. 58 | 59 | 3. Run "make check". 60 | 61 | Please report any errors to me ( http://www.shlomifish.org/me/contact-me/ ). 62 | -------------------------------------------------------------------------------- /fortune-mod/Notes: -------------------------------------------------------------------------------- 1 | # $NetBSD: Notes,v 1.2 1995/03/23 08:28:26 cgd Exp $ 2 | # @(#)Notes 8.1 (Berkeley) 5/31/93 3 | 4 | Warning: 5 | The fortunes contained in the fortune database have been collected 6 | haphazardly from a cacophony of sources, in number so huge it 7 | boggles the mind. It is impossible to do any meaningful quality 8 | control on attributions, or lack thereof, or exactness of the quote. 9 | Since this database is not used for profit, and since entire works 10 | are not published, it falls under fair use, as we understand it. 11 | However, if any half-assed idiot decides to make a profit off of 12 | this, they will need to double check it all, and nobody not involved 13 | of such an effort makes any warranty that anything in the database 14 | bears any relation to the real world of literature, law, or other 15 | bizzarrity. 16 | 17 | ==> GENERAL INFORMATION 18 | By default, fortune retrieves its fortune files from the directory 19 | /usr/local/share/games/fortune. A fortune file has two parts: the source file 20 | (which contains the fortunes themselves) and the data file which describes 21 | the fortunes. The data file always has the same name as the fortune file 22 | with the string ".dat" concatenated, e.g. if "fort" is a standard fortune 23 | database, then "fort.dat" is the data file which describes it. See 24 | strfile(8) for more information on creating the data files. 25 | Fortunes are split into potentially offensive and not potentially 26 | offensive parts. The offensive version of a file has the same name as the 27 | non-offensive version but exists in the offensive fortunes directory 28 | (/usr/local/share/games/fortune/off by default). The fortune program 29 | automatically assumes that any file in the offensive fortune directory 30 | is potentially offensive, and should therefore only be displayed if 31 | explicitly requested, either with the -o option, by specifying a file name 32 | on the command line, or by appending "-o" to the name. 33 | Potentially offensive fortune files should NEVER be maintained in 34 | clear text on the system. They are rotated (see caesar(6)) 13 positions. 35 | To create a new, potentially offensive database, use caesar to rotate it, 36 | and then create its data file with the -x option to strfile(8). The fortune 37 | program automatically decrypts the text when it prints entries from such 38 | databases. 39 | Anything which would not make it onto network prime time programming 40 | (or which would only be broadcast if some discredited kind of guy said it) 41 | MUST be in the potentially offensive database. Fortunes containing any 42 | explicit language (see George Carlin's recent updated list) MUST be in the 43 | potentially offensive database. Political and religious opinions are often 44 | sequestered in the potentially offensive section as well. Anything which 45 | assumes as a world view blatantly racist, misogynist (sexist), or homophobic 46 | ideas should not be in either, since they are not really funny unless *you* 47 | are racist, misogynist, or homophobic. 48 | The point of this is that people have should have a reasonable 49 | expectation that, should they just run "fortune", they will not be offended. 50 | We know that some people take offense at anything, but normal people do have 51 | opinions, too, and have a right not to have their sensibilities offended by 52 | a program which is supposed to be entertaining. People who run "fortune 53 | -o" or "fortune -a" are saying, in effect, that they are willing to have 54 | their sensibilities tweaked. However, they should not have their personal 55 | worth seriously (i.e., not in jest) assaulted. Jokes which depend for their 56 | humor on racist, misogynist, or homophobic stereotypes *do* seriously 57 | assault individual personal worth, and in an general entertainment medium 58 | we should be able to get by without it. 59 | 60 | ==> FORMATTING 61 | This file describes the format for fortunes in the database. This 62 | is done in detail to make it easier to keep track of things. Any rule given 63 | here may be broken to make a better joke. 64 | 65 | [All examples are indented by one tab stop -- KCRCA] 66 | 67 | Numbers should be given in parentheses, e.g., 68 | 69 | (1) Everything depends. 70 | (2) Nothing is always. 71 | (3) Everything is sometimes. 72 | 73 | Attributions are two tab stops, followed by two hyphens, followed by a 74 | space, followed by the attribution, and are *not* preceded by blank 75 | lines. Book, journal, movie, and all other titles are in quotes, e.g., 76 | 77 | $100 invested at 7% interest for 100 years will become $100,000, at 78 | which time it will be worth absolutely nothing. 79 | -- Lazarus Long, "Time Enough for Love" 80 | 81 | Attributions which do not fit on one (72 char) line should be continued 82 | on a line which lines up below the first text of the attribution, e.g., 83 | 84 | -- A very long attribution which might not fit on one 85 | line, "Ken Arnold's Stupid Sayings" 86 | 87 | Single paragraph fortunes are in left justified (non-indented) paragraphs 88 | unless they fall into another category listed below (see example above). 89 | Longer fortunes should also be in left justified paragraphs, but if this 90 | makes it too long, try indented paragraphs, with indentations of either one 91 | tab stop or 5 chars. Indentations of less than 5 are too hard to read. 92 | 93 | Laws have the title left justified and capitalized, followed by a colon, 94 | with all the text of the law itself indented one tab stop, initially 95 | capitalized, e.g., 96 | 97 | A Law of Computer Programming: 98 | Make it possible for programmers to write in English and 99 | you will find the programmers cannot write in English. 100 | 101 | Limericks are indented as follows, all lines capitalized: 102 | 103 | A computer, to print out a fact, 104 | Will divide, multiply, and subtract. 105 | But this output can be 106 | No more than debris, 107 | If the input was short of exact. 108 | 109 | No fortune should run beyond 72 characters on a single line without good 110 | justification (er, no pun intended). And no right margin justification, 111 | either. Sorry. For BSD people, there is a program called "fmt" which can 112 | make this kind of formatting easier. 113 | 114 | Definitions are given with the word or phrase left justified, followed by 115 | the part of speech (if appropriate) and a colon. The definition starts 116 | indented by one tab stop, with subsequent lines left justified, e.g., 117 | 118 | Afternoon, n.: 119 | That part of the day we spend worrying about how we wasted 120 | the morning. 121 | 122 | Quotes are sometimes put around statements which are funnier or make more 123 | sense if they are understood as being spoken, rather than written, 124 | communication, e.g., 125 | 126 | "All my friends and I are crazy. That's the only thing that 127 | keeps us sane." 128 | 129 | Ellipses are always surrounded by spaces, except when next to punctuation, 130 | and are three dots long. 131 | 132 | "... all the modern inconveniences ..." 133 | -- Mark Twain 134 | 135 | Human initials always have spaces after the periods, e.g, "P. T. Barnum", 136 | not "P.T. Barnum". However, "P.T.A.", not "P. T. A.". 137 | 138 | All fortunes should be attributed, but if and only if they are original with 139 | somebody. Many people have said things that are folk sayings (i.e., are 140 | common among the folk (i.e., us common slobs)). There is nothing wrong with 141 | this, of course, but such statements should not be attributed to individuals 142 | who did not invent them. 143 | 144 | Horoscopes should have the sign indented by one tab stop, followed by the 145 | dates of the sign, with the text left justified below it, e.g., 146 | 147 | AQUARIUS (Jan 20 - Feb 18) 148 | You have an inventive mind and are inclined to be progressive. You 149 | lie a great deal. On the other hand, you are inclined to be 150 | careless and impractical, causing you to make the same mistakes over 151 | and over again. People think you are stupid. 152 | 153 | Single quotes should not be used except as quotes within quotes. Not even 154 | single quotes masquerading as double quotes are to be used, e.g., don't say 155 | ``hi there'' or `hi there' or 'hi there', but "hi there". However, you 156 | *can* say "I said, `hi there'". 157 | 158 | A long poem or song can be ordered as follows in order to make it fit on a 159 | screen (fortunes should be 19 lines or less if at all possible) (numbers 160 | here are stanza numbers): 161 | 162 | 11111111111111111111 163 | 11111111111111111111 164 | 11111111111111111111 22222222222222222222 165 | 11111111111111111111 22222222222222222222 166 | 22222222222222222222 167 | 33333333333333333333 22222222222222222222 168 | 33333333333333333333 169 | 33333333333333333333 44444444444444444444 170 | 33333333333333333333 44444444444444444444 171 | 44444444444444444444 172 | 44444444444444444444 173 | 174 | 175 | -------------------------------------------------------------------------------- /fortune-mod/Offensive: -------------------------------------------------------------------------------- 1 | An attempt has been made to restructure the fortune database. This has 2 | included, of necessity, a concatenation and redivision of the offensive 3 | and inoffensive fortunes. In the process, some fortunes may have gotten 4 | lost, and others may have moved from one category to another (or from 5 | both categories to one or the other, more commonly). 6 | 7 | The following were the criteria I used to make the division: 8 | Anything about sex is offensive. Welcome to America. *sigh* 9 | Insults based on religion or ethnicity are offensive. 10 | Generally, any criticism of anybody's religion is offensive. 11 | "He really said that?" quotes from politicians are offensive. 12 | Political bias is offensive. 13 | Limericks are offensive even if they aren't. 14 | Tastelessness is offensive (q.v. "The Snack"). 15 | Misogyny and misandry for the sake of themselves are offensive. 16 | Vulgarity is offensive. 17 | Violence for the sake of humor is offensive. 18 | 19 | Surprisingly, given this rather broad definition, there are still more 20 | inoffensive quotations, quips, and quozzits than offensive ones. A 21 | peculiar, back-handed compliment to human nature (it surprised me). 22 | 23 | In another file in this directory (Notes), the original author(s) of the 24 | fortune distribution state that "racist, mysogynist [sic] (sexist), or 25 | homophobic ideas" should never be included in the fortune database. 26 | 27 | This was not the case when the database came into my possession, and I 28 | began attempting to divide it thematically. Misogyny and homophobia are 29 | both pretty well-represented; it is thus only a minor relief that racism 30 | isn't (nonetheless, it *is* a relief). Faced with two unpalatable 31 | alternatives, of including material that really deserves no wider 32 | publication or of acting the censor, I choose to pass on the 33 | responsibility, though I have attempted to make maintenance easier. 34 | Misogyny is sequestered in the file "misogyny," homophobia in "hphobia," 35 | and racism in "racism" (see the file 'cookie-files' in this directory for 36 | a discussion of the contents of the various files), all in the offensive 37 | directory. Those who respect women, gays, and people of color may prefer 38 | to either remove the .dat file (which keeps the strings, but makes them 39 | inaccessible via the fortune program), or to delete these files altogether. 40 | 41 | I admit that I was strongly tempted to simply remove these fortunes, an 42 | action that I might have justified by pointing to the Notes of the 43 | original authors. However, it appears that over the course of time there 44 | have been those who find these sorts of prejudice amusing, and in 45 | America, at least, even Nazi rhetoric is a protected form of speech. So 46 | I include them, and leave the decision to individual system administrators. 47 | 48 | I will add, as a final note, that reading through the offensive fortunes 49 | (I have been forced to read and reread every fortune in the database 50 | several times, in order to assign things to their proper places) has left 51 | me far less amused by fortune -o than previously. It is easy to overdose 52 | on insult. 53 | 54 | Amy Lewis alewis@email.unc.edu September-October 1995. 55 | -------------------------------------------------------------------------------- /fortune-mod/README: -------------------------------------------------------------------------------- 1 | fortune-mod README 2 | ================== 3 | 4 | This is fortune-mod. It now lives at: 5 | 6 | * https://github.com/shlomif/fortune-mod 7 | 8 | * http://www.shlomifish.org/open-source/projects/fortune-mod/ 9 | 10 | It is based on fortune-mod-1.99.1 with many improvements. 11 | 12 | -- Shlomi Fish 13 | 14 | Old README 15 | ========== 16 | 17 | This is fortune-mod-1.99.1. It's a pre-release for 18 | fortune-mod-2.0. This should give interested parties a chance to have 19 | a look at the changes that have come in, and the new features. 20 | 21 | Fortune-mod now leaves at http://www.redellipse.net/code/fortune. You 22 | can find the CVS repository at 23 | http://cvs.alioth.debian.org/cgi-bin/cvsweb.cgi/fortune/?cvsroot=fortune 24 | 25 | Many thanks to Dennis for making the last release of this software, 26 | and to everyone who has taken the time to contribute quotes. We are 27 | now up to 22203 fortunes at last count. Keep 'em coming! 28 | 29 | -- Pascal Hakim Fri, 05 Mar 2004 23:03:00 +1100 30 | 31 | --- Dennis' README--- 32 | fortune-mod README 33 | ================== 34 | 35 | This is fortune-mod 9708. It is basically the same as the fortune-mod 36 | released in October 1995, with some portability improvements, bug fixes 37 | and documentation cleanup. 38 | 39 | The most significant fix was for the reported bug about the `-a' option 40 | of fortune with database names that appear in both the inoffensive and 41 | offensive directories. This was solved by allowing the user to append 42 | '-o' to a fortune name while `-a' is in effect to force selection of the 43 | offensive version of a database. 44 | 45 | Other changes/fixes: Fortune is now consistent in how it determines a 46 | fortune's length (for -s and -l). The -m can now be used together with 47 | -s or -l: only fortunes which match _BOTH_ the pattern and the length 48 | requirement will be printed. 49 | 50 | Most of the other features over the usual BSD fortune are summarised in 51 | Amy's README.Linux, included below, and in the accompanying manual pages 52 | for fortune(6) and strfile(1). 53 | 54 | The changes in fortune.c and fortune.man are copyrighted by me but 55 | freely distributable: see the source files for details. All other 56 | changes are in the public domain: you may do what you like with them. 57 | 58 | Getting this Software 59 | --------------------- 60 | 61 | You can find out about my latest version of this package from my 62 | Software Hacks web page: 63 | 64 | http://www.progsoc.uts.edu.au/~dbugger/hacks/hacks.html 65 | 66 | From it, there are links to download the source code. 67 | 68 | I shall also be uploading "stable" releases to the SunSITE Linux mirror 69 | network, so check out sunsite.unc.edu or your local SunSITE mirror. If 70 | you still can't find it, the package should be registered under the 71 | Linux Software Map, at: 72 | 73 | http://www.execpc.com/lsm/ 74 | 75 | Its LSM entry should tell you where to find it. 76 | 77 | Cheers, 78 | 79 | 80 | -- Dennis L. Clark Thu, 28 Aug 1997 11:42:15 -0400 81 | 82 | ----Amy's README.Linux--- 83 | This version of fortune is a modification of the NetBSD fortune, as 84 | tweaked by Florian La Roche (see below, and many thanks to Florian for 85 | starting the update), and then massively hacked on by Amy Lewis. 86 | 87 | I (Amy) hacked on this because it was broken; the BSD source itself is 88 | broken (I looked at it). Specifically, if you are using an old version 89 | of fortune, then it accesses *only* the two files "fortunes" and 90 | "fortunes-o", even though 'fortune -[ao]f' will tell you differently. 91 | That was my original reason to start working with the code. 92 | 93 | Bug fixes: fortune now reads the same file list that it reports with -f. 94 | strfile now really sorts and randomizes, instead of just setting the 95 | 'sorted' and 'randomized' flags. strfile does not lose the pointer to a 96 | fortune that follows a null fortune. 97 | 98 | Enhancements: fortune -f now prints percentages, whether specified on the 99 | command line or not. fortune -m now prints filenames to stderr; the 100 | fortunes printed to stdout can be redirected into a file which is valid 101 | strfile format. fortune -l|s can be modified with -n _number_ to specify 102 | the number of characters in a short fortune (default 160, as before). 103 | The means of distinguishing between offensive and inoffensive fortunes is 104 | changed: offensive fortunes are put in a separate subdirectory. The 105 | contents of the fortunes databases have been extensively reviewed, and 106 | broken into smaller, more manageable [hopefully] files. 107 | strfile is not notably enhanced, though it received the most significant 108 | bug fixes. unstr now accepts a command line parameter -c _char_ which 109 | globally changes the delimiter character. unstr now accepts an output 110 | file as the second file parameter, and can tell if a file has a '.dat' 111 | extension. 112 | An example of the use of fortune-style databases for other purposes, 113 | called randstr, has been added. See util/README.randstr 114 | The Makefiles have been extensively hacked upon. 115 | 116 | Bugs: combining -a with xx% filename, when _filename_ is found in both 117 | the offensive and the inoffensive directories, causes fortune to exit 118 | without an error message. I think it's confused as to which file gets 119 | the xx%. I should fix this. Don't hold your breath, though. 120 | 121 | For more information, see the files ChangeLog, Offensive, README.install, 122 | and cookie-files in the top-level directory, and the comments in the 123 | various *.c source files. 124 | 125 | Amy A. Lewis alewis@email.unc.edu October, 1995 126 | 127 | ----Florian's README.LINUX--- 128 | I have looked at sunsite and tsx and found one very old fortune program 129 | and one in the debian Linux distribution. But comparing that one with 130 | the version in NetBSD-current showed me, that NetBSD-current has fixed 131 | so many speeling-bugs that I just had to repackage everything for the 132 | Linux community. 133 | 134 | In the source package are all changes for Linux in the file LINUX.DIF. 135 | (Rewriting the Makefiles and some trivial small fixes.) 136 | 137 | I expect this "fortune.tar.gz" to show up under /pub/Linux/games. 138 | 139 | Not only the kernel needs speeling-corrections, 140 | 141 | Florian La Roche florian@jurix.jura.uni-sb.de April 1995 142 | 143 | 144 | PS. The following is the README from the originating NetBSD fortune: 145 | =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 146 | 147 | # $NetBSD: README,v 1.2 1995/03/23 08:28:29 cgd Exp $ 148 | # @(#)README 8.1 (Berkeley) 5/31/93 149 | 150 | The potentially offensive fortunes are not installed by default on BSD 151 | systems. If you're absolutely, *positively*, without-a-shadow-of-a-doubt 152 | sure that your user community wants them installed, whack the Makefile 153 | in the subdirectory datfiles, and do "make all install". 154 | 155 | =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 156 | Some years ago, my neighbor Avery said to me: "There has not been an 157 | adequate jokebook published since "Joe_Miller", which came out in 1739 and 158 | which, incidentally, was the most miserable no-good ... jokebook in the 159 | history of the printed word." 160 | In a subsequent conversation, Avery said: "A funny story is a funny 161 | story, no matter who is in it - whether it's about Catholics or Protestants, 162 | Jews or Gentiles, blacks or whites, browns or yellows. If a story is genuinely 163 | funny it makes no difference how dirty it is. Shout it from the rooftops. 164 | Let the chips fall all over the prairie and let the bonehead wowsers yelp. 165 | ... on them." 166 | It is a nice thing to have a neighbor of Avery's grain. He has 167 | believed in the aforestated principles all his life. A great many other 168 | people nowadays are casting aside the pietistic attitude that has led them 169 | to plug up their ears against the facts of life. We of The Brotherhood 170 | believe as Avery believes; we have never been intimidated by the pharisaical 171 | meddlers who have been smelling up the American landscape since the time of 172 | the bundling board. Neither has any one of our members ever been called a 173 | racist. Still, we have been in unremitting revolt against the ignorant 174 | propensity which ordains, in effect, that "The Green Pastures" should never 175 | have been written; the idiot attitude which compelled Arthur Kober to abandon 176 | his delightful Bella Gross, and Octavius Roy Cohen to quit writing about the 177 | splendiferous Florian Slappey; the moronic frame of mind which, if carried 178 | to its logical end, would have forbidden Ring Lardner from writing in the 179 | language of the masses. 180 | -- H. Allen Smith, "Rude Jokes" 181 | 182 | ... let us keep in mind the basic governing philosophy of The 183 | Brotherhood, as handsomely summarized in these words: we believe in 184 | healthy, hearty laughter -- at the expense of the whole human race, if 185 | needs be. 186 | Needs be. 187 | -- H. Allen Smith, "Rude Jokes" 188 | -------------------------------------------------------------------------------- /fortune-mod/TODO: -------------------------------------------------------------------------------- 1 | * .fortunerc and /etc/fortunerc support 2 | 3 | * More fortunes! 4 | 5 | * Properly format all fortunes! (See notes for details) 6 | 7 | * Localised -a and -o fortune display 8 | 9 | -- Pascal Hakim 10 | -------------------------------------------------------------------------------- /fortune-mod/cmake/PLACEHOLDER: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shlomif/fortune-mod/48e368f6b7f12201e0847c8801c6b796f9cbdb26/fortune-mod/cmake/PLACEHOLDER -------------------------------------------------------------------------------- /fortune-mod/cmake/rinutils_bootstrap.cmake: -------------------------------------------------------------------------------- 1 | MACRO(RINUTILS_SET_UP_FLAGS) 2 | # Clone the rinutils repository with the appropriate tag. 3 | SET (rinutils_dir "rinutils") 4 | SET (rinutils_dir_absolute "${CMAKE_CURRENT_SOURCE_DIR}/${rinutils_dir}") 5 | SET (rinutils_inc_dir "${rinutils_dir_absolute}/rinutils/include") 6 | SET (rinutils_git_tag "0.10.2") 7 | 8 | IF (NOT EXISTS "${rinutils_inc_dir}") 9 | EXECUTE_PROCESS( 10 | COMMAND "git" "clone" "-b" "${rinutils_git_tag}" "https://github.com/shlomif/rinutils.git" "${rinutils_dir}" 11 | WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" 12 | ) 13 | ELSE () 14 | IF () 15 | EXECUTE_PROCESS( 16 | COMMAND "git" "submodule" "update" "--init" 17 | WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" 18 | ) 19 | ENDIF () 20 | ENDIF () 21 | 22 | find_package(Rinutils QUIET) 23 | IF ("${Rinutils_FOUND}") 24 | INCLUDE_DIRECTORIES(AFTER ${RINUTILS_INCLUDE_DIR} ${RINUTILS_INCLUDE_DIRS}) 25 | ELSE () 26 | IF (NOT EXISTS "${rinutils_inc_dir}") 27 | MESSAGE(FATAL_ERROR "Could not find rinutils anywhere - it should have been bundled in the releases' source tarball.\nYou can try installing it from a source release or from its repository: https://github.com/shlomif/rinutils\n\nAlso see: https://github.com/shlomif/fortune-mod/issues/44") 28 | ENDIF () 29 | INCLUDE_DIRECTORIES(AFTER "${rinutils_inc_dir}") 30 | ENDIF () 31 | ENDMACRO () 32 | -------------------------------------------------------------------------------- /fortune-mod/cmake/shlomif_common_bootstrap.cmake: -------------------------------------------------------------------------------- 1 | SET (private_mod_path "${CMAKE_SOURCE_DIR}/cmake") 2 | LIST (APPEND CMAKE_MODULE_PATH "${private_mod_path}") 3 | SET (_result) 4 | INCLUDE(Shlomif_Common OPTIONAL RESULT_VARIABLE _result) 5 | 6 | IF ("${_result}" STREQUAL "NOTFOUND") 7 | MESSAGE (WARNING "Could not find Shlomif_Common.cmake - you can find it here: https://github.com/shlomif/shlomif-cmake-modules ; trying to download it for you.") 8 | FILE (DOWNLOAD "https://raw.githubusercontent.com/shlomif/shlomif-cmake-modules/master/shlomif-cmake-modules/Shlomif_Common.cmake" "${private_mod_path}/Shlomif_Common.cmake") 9 | INCLUDE(Shlomif_Common) 10 | ENDIF () 11 | -------------------------------------------------------------------------------- /fortune-mod/config.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * config.h - Configuration file fortune-mod 3 | * 4 | * ${AUTOGENERATED_CONFIG_H} 5 | */ 6 | #pragma once 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | /* Version number of package */ 13 | #define VERSION "${VERSION}" 14 | #define LOCOFFDIR "${LOCALODIR}" 15 | #define LOCFORTDIR "${LOCALDIR}" 16 | #define OFFDIR "${OCOOKIEDIR}" 17 | #define FORTDIR "${COOKIEDIR}" 18 | 19 | /* Defined if you have recode */ 20 | #cmakedefine HAVE_RECODE_H 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | -------------------------------------------------------------------------------- /fortune-mod/cookie-files: -------------------------------------------------------------------------------- 1 | This is a list of the data files included with this distribution, and 2 | what they contain. 3 | 4 | To contribute, see: 5 | 6 | https://github.com/shlomif/fortune-mod 7 | 8 | One can also send me patches by E-mail / etc.: 9 | 10 | https://www.shlomifish.org/me/contact-me/ 11 | 12 | Offensive fortunes are installed by default. To *not* install them, 13 | use the "-D NO_OFFENSIVE=TRUE" option to cmake. 14 | 15 | ./datfiles/ : the directory for inoffensive fortunes 16 | 17 | art : Broadly construed; it includes television and celebrities. 18 | ascii-art : each one worth a thousand words, I guess. 19 | computers : various fortunes that are computer-related. This includes 20 | the 'joke' fortunes that are supposed to emulate system 21 | error messages, as well as some neat stuff. 22 | cookie : Cookie file from Karl Lehenbauer's postings to alt.sources 23 | definitions : It ought to be all the 'definitions,' but what it really 24 | is, is all the definitions that have a first line ending 25 | with a colon. 26 | disclaimer : Disclaimer texts found on products and advertisements. 27 | Work well after corporate mandated login banners. 28 | drugs : Alcohol and cigarettes, mostly. Legal chemicals. 29 | education : Schools, teachers, and scholarship, mostly not complimentary. 30 | ethnic : Jokes that are about groups of people, but aren't making 31 | fun of them. Laughing with instead of at. 32 | food : Recipes, diets, and more about food. 33 | fortunes : Yes, the old file name, but this contains predictions, 34 | evaluations of character, and the kind of stuff that you 35 | actually expect to get when you want to know your fortune. 36 | goedel : Meta-fortunes. Incomplete, of course. :-) 37 | humorists : Stand-up comedians, and people like Dave Barry. Especially 38 | stuff that doesn't fit into another category (almost anything 39 | that Steven Wright says doesn't fit a category). 40 | kids : Real advice and cynical observations on children, parenting, 41 | and family life. 42 | law : Stupid laws, stupider lawyers. *No* joke about a lawyer 43 | is *ever* offensive (except to lawyers, and who cares?). 44 | linux : From the collection at ftp.icce.rug.nl. Linux-related. 45 | It probably ought to go in with 'computers,' but it's 46 | archived separately, so I'm keeping it separate. 47 | literature : Mostly classic authors; a few newbies. And Bulwer-Lytton. 48 | It should contain more on writing and by writers, but a lot 49 | of that somehow got into art. 50 | love : What no one gets enough of, I guess. 51 | magic : Abracadabra. 52 | medicine : Doctors and cures. And other contradictory juxtapositions. 53 | Exercise. 54 | men-women : And the relations between them. 55 | miscellaneous : Whatever's left over. 56 | news : On journalism, and the unintentionally amusing bits of 57 | journalism. 58 | people : You know, humans. Personality, appearance, relationships, 59 | and all the other evilness of which humans are capable. 60 | It should probably be several smaller files (personality, 61 | appearance, relationships ...) 62 | pets : Mostly cats and dogs, with some goldfish. And penguins. 63 | And a rubber duck. 64 | platitudes : The meaning of life, and of other things, including all those 65 | stupid little sayings, and variants on them. 66 | politics : Comments on man as a political animal. Also police, 67 | soldiers, and other criminals. 68 | riddles : Not really riddles, necessarily, but mostly Q: A: 69 | rules-of-acquisition : The Ferengi Rules of Acquisition. Based on 70 | https://github.com/JKirchartz/fortunes , but we formatted 71 | the lines. 72 | science : Largely math and engineering, but some other interesting 73 | and amusing sorts of science-related apothegms. Also 74 | technology. 75 | songs-poems : Stuff with meter, at least, and usually with rhymes. 76 | sports : You know. Like on television. ;-) 77 | startrek : Apparently quotes from Star Trek Classic. Plus a bit. 78 | the-x-files-taglines : Collection of unique taglines appearing at the beginning 79 | of certain episodes of the television series, The X-Files. 80 | translate-me : A small file containing non-English quotes without 81 | translations. 82 | wisdom : Zen, the True Meaning of Life, and other stupid lies. 83 | work : Really about the business world, and the pains of being a 84 | part of it. The desperate problems of the wealthy. Like 85 | that. 86 | zippy : Quotes from the comic Zippy the Pinhead. 87 | 88 | 89 | ./datfiles/off/ : the directory for offensive fortunes, already rot13'd. 90 | they aren't distributed. All the offensive fortunes, 91 | unrotated, are found in the subdirectory: 92 | ./datfiles/off/unrotated/ : unrotated, offensive fortunes* 93 | 94 | atheism : Wayne Aiken's atheism cookie file, from: 95 | http://www4.ncsu.edu/~aiken/ 96 | astrology : Like in the daily newspapers, except nastier. More would 97 | be nice. A few comments *about* astrology. 98 | black-humor : Death, violence-as-humor, and the like. Really sick stuff. 99 | definitions : Like the inoffensive; first line ends with a colon and 100 | it looks sorta like a definition. 101 | drugs : Various references to illegal herbs and chemicals. 102 | ethnic : Nasty slams at particular ethnic groups. 'Ethnic' actually 103 | includes regionalist jokes in America. 104 | hphobia : Slams at gays and lesbians. 105 | limerick : There once was a file named limerick, / the contents of 106 | which were pretty slick. / Each fortune five lines, / 107 | with execrable rhymes, / And contents t'offend the fanatick. 108 | misandry : Anti-man stuff. Smaller than 'misogyny.' Wotta surprise. 109 | miscellaneous : It has everything that doesn't fit in other categories. 110 | misogyny : Jokes that women encounter as real attitudes daily. Real 111 | attitudes that women have to pretend are jokes daily. 112 | politics : The great wonder about the offensive political file is 113 | that it mostly contains direct quotes by politicians 114 | who *weren't* trying to be funny. 115 | privates : No, not promoted recruits. The naughty bits, that people 116 | aren't supposed to talk about. Body parts and functions. 117 | (Note that "size" has nothing to do with sex, so size 118 | jokes are all in here). 119 | racism : Racism. I suppose it's funny to *someone*. I hope I 120 | never meet him. 121 | religion : Stuff that might offend religious people, mostly Christians. 122 | riddles : Not really riddles, but usually the question format, 123 | some Q&A and some just leading/rhetorical questions. 124 | sex : Uhh. Well, you see, son, there are, umm, birds, and bees... 125 | This ranges from outrageously frank to moderately suggestive. 126 | songs-poems : Filthy, bawdy, naughty songs and poems! Licentious, I tell 127 | tell you! The programmer must be spanked! First the 128 | spanking .... 129 | vulgarity : Jokes in which the 'humor' is bad language, plus some 130 | genuinely funny things that happen to contain bad language. 131 | 132 | The intention throughout has been to create something a bit more 133 | manageable and maintainable, without notable success in most cases. A 134 | more rational division of the fortunes would be preferred, but you do 135 | what comes naturally. 136 | 137 | If you prefer to have all the fortunes in one humongous file, that's fine: 138 | cat 'em all together and run strfile. That's easy; breaking them apart 139 | again isn't. Keep in mind that the "-o" infix format is not supported in 140 | this version of fortune, so keep the offensive files in a separate 141 | directory. 142 | 143 | *If any of these files are not to your taste, do the easy thing: rm 144 | filename.dat. That leaves the fortunes there, but without the pointer 145 | file, inaccessible. Or rm filename, which gets rid of the text strings. 146 | -------------------------------------------------------------------------------- /fortune-mod/datfiles/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # See: https://github.com/shlomif/fortune-mod/issues/58 2 | if (IS_CROSS) 3 | SET (_strfile "strfile") 4 | find_program(_found "${_strfile}") 5 | if (NOT _found) 6 | MESSAGE(FATAL_ERROR "\"strfile\" must be in the executables' path for cross-compiling builds. You can get it from a native install of fortune-mod: https://superuser.com/questions/284342/what-are-path-and-other-environment-variables-and-how-can-i-set-or-use-them . Also see https://github.com/shlomif/fortune-mod/issues/58 .") 7 | endif() 8 | else() 9 | SET (_strfile "${CMAKE_CURRENT_BINARY_DIR}/../strfile") 10 | endif() 11 | SET (_unrot_cookies ) 12 | SET (_install_unrot_cookies ) 13 | SET(cr "rules-of-acquisition") 14 | SET(crfull "${CMAKE_CURRENT_SOURCE_DIR}/${cr}") 15 | SET(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/data/rules-of-acquisition.csv") 16 | SET(script "${CMAKE_CURRENT_SOURCE_DIR}/data/rules-of-acquisition-gen.sh") 17 | ADD_CUSTOM_COMMAND( 18 | OUTPUT "${crfull}" 19 | COMMAND "sh" "${script}" "${SOURCE}" "${crfull}" 20 | DEPENDS "${script}" "${SOURCE}" 21 | ) 22 | if() 23 | SET(cr "rules-of-acquisition2") 24 | SET(crfull "${CMAKE_CURRENT_SOURCE_DIR}/${cr}") 25 | SET(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/data/rules-of-acquisition.csv") 26 | SET(script "${CMAKE_CURRENT_SOURCE_DIR}/data/rules-of-acquisition-gen.pl") 27 | SET(PATH_PERL ${PERL_EXECUTABLE}) 28 | ADD_CUSTOM_COMMAND( 29 | OUTPUT "${crfull}" 30 | COMMAND ${PATH_PERL} "${script}" "${SOURCE}" "${crfull}" 31 | DEPENDS "${script}" "${SOURCE}" 32 | ) 33 | endif() 34 | FOREACH(c ${COOKIES}) 35 | SET(DEST "${c}.dat") 36 | SET(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/${c}") 37 | 38 | SET(PATH_PERL ${PERL_EXECUTABLE}) 39 | ADD_CUSTOM_COMMAND( 40 | OUTPUT "${c}" 41 | COMMAND ${PATH_PERL} 42 | ARGS "-e" 43 | "my (\$src, \$dest) = @ARGV; use File::Copy; copy(\$src, \$dest);" 44 | "${SOURCE}" 45 | "${c}" 46 | DEPENDS "${SOURCE}" 47 | VERBATIM 48 | ) 49 | ADD_CUSTOM_COMMAND( 50 | OUTPUT "${DEST}" 51 | COMMAND "${_strfile}" 52 | ARGS "${SOURCE}" "${DEST}" 53 | DEPENDS "${SOURCE}" "${_strfile}" 54 | ) 55 | 56 | SET(LINK "${c}.u8") 57 | if (WIN32) 58 | ADD_CUSTOM_COMMAND( 59 | OUTPUT "${LINK}" 60 | COMMAND ${CMAKE_COMMAND} -E copy "${SOURCE}" "${LINK}" 61 | ) 62 | else() 63 | ADD_CUSTOM_COMMAND( 64 | OUTPUT "${LINK}" 65 | COMMAND "ln" 66 | ARGS "-sf" "${c}" "${LINK}" 67 | ) 68 | endif() 69 | 70 | SET(_targets_on_build_stage_for_avoiding_broken_symlinks_which_regenerate "${c}") 71 | LIST(APPEND _unrot_cookies ${_targets_on_build_stage_for_avoiding_broken_symlinks_which_regenerate} "${DEST}" "${LINK}") 72 | LIST(APPEND _install_unrot_cookies "${c}" "${CMAKE_CURRENT_BINARY_DIR}/${DEST}" "${CMAKE_CURRENT_BINARY_DIR}/${LINK}") 73 | 74 | ENDFOREACH() 75 | 76 | ADD_CUSTOM_TARGET( 77 | plain_cookies ALL 78 | DEPENDS ${_unrot_cookies} 79 | ) 80 | INSTALL( 81 | FILES ${_install_unrot_cookies} 82 | DESTINATION "${COOKIEDIR}" 83 | ) 84 | 85 | IF (NOT NO_OFFENSIVE) 86 | ADD_SUBDIRECTORY("off") 87 | ENDIF() 88 | -------------------------------------------------------------------------------- /fortune-mod/datfiles/ascii-art: -------------------------------------------------------------------------------- 1 | ( /\__________/\ ) 2 | \(^ @___..___@ ^)/ 3 | /\ (\/\/\/\/) /\ 4 | / \(/\/\/\/\)/ \ 5 | -( """""""""" ) 6 | \ _____ / 7 | ( /( )\ ) 8 | _) (_V) (V_) (_ 9 | (V)(V)(V) (V)(V)(V) 10 | % 11 | ___ ______ Frobtech, Inc. 12 | /__/\ ___/_____/\ 13 | \ \ \ / /\\ 14 | \ \ \_/__ / \ "If you've got the job, 15 | _\ \ \ /\_____/___ \ we've got the frob." 16 | // \__\/ / \ /\ \ 17 | _______//_______/ \ / _\/______ 18 | / / \ \ / / / /\ 19 | __/ / \ \ / / / / _\__ 20 | / / / \_______\/ / / / / /\ 21 | /_/______/___________________/ /________/ /___/ \ 22 | \ \ \ ___________ \ \ \ \ \ / 23 | \_\ \ / /\ \ \ \ \___\/ 24 | \ \/ / \ \ \ \ / 25 | \_____/ / \ \ \________\/ 26 | /__________/ \ \ / 27 | \ _____ \ /_____\/ 28 | \ / /\ \ / \ \ \ 29 | /____/ \ \ / \ \ \ 30 | \ \ /___\/ \ \ \ 31 | \____\/ \__\/ 32 | % 33 | _/I\_____________o______________o___/I\ l * / /_/ * __ ' .* l 34 | I"""_____________l______________l___"""I\ l *// _l__l_ . *. l 35 | [__][__][(******)__][__](******)[__][] \l l-\ ---//---*----(oo)----------l 36 | [][__][__(******)][__][_(******)_][__] l l \\ // ____ >-( )-< / l 37 | [__][__][_l l[__][__][l l][__][] l l \\)) ._****_.(......) .@@@:::l 38 | [][__][__]l .l_][__][__] .l__][__] l l ll _(o_o)_ (@*_*@ l 39 | [__][__][/ <_)[__][__]/ <_)][__][] l l ll ( / \ ) / / / ) l 40 | [][__][ /..,/][__][__][/..,/_][__][__] l l / \\ _\ \_ / _\_\ l 41 | [__][__(__/][__][__][_(__/_][__][__][] l l______________________________l 42 | [__][__]] l , , . [__][__][] l 43 | [][__][_] l . i. '/ , [][__][__] l /\**/\ season's 44 | [__][__]] l O .\ / /, O [__][__][] l ( o_o )_) greetings 45 | _[][__][_] l__l======='=l____[][__][__] l_______,(u u ,),__________________ 46 | [__][__]]/ /l\-------/l\ [__][__][]/ {}{}{}{}{}{} 47 | 48 | In Ellen's house it is warm and toasty while fuzzies play in the snow outside. 49 | % 50 | *** 51 | ******* 52 | ********* 53 | ****** Confucious say: "Is stuffy inside fortune cookie." 54 | ******* 55 | *** 56 | % 57 | SANTA IS BRINGING GOOD WISHES FROM ALL THE 58 | MICRO ARTISTS GANG! MAY 1988 BE A HAPPY YEAR! 59 | 60 | 61 | \__\_ :. ___/ 62 | ..\ /-- 63 | :.______ : .:* : . _ .: :.. . : . . : ()_ .: 64 | (( \. :./(__ :._O_)________:______,____:____/ *\_o 65 | ====(( \: (****) (***) :. ...: .. . ()_______/\\ __-' 66 | \____(( \ ()oo()_/ /.: : ..________/_____ll -/.: .. 67 | ( (( \(())))__/ . .. \\.: ..( ) ll ( l_.: 68 | ( / (( \__*__)___:___ : : )) .) /--------\ \ \ 69 | ( / ((_____________) .. // . / / /..:: . )_)_\ 70 | (____/_____________________\__// : /_/_/ :.. :/_/ \_\ 71 | /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ /_/_/ 72 | % 73 | ___====-_ _-====___ 74 | _--~~~#####// ' ` \\#####~~~--_ 75 | -~##########// ( ) \\##########~-_ 76 | -############// |\^^/| \\############- 77 | _~############// (O||O) \\############~_ 78 | ~#############(( \\// ))#############~ 79 | -###############\\ (oo) //###############- 80 | -#################\\ / `' \ //#################- 81 | -###################\\/ () \//###################- 82 | _#/|##########/\######( (()) )######/\##########|\#_ 83 | |/ |#/\#/\#/\/ \#/\##| \()/ |##/\#/ \/\#/\#/\#| \| 84 | ` |/ V V ` V )|| |()| ||( V ' V /\ \| ' 85 | ` ` ` ` / | |()| | \ ' '<||> ' 86 | ( | |()| | )\ /|/ 87 | __\ |__|()|__| /__\______/|/ 88 | (vvv(vvvv)(vvvv)vvv)______|/ 89 | % 90 | ___====-_ _-====___ 91 | _--~~~#####// \\#####~~~--_ 92 | _-~##########// ( ) \\##########~-_ 93 | -############// :\^^/: \\############- 94 | _~############// (@::@) \\############~_ 95 | ~#############(( \\// ))#############~ 96 | -###############\\ (^^) //###############- 97 | -#################\\ / "" \ //#################- 98 | -###################\\/ \//###################- 99 | _#/:##########/\######( /\ )######/\##########:\#_ 100 | :/ :#/\#/\#/\/ \#/\##\ : : /##/\#/ \/\#/\#/\#: \: 101 | " :/ V V " V \#\: : : :/#/ V " V V \: " 102 | " " " " \ : : : : / " " " " 103 | % 104 | _-^--^=-_ 105 | _.-^^ -~_ 106 | _-- --_ 107 | < >) 108 | | | 109 | \._ _./ 110 | ```--. . , ; .--''' 111 | | | | 112 | .-=|| | |=-. 113 | `-=#$%&%$#=-' 114 | | ; :| 115 | _____.,-#%&$@%#&#~,._____ 116 | % 117 | _ 118 | _ / \ o 119 | / \ | | o o o 120 | | | | | _ o o o o 121 | | \_| | / \ o o o 122 | \__ | | | o o 123 | | | | | ______ ~~~~ _____ 124 | | |__/ | / ___--\\ ~~~ __/_____\__ 125 | | ___/ / \--\\ \\ \ ___ <__ x x __\ 126 | | | / /\\ \\ )) \ ( " ) 127 | | | -------(---->>(@)--(@)-------\----------< >----------- 128 | | | // | | //__________ / \ ____) (___ \\ 129 | | | // __|_| ( --------- ) //// ______ /////\ \\ 130 | // | ( \ ______ / <<<< <>-----<<<<< / \\ 131 | // ( ) / / \` \__ \\ 132 | //-------------------------------------------------------------\\ 133 | 134 | Every now and then, when your life gets complicated and the weasels start 135 | closing in, the only cure is to load up on heinous chemicals and then 136 | drive like a bastard from Hollywood to Las Vegas ... with the music at 137 | top volume and at least a pint of ether. 138 | -- Hunter S. Thompson, "Fear and Loathing in Las Vegas" 139 | % 140 | You are here: 141 | *** 142 | *** 143 | ********* 144 | ******* 145 | ***** 146 | *** 147 | * 148 | 149 | But you're not all there. 150 | % 151 | -------------------------------------------------------------------------------- /fortune-mod/datfiles/data/rules-of-acquisition-gen.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | # ------------------------------------------------------------------------- 4 | # - 5 | # Created by Fonic - 6 | # Date: 12/28/21 - 7 | # - 8 | # ------------------------------------------------------------------------- 9 | 10 | use strict; 11 | use warnings; 12 | 13 | use Path::Tiny qw/ path tempdir tempfile cwd /; 14 | 15 | my ( $infn, $outfn ) = @ARGV; 16 | 17 | # Configuration 18 | my $csv_delimiter = "|"; 19 | my $title_template = "Ferengi Rule of Acquisition %s:"; 20 | my $rule_template = "%s"; 21 | my $source_template = "-- %s"; 22 | my $footer_template = "%%"; 23 | my $line_maxlen = 78; 24 | use Text::Wrap; 25 | 26 | $Text::Wrap::columns = $line_maxlen; 27 | 28 | # Check command line 29 | my @infile = path($infn)->lines_utf8; 30 | chomp @infile; 31 | my $format = 32 | "${title_template}\n${rule_template}\n${source_template}\n${footer_template}\n"; 33 | my @o = map { sprintf( $format, split( /\|/, $_, -1 ) ) =~ s/[ \t ]+\K\n//mrs } 34 | @infile; 35 | path($outfn)->spew_utf8( wrap( "", "", join( "", @o ) ) ); 36 | -------------------------------------------------------------------------------- /fortune-mod/datfiles/data/rules-of-acquisition-gen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # ------------------------------------------------------------------------- 4 | # - 5 | # Created by Fonic - 6 | # Date: 12/28/21 - 7 | # - 8 | # ------------------------------------------------------------------------- 9 | 10 | # Configuration 11 | csv_delimiter="|" 12 | title_template="Ferengi Rule of Acquisition %s:" 13 | rule_template="%s" 14 | source_template="-- %s" 15 | footer_template="%%" 16 | line_maxlen=78 17 | 18 | # Check command line 19 | infile="$1" 20 | shift 21 | outfile="$1" 22 | shift 23 | if test "$#" -ne 0 24 | then 25 | echo "Usage: $0 INFILE OUTFILE" 26 | exit 2 27 | fi 28 | 29 | format="${title_template}\\n${rule_template}\\n${source_template}\\n${footer_template}\\n" 30 | 31 | # Convert CSV to DAT + wrap long lines + remove trailing whitespace 32 | while IFS="${csv_delimiter}" read -r number rule source 33 | do 34 | printf -- "${format}" "${number}" "${rule}" "${source}" 35 | done < "${infile}" | fold -sw "${line_maxlen}" | sed -e 's/[[:space:]]*$//' > "${outfile}" 36 | -------------------------------------------------------------------------------- /fortune-mod/datfiles/goedel: -------------------------------------------------------------------------------- 1 | ======================================================================= 2 | || || 3 | || The FORTUNE-COOKIE program is soon to be a Major Motion Picture! || 4 | || Watch for it at a theater near you next summer! || 5 | || || 6 | ======================================================================= 7 | Francis Ford Coppola presents a George Lucas Production: 8 | "Fortune Cookie" 9 | Directed by Steven Spielberg. 10 | Starring Harrison Ford Bette Midler Marlon Brando 11 | Christopher Reeves Marilyn Chambers 12 | and Bob Hope as "The Waiter". 13 | Costumes Designed by Pierre Cardin. 14 | Special Effects by Timothy Leary. 15 | Read the Warner paperback! 16 | Invoke the Unix program! 17 | Soundtrack on XTC Records. 18 | In 70mm and Dolby Stereo at selected theaters and terminal 19 | centers. 20 | % 21 | 3M, under the Scotch brand name, manufactures a fine adhesive for art 22 | and display work. This product is called "Craft Mount". 3M suggests 23 | that to obtain the best results, one should make the bond "while the 24 | adhesive is wet, aggressively tacky." I did not know what "aggressively 25 | tacky" meant until I read today's fortune. 26 | 27 | [And who said we didn't offer equal time, huh? Ed.] 28 | % 29 | Answers to Last Fortune's Questions: 30 | 31 | (1) None. (Moses didn't have an ark). 32 | (2) Your mother, by the pigeonhole principle. 33 | (3) I don't know. 34 | (4) Who cares? 35 | (5) 6 (or maybe 4, or else 3). Mr. Alfred J. Duncan of Podunk, 36 | Montana, submitted an interesting solution to Problem 5. 37 | (6) There is an interesting solution to this problem on page 1029 of my 38 | book, which you can pick up for $23.95 at finer bookstores and 39 | bathroom supply outlets (or 99 cents at the table in front of 40 | Papyrus Books). 41 | % 42 | Beware of computerized fortune-tellers! 43 | % 44 | By necessity, by proclivity, and by delight, we all quote. In fact, it is as 45 | difficult to appropriate the thoughts of others as it is to invent. 46 | -- R. Emerson 47 | -- Quoted from a fortune cookie program 48 | (whose author claims, "Actually, stealing IS easier.") 49 | [to which I reply, "You think it's easy for me to 50 | misconstrue all these misquotations?!?" Ed.] 51 | % 52 | Chocolate chip. 53 | % 54 | DELETE A FORTUNE! 55 | Don't some of these fortunes just drive you nuts?! 56 | Wouldn't you like to see some of them deleted from the system? 57 | You can! Just mail to `fortune' with the fortune you hate most, 58 | and we'll make sure it gets expunged. 59 | % 60 | Did you know about the -o option of the fortune program? It makes a 61 | selection from a set of offensive and/or obscene fortunes. Why not 62 | try it, and see how offended you are? The -a ("all") option will 63 | select a fortune at random from either the offensive or inoffensive 64 | set, and it is suggested that "fortune -a" is the command that you 65 | should have in your .profile or .cshrc. file. 66 | % 67 | Do not read this fortune under penalty of law. 68 | Violators will be prosecuted. 69 | (Penal Code sec. 2.3.2 (II.a.)) 70 | % 71 | For 20 dollars, I'll give you a good fortune next time ... 72 | % 73 | For some reason, this fortune reminds everyone of Marvin Zelkowitz. 74 | % 75 | Fortune's current rates: 76 | 77 | Answers .10 78 | Long answers .25 79 | Answers requiring thought .50 80 | Correct answers $1.00 81 | 82 | Dumb looks are still free. 83 | % 84 | Generic Fortune. 85 | % 86 | Ginger snap. 87 | % 88 | Has anyone realized that the purpose of the fortune cookie program is to 89 | defuse project tensions? When did you ever see a cheerful cookie, a 90 | non-cynical, or even an informative cookie? 91 | Perhaps inadvertently, we have a channel for our aggressions. This 92 | still begs the question of whether the cookie releases the pressure or only 93 | serves to blunt the warning signs. 94 | 95 | Long live the revolution! 96 | Have a nice day. 97 | % 98 | Hi there! This is just a note from me, to you, to tell you, the person 99 | reading this note, that I can't think up any more famous quotes, jokes, 100 | nor bizarre stories, so you may as well go home. 101 | % 102 | I know you believe you understand what you think this fortune says, but 103 | I'm not sure you realize that what you are reading is not what it means. 104 | % 105 | If it's Tuesday, this must be someone else's fortune. 106 | % 107 | If there are epigrams, there must be meta-epigrams. 108 | % 109 | If this fortune didn't exist, somebody would have invented it. 110 | % 111 | If you wish to live wisely, ignore sayings -- including this one. 112 | % 113 | Ignore previous fortune. 114 | % 115 | In which level of metalanguage are you now speaking? 116 | % 117 | Oatmeal raisin. 118 | % 119 | Oreo. 120 | % 121 | Pardon this fortune. Database under reconstruction. 122 | % 123 | Pick another fortune cookie. 124 | % 125 | Since before the Earth was formed and before the sun burned hot in space, 126 | cosmic forces of inexorable power have been working relentlessly toward 127 | this moment in space-time -- your receiving this fortune. 128 | % 129 | Sorry, no fortune this time. 130 | % 131 | The fortune program is supported, in part, by user contributions and by 132 | a major grant from the National Endowment for the Inanities. 133 | % 134 | There is no such thing as fortune. Try again. 135 | % 136 | This fortune cookie program is out of order. For those in desperate need, 137 | please use the program "randchar". This program 138 | generates random characters, and, given enough time, will undoubtedly come up 139 | with something profound. It will, however, take it no time at all to be more 140 | profound than THIS program has ever been. 141 | % 142 | This Fortune Examined By INSPECTOR NO. 2-14 143 | % 144 | This fortune intentionally left blank. 145 | % 146 | This fortune intentionally not included. 147 | % 148 | This fortune intentionally says nothing. 149 | % 150 | This fortune is dedicated to your mother, without whose invaluable assistance 151 | last night would never have been possible. 152 | % 153 | This fortune is encrypted -- get your decoder rings ready! 154 | % 155 | This fortune is false. 156 | % 157 | This fortune is inoperative. Please try another. 158 | % 159 | This fortune soaks up 47 times its own weight in excess memory. 160 | % 161 | This fortune was brought to you by the people at Hewlett-Packard. 162 | % 163 | This fortune would be seven words long if it were six words shorter. 164 | % 165 | THIS IS PLEDGE WEEK FOR THE FORTUNE PROGRAM 166 | 167 | If you like the fortune program, why not support it now with your 168 | contribution of a pithy fortunes, clean or obscene? We cannot continue 169 | without your support. Less than 14% of all fortune users are contributors. 170 | That means that 86% of you are getting a free ride. We can't go on like 171 | this much longer. Federal cutbacks mean less money for fortunes, and unless 172 | user contributions increase to make up the difference, the fortune program 173 | will have to shut down between midnight and 8 a.m. Don't let this happen. 174 | Mail your fortunes right now to "fortune". Just type in your favorite pithy 175 | saying. Do it now before you forget. Our target is 300 new fortunes by the 176 | end of the week. Don't miss out. All fortunes will be acknowledged. If you 177 | contribute 30 fortunes or more, you will receive a free subscription to "The 178 | Fortune Hunter", our monthly program guide. If you contribute 50 or more, 179 | you will receive a free "Fortune Hunter" coffee mug .... 180 | % 181 | This is your fortune. 182 | % 183 | Vanilla wafer. 184 | % 185 | Very few profundities can be expressed in less than 80 characters. 186 | % 187 | WARNING: 188 | Reading this fortune can affect the dimensionality of your 189 | mind, change the curvature of your spine, cause the growth 190 | of hair on your palms, and make a difference in the outcome 191 | of your favorite war. 192 | % 193 | We interrupt this fortune for an important announcement... 194 | % 195 | What does it mean if there is no fortune for you? 196 | % 197 | When you're not looking at it, this fortune is written in FORTRAN. 198 | % 199 | You will think of something funnier than this to add to the fortunes. 200 | % 201 | -------------------------------------------------------------------------------- /fortune-mod/datfiles/off/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # See: https://github.com/shlomif/fortune-mod/issues/58 2 | SET (_target_rot "${CMAKE_CURRENT_BINARY_DIR}/../../rot") 3 | if (IS_CROSS) 4 | SET (_rot ${PERL_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/../../util/rot.pl") 5 | else() 6 | SET (_rot "${_target_rot}") 7 | endif() 8 | SET (rot_dir "${CMAKE_CURRENT_BINARY_DIR}/rotated") 9 | FILE(MAKE_DIRECTORY "${rot_dir}") 10 | SET (_rotated_cookies ) 11 | SET (_install_rotated_cookies ) 12 | FOREACH(c ${OFFENSIVE_COOKIES}) 13 | SET(rot_dest "${rot_dir}/${c}") 14 | SET(DEST "${c}.dat") 15 | SET(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/unrotated/${c}") 16 | 17 | SET(PATH_PERL ${PERL_EXECUTABLE}) 18 | ADD_CUSTOM_COMMAND( 19 | OUTPUT "${rot_dest}" 20 | COMMAND ${_rot} "<" "${SOURCE}" ">" "${rot_dest}" 21 | DEPENDS "${SOURCE}" "${_target_rot}" 22 | ) 23 | ADD_CUSTOM_COMMAND( 24 | OUTPUT "${DEST}" 25 | COMMAND "${_strfile}" 26 | ARGS "-x" "${rot_dest}" "${DEST}" 27 | DEPENDS "${rot_dest}" "${_strfile}" 28 | ) 29 | 30 | SET(LINK "${c}.u8") 31 | SET(rot_LINK "${rot_dir}/${LINK}") 32 | if (WIN32) 33 | ADD_CUSTOM_COMMAND( 34 | OUTPUT "${rot_LINK}" 35 | COMMAND ${CMAKE_COMMAND} -E copy "${rot_dest}" "${rot_LINK}" 36 | DEPENDS "${rot_dest}" 37 | ) 38 | else() 39 | ADD_CUSTOM_COMMAND( 40 | OUTPUT "${rot_LINK}" 41 | COMMAND "ln" 42 | ARGS "-s" "${c}" "${LINK}" 43 | DEPENDS "${rot_dest}" 44 | WORKING_DIRECTORY "${rot_dir}" 45 | ) 46 | endif() 47 | LIST(APPEND _rotated_cookies "${rot_dest}" "${DEST}" "${rot_LINK}") 48 | LIST(APPEND _install_rotated_cookies "${rot_dest}" "${CMAKE_CURRENT_BINARY_DIR}/${DEST}" "${rot_LINK}") 49 | ENDFOREACH() 50 | 51 | ADD_CUSTOM_TARGET( 52 | offensive_cookies ALL 53 | DEPENDS ${_rotated_cookies} 54 | ) 55 | INSTALL( 56 | FILES ${_install_rotated_cookies} 57 | DESTINATION "${OCOOKIEDIR}" 58 | ) 59 | -------------------------------------------------------------------------------- /fortune-mod/datfiles/off/rotated/PLACEHOLDER: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shlomif/fortune-mod/48e368f6b7f12201e0847c8801c6b796f9cbdb26/fortune-mod/datfiles/off/rotated/PLACEHOLDER -------------------------------------------------------------------------------- /fortune-mod/datfiles/off/unrotated/art: -------------------------------------------------------------------------------- 1 | X-rated movies are all alike ... the only thing they leave to the 2 | imagination is the plot. 3 | % 4 | Hamburg was fantastic. Between the whores and the groupies our dicks 5 | all just about dropped off. 6 | -- John Lennon, on the Beatles' early career in Germany 7 | -------------------------------------------------------------------------------- /fortune-mod/datfiles/off/unrotated/cookie: -------------------------------------------------------------------------------- 1 | Shit Happens. 2 | % 3 | -------------------------------------------------------------------------------- /fortune-mod/datfiles/off/unrotated/debian: -------------------------------------------------------------------------------- 1 | < Overfiend> well, excellent. I get to tear someone a new asshole. 2 | -- in #debian-devel 3 | % 4 | < calc> dondelelcaro: there is free sex in the archive iirc 5 | < liw> I maintain sex, yes 6 | < liw> I'm the upstream of sex 7 | < dondelelcaro> liw: and the downstream as well? wow. 8 | < jbailey> I'd hate to be upstream of sex. 9 | < jbailey> You'd never get any. 10 | < liw> jbailey, but giving is so much better than getting :) 11 | -- in #debian-devel 12 | % 13 | < Overfiend> MFen: but if you have the awesome manliness to cleanly 14 | implement this missing feature, it will probably be 15 | accepted. 16 | < Overfiend> you'd be so manly you'd have to rent a wheelbarrow to cart 17 | your balls around 18 | -- in #debian-devel 19 | % 20 | * Overfiend whacks one of the TODO items off the list 21 | < joshk> whacking something else now? 22 | < Overfiend> in a manner of speaking :) 23 | -- in #debian-devel 24 | % 25 | iDunno: anyhow, tbm fits the description of an alug user 26 | he uses linux and is based in East Anglia :) 27 | "he uses linux". I run the Debian project, for fucks sake! :-P 28 | % 29 | < asuffield> 125 should logically be... hmm... function key 20 30 | < asuffield> which is like.. the fuck? 31 | < Overfiend> a long penis sticking out of the right side of the keyboard 32 | -- in #debian-devel 33 | % 34 | To: 35 | My manhood is not usually enlarged by men only. Such 36 | enlargement often involves women. 37 | -- in #debian-devel 38 | % 39 | moshez: This is finland. You don't need to say anything to 40 | shop at the supermarket :) 41 | You need to know what they mean when the cute checkout girl 42 | asks if you want pussy. 43 | That's all. 44 | dark: is this a particularly common problem? 45 | asuffield: Yes :) The word for shopping bags sounds like that. 46 | -- in #debian-devel 47 | % 48 | the himilayan rat aparantly doesn't relise humping an allready 49 | pregnant female rat gets him nowhere but a bitemark on the leg. 50 | * Sir_Ahzz separates the rats. 51 | -- in #debian-devel 52 | % 53 | apt sex 54 | sex is probably updatedb; locate; talk; date; cd; unzip; strip; look; 55 | touch; finger; head; mount; fsck; more; yes; yes; umount; make clean; 56 | sleep 57 | is there a female equivalent of that command line? 58 | RST2003: sleep :) 59 | -- in #debian 60 | % 61 | don't you people have something better to do than stare at 62 | females you will never even meet? 63 | asuffield: never say never 64 | asuffield: I don't keep this chloroform-soaked rag in my 65 | pocket for NOTHING 66 | -- in #debian-devel 67 | % 68 | OW OW OW OW OW, jesus CHRIST. We're supposed to be FROZEN 69 | and our LIBC and BINUTILS are maintained by CVS ADDICTS 70 | whose LEFT HAND is SUPERGLUED to their DICKS 71 | "*PANT* *PANT* YEAH BABY!!!! FRESH COMMITS TO CVS!!!!" 72 | *PANT* *PANT* 73 | -- in #debian-devel 74 | % 75 | < ari> why did gimp fail to build on amd64? 76 | < nickr> because you touch yourself at night 77 | < ari> how did you know :( 78 | % 79 | No, I'd rather look for porn. 80 | 81 | -- Debian Project Leader Martin Michlmayr, when asked to do some 82 | real work 83 | % 84 | < ore> God uses GNOME? 85 | < joshk> no wonder it rains so often 86 | < ore> "Dammit, those damn heaven's gates won't open, gconfd crashed 87 | again" 88 | -- in #debian-devel 89 | % 90 | I'm a pope-worshipper, so I don't feel bound by your standards. 91 | * seeeS thought it said vorlon was a pppoe worshipper 92 | -- in #debian-devel 93 | % 94 | < keta> woah, I've been out for a week, a new stable release, a processor 95 | on my laptop that will soon be abandoned, if i had had a girlfriend 96 | I'll surely would have found her pregnant on my return 97 | -- in #debian-devel, following the release of Sarge (3.1r0) 98 | % 99 | what the fuck is this code doing? 100 | spray_min = SPRAYMAX+1; 101 | mdz_: spraying 102 | asuffield: sucking 103 | % 104 | "Hi, I'm too fucking stupid to understand a 15-year old 105 | RFC, so please file a proper bug report on punched cards. 106 | Thanks." 107 | % 108 | * Overfiend prefers girls who have developed, and DON'T FUCKING **GIGGLE** 109 | % 110 | I ought to perpetrate some sabotage to underscore my point 111 | and trash the 0x60 codepoint in all the xfonts-base fonts. 112 | bwa hahahahaha 113 | bwahahahahahahaha 114 | MOO)HAHAHAHAHA 115 | YES THIS IS AN EXCELLENT IDEA 116 | I OUGHT TO MAKE IT AN INVERSE, UPSIDE DOWN QUESTION MARK 117 | BWAHAHAHAHAHAHHA 118 | MOOOOOAHAHAHAHAHA 119 | --- Overfiend is now known as PUREFUCKINGEVIL 120 | BWAHAHAHAHA 121 | 122 | -- Branden 'Overfiend' Robinson, on the subject of 123 | people using `mismatched' quotes 124 | % 125 | i'm glad Debian finally got into 126 | polar-deep-freeze-we-arent-shitting-you state finally. 127 | -- Seen on #Debian shortly before the release of Debian 2.0 128 | -------------------------------------------------------------------------------- /fortune-mod/datfiles/off/unrotated/fortunes: -------------------------------------------------------------------------------- 1 | Obviously the only rational solution to your problem is suicide. 2 | % 3 | You will be dead within a year. 4 | % 5 | -------------------------------------------------------------------------------- /fortune-mod/datfiles/off/unrotated/knghtbrd: -------------------------------------------------------------------------------- 1 | red dye causes cancer, haven't you heard? (; 2 | fucking everything causes cancer, haven't you heard? 3 | => 4 | no, that causes aids 5 | % 6 | Europe Passes Pro-spam Law 7 | I though only Americans were that fucking stupid => 8 | apparently americans are quite naive :) 9 | % 10 | // Minor lesson: don't fuck about with something you don't fully understand 11 | -- the dosdoom source code 12 | % 13 | "I am ecstatic that some moron re-invented a 1995 windows fuckup." 14 | -- Alan Cox 15 | % 16 | Exactly how much of a PITA is this in C? 17 | It's written in C++. 18 | Hence my question. 19 | I could do something like it in C. Anyone who saw the results 20 | would think I was either a genius or out of my fucking mind. 21 | They'd be right on either count. 22 | % 23 | *sigh* My todo list is like the fucking energizer bunny 24 | It keeps growing and growing and growing and ... 25 | % 26 | It is when the example source won't compile ... 27 | <``Erik> then you fucked something up 28 | Nope, I followed their instructions 29 | <``Erik> that may've been your problem :} 30 | % 31 | that's *IT*. I'm never fucking attempting to install redhat 32 | again. 33 | this is like the 10th fucking machine on which the installer has 34 | imploded immediately after I went through the hell of their 35 | package selection process. 36 | Sammy: just use debian and never look back 37 | timball: debian iso's are being written at this very moment. 38 | % 39 | these stupid head hunters want resumes in ms word format 40 | can you write shit in tex and convert it to word? 41 | \converttoword{shit} 42 | % 43 | who gives a shit about US law 44 | anyone living in the US. 45 | % 46 | this is college course in formal logic 47 | knghtbrd: i hate that shit, much prefer fuzzy logic :) 48 | kev: fuzzy logic tickles. 49 | knghtbrd: lol 50 | knghtbrd: fuzzy logic is so cool, it models the world really well 51 | % 52 | * knghtbrd ponders how to scare the living shit out of 87 people at once.. 53 | AHH! I can do it in 3 words!: 54 | Microsoft Visual COBOL. 55 | % 56 | linux takes shit and turns it into something useful. 57 | windows takes something useful and turns it into shit 58 | % 59 | Fuck, I can't compile the damn thing and I wrote it ! 60 | -------------------------------------------------------------------------------- /fortune-mod/datfiles/off/unrotated/linux: -------------------------------------------------------------------------------- 1 | A word to the wise: a credentials dicksize war is usually a bad idea 2 | on the net. 3 | -- David Parsons in c.o.l.development.system, about coding in C 4 | % 5 | What's this script do? 6 | unzip ; touch ; finger ; mount ; gasp ; yes ; umount ; sleep 7 | Hint for the answer: not everything is computer-oriented. Sometimes you're 8 | in a sleeping bag, camping out with your girlfriend. 9 | -- Contributed by Frans van der Zande 10 | % 11 | You can see that there are 25 unread articles in `news.announce.newusers'. 12 | There are no unread articles, but some ticked articles, in 13 | `alt.fan.andrea-dworkin' (see that little asterisk at the beginning of the 14 | line?) 15 | 16 | You can fuck that up to your heart's delight by fiddling with the 17 | `gnus-group-line-format' variable. 18 | -- From the (ding) Gnus 5 documentation, by Lars Magne Ingebrigtsen 19 | % 20 | printk("ufs_read_super: fucking Sun blows me\n"); 21 | -- /usr/src/linux/fs/ufs/ufs_super.c 22 | % 23 | KDE == (see GayDE) Kool Desktop Environment - Make X Window look like 24 | winbloze... 25 | 26 | What a fucking great idea! The developers of this have a mental sickness, 27 | please avoid this product -> see GNOME. 28 | -- Jakes on #Debian 29 | % 30 | "Oxford University has joined with IBM and the UK 31 | Government to build a sophisticated computing Grid based 32 | on the open standards of Linux that will enable early 33 | screening and diagnosis of breast cancer...." Press 34 | release within. 35 | In gratitude, the women of the world should all let Linux 36 | developers fondle their breasts, and the lactating ones 37 | should permit developers to drink. 38 | % 39 | 'Mounting' is used for three things: climbing on a horse, linking in a 40 | hard disk unit in data systems, and, well, mounting during sex. 41 | -- Christa Keil 42 | % 43 | This is a scsi driver, scraes the shit out of me, therefore I tapdanced 44 | and wrote a unix clone around it (C) by linus 45 | -- Somewhere in the kernel tree 46 | % 47 | > No manual is ever necessary. 48 | May I politely interject here: BULLSHIT. That's the biggest Apple lie of all! 49 | -- Discussion in comp.os.linux.misc on the intuitiveness of interfaces 50 | % 51 | -------------------------------------------------------------------------------- /fortune-mod/datfiles/off/unrotated/misandry: -------------------------------------------------------------------------------- 1 | A male gynecologist is like an auto mechanic who has never owned a car. 2 | -- Carrie Snow 3 | % 4 | A male mathematician is someone who can count to twenty-one without 5 | unzipping his fly. 6 | % 7 | A man without a woman is like a fish without gills. 8 | % 9 | A woman's a woman until the day she dies, but a man's only a man as long 10 | as he can. 11 | -- Moms Mabley 12 | % 13 | Being a woman is a terribly difficult trade, since it consists principally 14 | of dealings with men. 15 | -- Conrad 16 | % 17 | Does he treat your breasts like unripe grapefruit? Who needs him? 18 | -- `J', "The Sensuous Woman" 19 | % 20 | Don't accept rides from strange men -- and remember that all men are strange 21 | as hell. 22 | -- Robin Morgan, "Sisterhood Is Powerful" 23 | % 24 | If men could get pregnant, abortion would be a sacrament. 25 | % 26 | If men couldn't fuck there'd be a bounty on their heads. 27 | % 28 | If they sent one man to the moon, why can't they send them all? 29 | % 30 | If you catch a man, throw him back. 31 | -- Woman's Liberation Slogan, c. 1975 32 | % 33 | Lysistrata had a good idea. 34 | % 35 | Men -- can't live with 'em, can't leave 'em by the curb when you're done. 36 | % 37 | Men will fuck mud. 38 | -- Lenny Bruce 39 | % 40 | Most men would never get laid if it weren't for the pity fuck. 41 | % 42 | The only one of your children who does not grow up and move away 43 | is your husband. 44 | % 45 | The sex life of spiders is very interesting. 46 | He fucks her. 47 | She bites his head off. 48 | -- From a Women's Lib Poster 49 | % 50 | There are three women on the fast track in a particular company. The 51 | president realizes it's time to promote one of them, but they're all so 52 | competent that he's not sure which one to choose. So he devises a little 53 | test. One day while they're all at lunch, he places $500 on each of their 54 | desks. #1 returns it to him immediately. #2 pockets it. #3 invests 55 | in the market and returns $1,500 to him in the morning. Who gets the 56 | promotion? The one with the big tits! 57 | % 58 | Upon leaving a hotel bar one evening, an executive noticed a drunk sitting 59 | on the edge of a potted palm in the lobby, crying like a baby. Because he'd 60 | had a couple himself that night, and was feeling rather sorry for his fellow 61 | man, he asked the inebriated one what the trouble was. 62 | "I did a terrible thing tonight," sniffled the drunk. "I sold my 63 | wife to a guy for a bottle of Scotch." 64 | "That is terrible," said the man, too much under the weather to 65 | muster any real indignation. "And now that she's gone, you wish you had her 66 | back." 67 | "Thas right," said the drunk, still sniffling. 68 | "You're sorry you sold her, because you realize too late that you 69 | love her," sympathized the executive. 70 | "No, no," said the drunk. "I wish I had her back because I'm 71 | thirsty again." 72 | % 73 | War is menstruation envy. 74 | % 75 | When God created man, She was only testing. 76 | % 77 | You know the Norplant thing? It's a new birth control device for women. 78 | It's a cartridge, that goes in your arm. Well, they're coming out with 79 | a new one for men: it's a brain, that goes in your head. 80 | % 81 | Beware of the man who denounces women writers; his penis is tiny and he 82 | cannot spell. 83 | -- Erica Jong 84 | % 85 | -------------------------------------------------------------------------------- /fortune-mod/datfiles/off/unrotated/racism: -------------------------------------------------------------------------------- 1 | A racially integrated community is a chronological term timed from the 2 | entrance of the first black family to the exit of the last white family. 3 | -- Saul Alinsky 4 | % 5 | They don't suffer. They can't even speak English. 6 | -- George F. Baer, answering a reporter's 7 | question about the suffering of starving miners. 8 | % 9 | We are giving instruction to FBI agents in the various Chinese 10 | dialects ... to handle present and likely future contingencies. 11 | -- J. Edgar Hoover 12 | % 13 | The whole white race is a monster who is always hungry, and what he 14 | eats is land. Chiksika, (Shawnee) 15 | % 16 | -------------------------------------------------------------------------------- /fortune-mod/datfiles/off/unrotated/zippy: -------------------------------------------------------------------------------- 1 | Do you guys know we just passed through a BLACK HOLE in space? 2 | % 3 | I don't know WHY I said that ... I think it came from the FILLINGS in 4 | my read molars ... 5 | % 6 | Our father who art in heaven ... I sincerely pray that SOMEBODY at this 7 | table will PAY for my SHREDDED WHEAT and ENGLISH MUFFIN ... and also 8 | leave a GENEROUS TIP .... 9 | % 10 | -------------------------------------------------------------------------------- /fortune-mod/datfiles/paradoxum: -------------------------------------------------------------------------------- 1 | A little pain never hurt anyone. 2 | % 3 | "A unified, neutral Germany? Given that nation's heritage, such a 4 | phrase may prove to be the oxymoron of the decade." -Kevin M. 5 | Matarese, Fulda, West Germany; as seen in "Letters", Time 6 | magazine, p. 5, March 5, 1990. 7 | % 8 | A verbal contract isn't worth the paper it's written on. Include 9 | me out. -Samuel Goldwyn 10 | % 11 | Christ was born in 4 B.C. 12 | % 13 | Cum tacent, clamant. When they are silent, they shout. -Cicero 14 | % 15 | Gentlemen, I want you to know that I am not always right, but I am 16 | never wrong. -Samuel Goldwyn 17 | % 18 | Goes (Went) over like a lead balloon. 19 | % 20 | Honk if you are against noise pollution! 21 | % 22 | I'll give you a definite maybe. -Samuel Goldwyn 23 | % 24 | I'm not going to say, "I told you so." 25 | % 26 | I am a deeply superficial person. -Andy Warhol 27 | % 28 | I'm proud of my humility. 29 | % 30 | I can resist everything except temptation. -Oscar Wilde 31 | % 32 | If Roosevelt were alive, he'd turn over in his grave. -Samuel 33 | Goldwyn 34 | % 35 | If you fall and break your legs, don't come running to me. -Samuel 36 | Goldwyn 37 | % 38 | I never put on a pair of shoes until I've worn them five years. 39 | -- Samuel Goldwyn 40 | % 41 | It isn't an optical illusion. It just looks like one. 42 | % 43 | It's more than magnificent-it's mediocre. -Samuel Goldwyn 44 | % 45 | May I ask a question? 46 | % 47 | No one goes to that restaurant anymore-it's always too crowded. 48 | (attributed to Yogi Berra) 49 | % 50 | Our comedies are not to be laughed at. -Samuel Goldwyn 51 | % 52 | Parting is such sweet sorrow. -William Shakespeare 53 | % 54 | Procrastination means never having to say you're sorry. 55 | % 56 | "Professional certification for car people may sound like an 57 | oxymoron." -The Wall Street Journal, page B1, Tuesday, July 17, 58 | 1990. 59 | % 60 | Referring to a book: I read part of it all the way through. 61 | -- Samuel Goldwyn 62 | % 63 | Smoking is the leading cause of statistics. 64 | % 65 | Some bachelors want a meaningful overnight relationship. 66 | % 67 | Talking about a piece of movie dialogue: Let's have some new 68 | cliches. -Samuel Goldwyn 69 | % 70 | The scene is dull. Tell him to put more life into his dying. 71 | -- Samuel Goldwyn 72 | % 73 | Thank God I'm an atheist. 74 | % 75 | This report is filled with omissions. 76 | % 77 | We are not anticipating any emergencies. 78 | % 79 | We're overpaying him, but he's worth it. -Samuel Goldwyn 80 | % 81 | His honour rooted in dishonour stood, 82 | And faith unfaithful kept him falsely true. 83 | -- Alfred Lord Tennyson 84 | % 85 | The good oxymoron, to define it by a self-illustration, must be a 86 | planned inadvertency. -Wilson Follett 87 | % 88 | An Irishman is never at peace except when he's fighting. 89 | % 90 | I marvel at the strength of human weakness. 91 | % 92 | Always be sincere, even when you don't mean it. -Irene Peter 93 | % 94 | Live within your income, even if you have to borrow to do so. 95 | -- Josh Billings 96 | % 97 | Of course I can keep secrets. It's the people I tell them to that 98 | can't keep them. -Anthony Haden-Guest 99 | % 100 | The best cure for insomnia is to get a lot of sleep. -W. C. Fields 101 | % 102 | I distinctly remember forgetting that. -Clara Barton 103 | % 104 | We must believe in free will. We have no choice. -Isaac B. Singer 105 | % 106 | Monotheism is a gift from the gods. 107 | % 108 | After they got rid of capital punishment, they had to hang twice 109 | as many people as before. 110 | % 111 | I never liked you, and I always will. -Samuel Goldwyn 112 | % 113 | Why don't you pair `em up in threes? -Yogi Berra 114 | % 115 | Our similarities are different. -Dale Berra, son of Yogi 116 | % 117 | After Donald Trump's stretch limousine was stolen and found 118 | undamaged a few blocks away; he said, "Nothing was stolen. I had 119 | an honest thief."-International Herald Tribune, page 3, March 2, 120 | 1992 121 | % 122 | Some bird populations soaring down 123 | -Headline of an article in 124 | Science News, page 126, February 20, 1993. 125 | % 126 | Most bacteria have the decency to be microscopic. Epulopiscium 127 | fishelsoni is not among them. The newly identified one-celled 128 | macro-microorganism is a full .5 mm long, large enough to be seen 129 | with the naked eye. Described in the current Nature, "It is a 130 | million times as massive as a typical bacterium."-Time, page 25, 131 | March 29, 1993 132 | % 133 | "Triumph without Victory, The Unreported History of the Persian 134 | Gulf War", -Headline published in the U.S. News & World Report, 135 | 1992. 136 | % 137 | An empty cab drove up and Sarah Bernhardt got out. -Arthur Baer, 138 | American comic and columnist 139 | % 140 | She used to diet on any kind of food she could lay her hands on. 141 | -- Arthur Baer, American comic and columnist 142 | % 143 | The first condition of immortality is death. -Stanislaw Lec 144 | % 145 | As famous as the unknown soldier. 146 | % 147 | I must follow the people. Am I not their leader? -Benjamin Disraeli 148 | % 149 | Hegel was right when he said that we learn from history that man 150 | can never learn anything from history. -George Bernard Shaw 151 | % 152 | William Safire's rules for writing as seen in the New York Times 153 | 154 | Do not put statements in the negative form. 155 | And don't start sentences with a conjunction. 156 | If you reread your work, you will find on rereading that a great 157 | deal of repetition can be avoided by rereading and editing. 158 | Never use a long word when a diminutive one will do. 159 | Unqualified superlatives are the worst of all. 160 | If any word is improper at the end of a sentence, a linking verb is. 161 | Avoid trendy locutions that sound flaky. 162 | Never, ever use repetitive redundancies. 163 | Also, avoid awkward or affected alliteration. 164 | Last, but not least, avoid cliches like the plague. 165 | % 166 | Everyone writes on the walls except me. -Said to be graffiti seen in Pompeii 167 | % 168 | I tripped over a hole that was sticking up out of the ground. 169 | % 170 | I don't think anyone should write their autobiography until after 171 | they're dead. -Samuel Goldwyn 172 | % 173 | This page intentionally left blank. 174 | % 175 | Evil isn't all bad. 176 | % 177 | I disagree with unanimity. 178 | % 179 | "It's a step forward although there was no progress." 180 | President Hosni Murbarak of Egypt attempting to put the best face 181 | on a disappointing summit meeting between President Clinton and 182 | the Syrian dictator Hafez Assad. 183 | % 184 | "I always avoid prophesying beforehand because it is much better 185 | to prophesy after the event has already taken place. " - Winston 186 | Churchill 187 | % 188 | All truths are true to an extend, including this one. -XA 189 | % 190 | Assume a virtue, if you have it not. -William Shakespeare 191 | % 192 | All generalisations are dangerous, including this one. 193 | % 194 | -------------------------------------------------------------------------------- /fortune-mod/datfiles/pets: -------------------------------------------------------------------------------- 1 | A door is what a dog is perpetually on the wrong side of. 2 | -- Ogden Nash 3 | % 4 | A little dog goes into a saloon in the Wild West, and beckons to 5 | the bartender. "Hey, bartender, gimme a whiskey." 6 | The bartender ignores him. 7 | "Hey bartender, gimme a whiskey!" 8 | Still ignored. 9 | "HEY BARMAN!! GIMME A WHISKEY!!" 10 | The bartender takes out his six-shooter and shoots the dog in the 11 | leg, and the dog runs out the saloon, howling in pain. 12 | Three years later, the wee dog appears again, wearing boots, 13 | jeans, chaps, a Stetson, gun belt, and guns. He ambles slowly into the 14 | saloon, goes up to the bar, leans over it, and says to the bartender, 15 | "I'm here t'git the man that shot muh paw." 16 | % 17 | About the only thing on a farm that has an easy time is the dog. 18 | % 19 | All intelligent species own cats. 20 | % 21 | Any Member introducing or causing to be introduced a dog into the Society's 22 | premises shall be liable to a fine of £5 inflicted by the Treasurer. Any animal 23 | leading a blind person shall be deemed to be a cat. Any animal entering on 24 | Police business shall be deemed to be a wombat. 25 | -- Rule 51, Oxford Union Society 26 | % 27 | Anyone who considers protocol unimportant has never dealt with a cat. 28 | -- R. Heinlein 29 | % 30 | "Anything else you wish to draw to my attention, Mr. Holmes ?" 31 | "The curious incident of the stable dog in the nighttime." 32 | "But the dog did nothing in the nighttime." 33 | "That was the curious incident." 34 | -- A. Conan Doyle, "Silver Blaze" 35 | % 36 | Auribus teneo lupum. 37 | [I hold a wolf by the ears.] 38 | [Boy, it *sounds* good. But what does it *mean*?] 39 | % 40 | Breeding rabbits is a hare raising experience. 41 | % 42 | Cats are intended to teach us that not everything in nature has a function. 43 | -- Garrison Keillor 44 | % 45 | Cats are smarter than dogs. You can't make eight cats pull a sled through 46 | the snow. 47 | % 48 | Cats, no less liquid than their shadows, offer no angles to the wind. 49 | % 50 | Chihuahuas drive me crazy. I can't stand anything that shivers when it's warm. 51 | % 52 | "Contrary to popular belief, penguins are not the salvation of modern 53 | technology. Neither do they throw parties for the urban proletariat." 54 | % 55 | Did you ever walk into a room and forget why you walked in? I think 56 | that's how dogs spend their lives. 57 | -- Sue Murphy 58 | % 59 | Does the name Pavlov ring a bell? 60 | % 61 | Dogs just don't seem to be able to tell the difference between important people 62 | and the rest of us. 63 | % 64 | Everyone *knows* cats are on a higher level of existence. These silly humans 65 | are just too big-headed to admit their inferiority. 66 | Just think what a nicer world this would be if it were controlled by 67 | cats. 68 | You wouldn't see cats having waste disposal problems. 69 | They're neat. 70 | They don't have sexual hangups. A cat gets horny, it does something 71 | about it. 72 | They keep reasonable hours. You *never* see a cat up before noon. 73 | They know how to relax. Ever heard of a cat with an ulcer? 74 | What are the chances of a cat starting a nuclear war? Pretty negligible. 75 | It's not that they can't, they just know that there are much better things to 76 | do with ones time. Like lie in the sun and sleep. Or go exploring the world. 77 | % 78 | For a man to truly understand rejection, he must first be ignored by a cat. 79 | % 80 | Hi! You have reached 555-0129. None of us are here to answer the phone and 81 | the cat doesn't have opposing thumbs, so his messages are illegible. Please 82 | leave your name and message after the beep... 83 | % 84 | I loathe people who keep dogs. They are cowards who haven't got the guts 85 | to bite people themselves. 86 | -- August Strindberg 87 | % 88 | I love dogs, but I hate Chihuahuas. A Chihuahua isn't a dog. It's a rat 89 | with a thyroid problem. 90 | % 91 | If a can of Alpo costs 38 cents, would it cost $2.50 in Dog Dollars? 92 | % 93 | If anyone has seen my dog, please contact me at x2883 as soon as possible. 94 | We're offering a substantial reward. He's a sable collie, with three legs, 95 | blind in his left eye, is missing part of his right ear and the tip of his 96 | tail. He's been recently fixed. Answers to "Lucky". 97 | % 98 | If you are a police dog, where's your badge? 99 | -- Question James Thurber used to drive his German Shepherd 100 | crazy. 101 | % 102 | "If you don't want your dog to have bad breath, do what I do: Pour a little 103 | Lavoris in the toilet." 104 | -- Jay Leno 105 | % 106 | If you have received a letter inviting you to speak at the dedication of a 107 | new cat hospital, and you hate cats, your reply, declining the invitation, 108 | does not necessarily have to cover the full range of your emotions. You must 109 | make it clear that you will not attend, but you do not have to let fly at cats. 110 | The writer of the letter asked a civil question; attack cats, then, only if 111 | you can do so with good humor, good taste, and in such a way that your answer 112 | will be courteous as well as responsive. Since you are out of sympathy with 113 | cats, you may quite properly give this as a reason for not appearing at the 114 | dedication ceremonies of a cat hospital. But bear in mind that your opinion 115 | of cats was not sought, only your services as a speaker. Try to keep things 116 | straight. 117 | -- Strunk and White, "The Elements of Style" 118 | % 119 | In the eyes of my dog, I'm a man. 120 | -- Martin Mull 121 | % 122 | It is not a good omen when goldfish commit suicide. 123 | % 124 | It was Penguin lust... at its ugliest. 125 | % 126 | It's no use crying over spilt milk -- it only makes it salty for the cat. 127 | % 128 | Lost: gray and white female cat. Answers to electric can opener. 129 | % 130 | Never try to outstubborn a cat. 131 | -- Lazarus Long, "Time Enough for Love" 132 | % 133 | No animal should ever jump on the dining room furniture unless 134 | absolutely certain he can hold his own in conversation. 135 | -- Fran Lebowitz 136 | % 137 | No one can feel as helpless as the owner of a sick goldfish. 138 | % 139 | PENGUINICITY!! 140 | % 141 | Raising pet electric eels is gaining a lot of current popularity. 142 | % 143 | "Shelter," what a nice name for for a place where you polish your cat. 144 | % 145 | Some books are to be tasted, others to be swallowed, and some few to be 146 | chewed and digested. 147 | -- Francis Bacon 148 | [As anyone who has ever owned a puppy already knows. Ed.] 149 | % 150 | Sometimes when I get up in the morning, I feel very peculiar. I feel 151 | like I've just got to bite a cat! I feel like if I don't bite a cat 152 | before sundown, I'll go crazy! But then I just take a deep breath and 153 | forget about it. That's what is known as real maturity. 154 | -- Snoopy 155 | % 156 | Speaking of purchasing a dog, never buy a watchdog that's on sale. 157 | After all, everyone knows a bargain dog never bites! 158 | % 159 | The difference between dogs and cats is that dogs come when they're 160 | called. Cats take a message and get back to you. 161 | % 162 | The main problem I have with cats is, they're not dogs. 163 | -- Kevin Cowherd 164 | % 165 | The only time a dog gets complimented is when he doesn't do anything. 166 | -- C. Schulz 167 | % 168 | There are many intelligent species in the universe, and they all own cats. 169 | % 170 | There's no use in having a dog and doing your own barking. 171 | % 172 | To err is human, 173 | To purr feline. 174 | -- Robert Byrne 175 | % 176 | When man calls an animal "vicious", he usually means that it will attempt 177 | to defend itself when he tries to kill it. 178 | % 179 | When the fog came in on little cat feet last night, it left these little 180 | muddy paw prints on the hood of my car. 181 | % 182 | Who loves me will also love my dog. 183 | -- John Donne 184 | % 185 | With a rubber duck, one's never alone. 186 | -- "The Hitchhiker's Guide to the Galaxy" 187 | % 188 | -------------------------------------------------------------------------------- /fortune-mod/datfiles/pratchett: -------------------------------------------------------------------------------- 1 | He hated being thought of as one of those people that wore stupid 2 | ornamental armour. It was gilt by association. 3 | -- Terry Pratchett, "Night Watch" 4 | % 5 | The Assassin moved quietly from roof to roof until he was well away from 6 | the excitement around the Watch House. His movements could be called 7 | cat-like, except that he did not stop to spray urine up against things. 8 | -- Terry Pratchett, "Night Watch" 9 | % 10 | "THERE'S NO JUSTICE. THERE'S JUST ME." 11 | -- Death in Terry Pratchett's https://en.wikipedia.org/wiki/Mort 12 | % 13 | -------------------------------------------------------------------------------- /fortune-mod/datfiles/the-x-files-taglines: -------------------------------------------------------------------------------- 1 | Trust No One 2 | -- The X-Files, Season 1, Episode 24, "The Erlenmeyer Flask" 3 | % 4 | Deny Everything 5 | -- The X-Files, Season 2, Episode 6, "Ascension" 6 | % 7 | 'éí 'aaníígÓÓ 'áhoot'é' 8 | ("The truth is far from here" in Navajo) 9 | -- The X-Files, Season 2, Episode 25, "Anasazi" 10 | % 11 | Apology is Policy 12 | -- The X-Files, Season 3, Episode 10, "731" 13 | % 14 | Everything Dies 15 | -- The X-Files, Season 4, Episode 1, "Herrenvolk" 16 | % 17 | Deceive Inveigle Obfuscate 18 | -- The X-Files, Season 4, Episode 3, "Teliko" 19 | % 20 | E pur si muove. 21 | ("And still it moves" in Italian, a quote attributed to Galileo) 22 | -- The X-Files, Season 4, Episode 9, "Terma" 23 | % 24 | Believe the Lie 25 | -- The X-Files, Season 4, Episode 24, "Gethsemane" 26 | % 27 | All Lies Lead to the Truth 28 | -- The X-Files, Season 5, Episode 1, "Redux" 29 | % 30 | Resist or Serve 31 | -- The X-Files, Season 5, Episode 14, "The Red and the Black" 32 | % 33 | The End 34 | -- The X-Files, Season 5, Episode 20, "The End" 35 | % 36 | Die Wahrheit ist irgendwo da draußen 37 | ("The truth is out there somewhere" in German) 38 | -- The X-Files, Season 6, Episode 3, "Triangle" 39 | % 40 | In the Big Inning 41 | -- The X-Files, Season 6, Episode 19, "The Unnatural" 42 | % 43 | Amor Fati 44 | ("Love of fate" in Latin) 45 | -- The X-Files, Season 7, Episode 2, "The Sixth Extinction II: Amor Fati" 46 | % 47 | Believe to Understand 48 | -- The X-Files, Season 7, Episode 11, "Closure" 49 | % 50 | Nothing Important Happened Today 51 | -- The X-Files, Season 9, Episode 2, "Nothing Important Happened Today II" 52 | % 53 | erehT tuO si hturT ehT 54 | ("The Truth is Out There", backwards) 55 | -- The X-Files, Season 9, Episode 4, "4-D" 56 | % 57 | They're Watching 58 | -- The X-Files, Season 9, Episode 6, "Trust No 1" 59 | % 60 | Dio ti ama 61 | ("God loves you" in Italian) 62 | -- The X-Files, Season 9, Episode 13, "Improbable" 63 | % 64 | This Is The End 65 | -- The X-Files, Season 10, Episode 6, "My Struggle II" 66 | % 67 | I Want to Believe, I Want to Lie 68 | -- The X-Files, Season 11, Episode 1, "My Struggle III" 69 | % 70 | Accuse Your Enemies of That Which You are Guilty 71 | -- The X-Files, Season 11, Episode 2, "This" 72 | % 73 | You See What I Want You to See 74 | -- The X-Files, Season 11, Episode 5, "Ghouli" 75 | % 76 | A War Is Never Over 77 | -- The X-Files, Season 11, Episode 6, "Kitten" 78 | % 79 | VGhlIFRydXRoIGlzIE91dCBUaGVyZQ== 80 | ("The Truth Is Out There" in Base64) 81 | -- The X-Files, Season 11, Episode 7, Rm9sbG93ZXJz 82 | % 83 | -------------------------------------------------------------------------------- /fortune-mod/datfiles/translate-me: -------------------------------------------------------------------------------- 1 | A fellow bought a new car, a Nissan, and was quite happy with his purchase. 2 | He was something of an animist, however, and felt that the car really ought 3 | to have a name. This presented a problem, as he was not sure if the name 4 | should be masculine or feminine. 5 | After considerable thought, he settled on an naming the car either 6 | Belchazar or Beaumadine, but remained in a quandry about the final choice. 7 | "Is a Nissan male or female?" he began asking his friends. Most of 8 | them looked at him peculiarly, mumbled things about urgent appointments, and 9 | went on their way rather quickly. 10 | He finally broached the question to a lady he knew who held a black 11 | belt in judo. She thought for a moment and answered "Feminine." 12 | The swiftness of her response puzzled him. "You're sure of that?" he 13 | asked. 14 | "Certainly," she replied. "They wouldn't sell very well if they were 15 | masculine." 16 | "Unhhh... Well, why not?" 17 | "Because people want a car with a reputation for going when you want 18 | it to. And, if Nissan's are female, it's like they say... `Each Nissan, she 19 | go!'" 20 | 21 | [No, we WON'T explain it; go ask someone who practices an oriental 22 | martial art. (Tai Chi Chuan probably doesn't count.) Ed.] 23 | % 24 | Aliquid melius quam pessimum optimum non est. 25 | % 26 | Ego sum ens omnipotens. 27 | % 28 | Hodie natus est radici frater. 29 | 30 | [ Unto the root is born a brother ] 31 | % 32 | Honi soit la vache qui rit. 33 | % 34 | Klatu barada nikto. 35 | % 36 | Mieux vaut tard que jamais! 37 | 38 | [ Better late than never ] 39 | % 40 | Quid me anxius sum? 41 | 42 | [ What? Me, worry? ] 43 | % 44 | semper en excretus 45 | % 46 | SEMPER UBI SUB UBI!!!! 47 | 48 | [ Always wear underwear ] 49 | % 50 | sillema sillema nika su 51 | 52 | [ We don't know what it means either. See: 53 | https://github.com/shlomif/fortune-mod/issues/95 . ] 54 | % 55 | Tout choses sont dites deja, mais comme personne n'ecoute, il faut 56 | toujours recommencer. 57 | -- A. Gide 58 | 59 | [ All things have already been said, but since no one listens, one 60 | must always start again. ] 61 | % 62 | -------------------------------------------------------------------------------- /fortune-mod/fortune.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Version=1.1 3 | Type=Application 4 | Name=Fortune 5 | GenericName=Database of funny quotes 6 | Exec=sh -c 'fortune && echo && echo Press return to continue && read returnkey' 7 | Categories=Game;ConsoleOnly;Amusement; 8 | -------------------------------------------------------------------------------- /fortune-mod/fortune/process-fortune-man-template.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | use strict; 4 | use warnings; 5 | use autodie; 6 | 7 | sub _utf8_slurp 8 | { 9 | my $filename = shift; 10 | 11 | open my $in, '<:encoding(utf-8)', $filename 12 | or die "Cannot open '$filename' for slurping - $!"; 13 | 14 | local $/; 15 | my $contents = <$in>; 16 | 17 | close($in); 18 | 19 | return $contents; 20 | } 21 | 22 | use File::Basename qw / dirname /; 23 | use File::Path qw / mkpath /; 24 | use Getopt::Long qw/ GetOptions /; 25 | 26 | my $input_fn; 27 | my $output_fn; 28 | my $cookiedir; 29 | my $ocookiedir; 30 | my $no_offensive = 0; 31 | GetOptions( 32 | '--cookiedir=s' => \$cookiedir, 33 | '--ocookiedir=s' => \$ocookiedir, 34 | '--without-offensive!' => \$no_offensive, 35 | '--output=s' => \$output_fn, 36 | '--input=s' => \$input_fn, 37 | ) or die "Wrong options - $!"; 38 | 39 | if ( !defined($input_fn) ) 40 | { 41 | die "Please specify --input"; 42 | } 43 | if ( !defined($output_fn) ) 44 | { 45 | die "Please specify --output"; 46 | } 47 | 48 | if ( !defined($cookiedir) ) 49 | { 50 | die "Please specify cookiedir"; 51 | } 52 | 53 | my $OFF = ( !$no_offensive ); 54 | 55 | if ( $OFF and !defined($ocookiedir) ) 56 | { 57 | die "Please specify ocookiedir"; 58 | } 59 | 60 | my $dirname = dirname($output_fn); 61 | if ( $dirname and ( !-e $dirname ) ) 62 | { 63 | mkpath($dirname); 64 | } 65 | 66 | # The :raw is to prevent CRs on Win32/etc. 67 | open my $out, '>:encoding(utf-8)', $output_fn; 68 | my $text = _utf8_slurp($input_fn); 69 | 70 | if ( ( $text =~ s#\Q[[cookiedir_placeholder]]\E#${cookiedir}#gms ) > 1 ) 71 | { 72 | die "too many cookiedir_placeholder substitutions!"; 73 | } 74 | if ( ( $text =~ s#\Q[[ocookiedir_placeholder]]\E#${ocookiedir}#gms ) > 1 ) 75 | { 76 | die "too many ocookiedir_placeholder substitutions!"; 77 | } 78 | $out->print($text); 79 | close($out); 80 | -------------------------------------------------------------------------------- /fortune-mod/run-tests.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use File::Spec (); 7 | use Getopt::Long qw/ GetOptions /; 8 | 9 | my $src_dir; 10 | my $cookies_list_str; 11 | GetOptions( 12 | 'cookies=s' => \$cookies_list_str, 13 | 'src-dir=s' => \$src_dir, 14 | ) or die "could not parse options - $!"; 15 | 16 | if ( !defined($src_dir) ) 17 | { 18 | die "--src-dir was not defined"; 19 | } 20 | 21 | local $ENV{SRC_DIR} = File::Spec->rel2abs($src_dir); 22 | local $ENV{COOKIES} = $cookies_list_str; 23 | 24 | my $IS_WIN = ( $^O eq "MSWin32" ); 25 | 26 | sub do_system 27 | { 28 | my ($args) = @_; 29 | 30 | my $cmd = $args->{cmd}; 31 | print "Running [@$cmd]\n"; 32 | if ( system(@$cmd) ) 33 | { 34 | die "Running [@$cmd] failed!"; 35 | } 36 | } 37 | 38 | do_system( 39 | { 40 | cmd => [ $^X, "$src_dir/tests/scripts/split-valgrind.pl", ] 41 | } 42 | ); 43 | do_system( 44 | { 45 | cmd => [ 46 | 'prove', ( $IS_WIN ? ("-v") : () ), glob("$src_dir/tests/t/*.t") 47 | ] 48 | } 49 | ); 50 | -------------------------------------------------------------------------------- /fortune-mod/tests/data/valgrind.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use Test::More; 7 | use Test::RunValgrind (); 8 | 9 | if ( $^O eq "MSWin32" ) 10 | { 11 | plan skip_all => 'valgrind is not available on Windows'; 12 | } 13 | plan tests => 8; 14 | 15 | my $obj = Test::RunValgrind->new( {} ); 16 | 17 | # TEST 18 | $obj->run( 19 | { 20 | log_fn => './fortune--1.valgrind-log', 21 | prog => './fortune', 22 | argv => [qw//], 23 | blurb => 'fortune valgrind test', 24 | } 25 | ); 26 | 27 | # TEST 28 | $obj->run( 29 | { 30 | log_fn => './fortune--2-dash-f.valgrind-log', 31 | prog => './fortune', 32 | argv => [qw/-f/], 33 | blurb => 'fortune -f valgrind test', 34 | } 35 | ); 36 | 37 | # TEST 38 | $obj->run( 39 | { 40 | log_fn => './fortune--3-dash-m.valgrind-log', 41 | prog => './fortune', 42 | argv => [qw/-m foobarbazINGAMINGATONGALKIYRE/], 43 | blurb => 'fortune -m valgrind test', 44 | } 45 | ); 46 | 47 | # TEST 48 | $obj->run( 49 | { 50 | log_fn => './fortune--4-dash-m-i.valgrind-log', 51 | prog => './fortune', 52 | argv => [qw/-i -m foobarbazINGAMINGATONGALKIYRE/], 53 | blurb => 'fortune -i -m valgrind test', 54 | } 55 | ); 56 | 57 | # TEST*3 58 | foreach my $prog (qw/ strfile unstr randstr /) 59 | { 60 | $obj->run( 61 | { 62 | log_fn => "./fortune--$prog-buffer-overflow.valgrind-log", 63 | prog => "./$prog", 64 | argv => [ 65 | ( ( $prog eq "randstr" ) ? ("filler") : () ), 66 | scalar( "AAAAAAAAAAAAAAAA/" x 1000 ) 67 | ], 68 | blurb => "$prog buffer overflow test", 69 | } 70 | ); 71 | } 72 | 73 | # TEST 74 | foreach my $prog (qw/ unstr /) 75 | { 76 | $obj->run( 77 | { 78 | log_fn => "./fortune--$prog-buffer-overflow--extended.valgrind-log", 79 | prog => "./$prog", 80 | argv => [ 81 | scalar( "AAAAAAAAAAAAAAAA/" x 1000 ), 82 | scalar( "BBBBBBBBBBBBBBBB/" x 1000 ), 83 | scalar( "BBBBBBBBBBBBBBBB/" x 1000 ), 84 | scalar( "BBBBBBBBBBBBBBBB/" x 1000 ), 85 | ], 86 | blurb => "$prog buffer overflow two args test", 87 | } 88 | ); 89 | } 90 | 91 | __END__ 92 | 93 | =head1 COPYRIGHT & LICENSE 94 | 95 | Copyright 2020 by Shlomi Fish 96 | 97 | This program is distributed under the MIT / Expat License: 98 | L 99 | 100 | Permission is hereby granted, free of charge, to any person 101 | obtaining a copy of this software and associated documentation 102 | files (the "Software"), to deal in the Software without 103 | restriction, including without limitation the rights to use, 104 | copy, modify, merge, publish, distribute, sublicense, and/or sell 105 | copies of the Software, and to permit persons to whom the 106 | Software is furnished to do so, subject to the following 107 | conditions: 108 | 109 | The above copyright notice and this permission notice shall be 110 | included in all copies or substantial portions of the Software. 111 | 112 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 113 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 114 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 115 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 116 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 117 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 118 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 119 | OTHER DEALINGS IN THE SOFTWARE. 120 | 121 | =cut 122 | -------------------------------------------------------------------------------- /fortune-mod/tests/fortune-m-test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import glob 4 | import os 5 | import subprocess 6 | from os.path import join 7 | inst_dir = join(os.getcwd(), "fortune-m-INST_DIR") 8 | 9 | exe = glob.glob(join(inst_dir, "games", "fortune")+'*')[0] 10 | # subprocess.call(["objdump", "-p", exe]) 11 | rc = subprocess.call( 12 | [exe, "-m", "giants"], 13 | ) 14 | -------------------------------------------------------------------------------- /fortune-mod/tests/scripts/OLD-AND-UNUSED--check-fortune-file.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # WARNING!!! This script is no longer used. See 4 | # ../t/check-cookies.t instead. 5 | # 6 | # (Reference: https://github.com/shlomif/fortune-mod/pull/60 ) 7 | 8 | i="$1" 9 | shift 10 | 11 | echo -n "Testing \"$i\" ..." 12 | if ! tail -n 1 "$i" | grep -q '^%$' ; then 13 | echo " failed % check" 14 | echo "Fortune cookie file does not end in a single %" 15 | exit 1 16 | fi 17 | if egrep -q ".{81}" "$i" ; then 18 | echo " failed length check" 19 | echo "Fortune cookie file contains a line longer than 78 characters" 20 | exit 1 21 | fi 22 | if egrep -q "`printf "\\r"`" "$i" ; then 23 | echo " failed lack of carriage-return check" 24 | echo "Fortune cookie file contains a CR" 25 | exit 1 26 | fi 27 | if egrep -q "[ `printf "\\t"`]\$$" "$i" ; then 28 | echo " failed lack of trailing space check" 29 | echo "Fortune cookie file contains trailing whitespace" 30 | exit 1 31 | fi 32 | echo " passed " 33 | exit 0 34 | -------------------------------------------------------------------------------- /fortune-mod/tests/scripts/split-valgrind.pl: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env perl 2 | # 3 | # Short description for split-valgrind.pl 4 | # 5 | # Version 0.0.1 6 | # Copyright (C) 2021 Shlomi Fish < https://www.shlomifish.org/ > 7 | # 8 | # Licensed under the terms of the MIT license. 9 | 10 | use strict; 11 | use warnings; 12 | use 5.014; 13 | use autodie; 14 | 15 | use Path::Tiny qw/ path /; 16 | 17 | use FindBin; 18 | my $code = path("$FindBin::Bin/../data/valgrind.t")->slurp_raw(); 19 | 20 | # say $code; 21 | $code =~ s#\A(.*?^plan tests => [0-9]+;\n)##ms or die; 22 | my $start = $1; 23 | $start =~ s#^(plan tests => )[0-9]+#${1}1#ms or die; 24 | 25 | my $idx = 1; 26 | my $dir = path("$FindBin::Bin/../t"); 27 | 28 | sub out 29 | { 30 | my ($str) = @_; 31 | 32 | $dir->child( sprintf( 'valgrind%04d.t', $idx++ ) )->spew_raw( 33 | $start, 34 | 35 | qq%\n# WARNING!! This file was GENERATED by $0\n%, 36 | q#my $obj = Test::RunValgrind->new( {} );#, 37 | qq%\n# TEST\n%, 38 | $str 39 | ); 40 | 41 | return; 42 | } 43 | 44 | while ( $code =~ m#\G.*?^(foreach|\$obj->run)#gms ) 45 | { 46 | my $open = $1; 47 | if ( $open eq "foreach" ) 48 | { 49 | $code =~ m#\G my \$prog \(qw/([^/]+?)/\)\n\{.*?(^\s+\{.*?^\s+\})#gms 50 | or die; 51 | my ( $list, $params ) = ( $1, $2 ); 52 | foreach my $prog ( $list =~ /(\S+)/g ) 53 | { 54 | out("\nforeach my \$prog (qw/ $prog /) { \$obj->run($params); }\n"); 55 | } 56 | } 57 | else 58 | { 59 | $code =~ m#\G.*?(^\s+\{.*?^\s+\})#gms 60 | or die $code; 61 | my ($params) = ($1); 62 | foreach my $prog (1) 63 | { 64 | out("\n\$obj->run($params);\n"); 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /fortune-mod/tests/t/check-cookies.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use Path::Tiny qw/ path /; 7 | use List::Util qw/ any /; 8 | 9 | use Test::More tests => 1; 10 | 11 | sub check_file 12 | { 13 | my ($fn) = @_; 14 | my @l = path($fn)->lines_utf8; 15 | chomp @l; 16 | 17 | if ( $l[-1] ne '%' ) 18 | { 19 | return "Fortune cookie file does not end in a single %"; 20 | } 21 | my $MAX_LEN = 80; 22 | if ( any { length($_) > $MAX_LEN } @l ) 23 | { 24 | return 25 | "Fortune cookie file contains a line longer than $MAX_LEN characters"; 26 | } 27 | if ( any { /\r/ } @l ) 28 | { 29 | return "Fortune cookie file contains a CR"; 30 | } 31 | if ( any { /[ \t]\z/ } @l ) 32 | { 33 | return "Fortune cookie file contains trailing whitespace"; 34 | } 35 | return ""; 36 | } 37 | 38 | sub mytest 39 | { 40 | foreach my $cookie ( split / /, $ENV{COOKIES} ) 41 | { 42 | my $err = check_file("$ENV{SRC_DIR}/datfiles/$cookie"); 43 | if ( $err ne '' ) 44 | { 45 | fail("$cookie failed - $err."); 46 | return; 47 | } 48 | } 49 | pass("All are ok."); 50 | } 51 | 52 | # TEST 53 | mytest(); 54 | -------------------------------------------------------------------------------- /fortune-mod/tests/t/check-rinutils.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use Path::Tiny qw/ path /; 7 | 8 | use Test::More tests => 1; 9 | 10 | sub check_file 11 | { 12 | my ($fn) = @_; 13 | my @l = path($fn)->lines_utf8; 14 | if ( @l < 4 ) 15 | { 16 | return "too few lines"; 17 | } 18 | return ""; 19 | } 20 | 21 | sub mytest 22 | { 23 | my $dir = "$ENV{SRC_DIR}/rinutils"; 24 | if ( not -e $dir ) 25 | { 26 | fail("-e $dir failed."); 27 | return; 28 | } 29 | foreach my $fn ("rinutils/include/rinutils/portable_time.h") 30 | { 31 | my $err = check_file("${dir}/${fn}"); 32 | if ( $err ne '' ) 33 | { 34 | fail("$fn failed - $err."); 35 | return; 36 | } 37 | } 38 | pass("All are ok."); 39 | } 40 | 41 | # TEST 42 | mytest(); 43 | -------------------------------------------------------------------------------- /fortune-mod/tests/t/lib/FortTestInst.pm: -------------------------------------------------------------------------------- 1 | package FortTestInst; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use Path::Tiny qw/ cwd /; 7 | use File::Path qw/ mkpath rmtree /; 8 | 9 | my $IS_WIN = ( $^O eq "MSWin32" ); 10 | my $MAKE = $IS_WIN ? 'gmake' : 'make'; 11 | 12 | sub do_system 13 | { 14 | my ($args) = @_; 15 | 16 | my $cmd = $args->{cmd}; 17 | print "Running [@$cmd]\n"; 18 | if ( system(@$cmd) ) 19 | { 20 | die "Running [@$cmd] failed!"; 21 | } 22 | } 23 | 24 | # to avoid paths that start with "./fortune" 25 | my $BASE_PATH_PREFIX = "TEMP-DIR-"; 26 | 27 | sub install 28 | { 29 | my ($basebasepath) = @_; 30 | my $basepath = $BASE_PATH_PREFIX . $basebasepath; 31 | my $cwd = cwd->absolute; 32 | my $build_dir = $cwd->child("$basepath-build-dir"); 33 | my $inst_dir = $cwd->child("$basepath-INST_DIR"); 34 | rmtree( $build_dir, 0, 0 ); 35 | rmtree( $inst_dir, 0, 0 ); 36 | mkpath($build_dir); 37 | chdir $build_dir; 38 | my $KEY = 'CMAKE_GEN'; 39 | do_system( 40 | { 41 | cmd => [ 42 | 'cmake', 43 | ( defined( $ENV{$KEY} ) ? ( "-G", $ENV{$KEY} ) : () ), 44 | ( 45 | defined( $ENV{CMAKE_MAKE_PROGRAM} ) 46 | ? "-DCMAKE_MAKE_PROGRAM=$ENV{CMAKE_MAKE_PROGRAM}" 47 | : () 48 | ), 49 | "-DCMAKE_INSTALL_PREFIX=$inst_dir", 50 | "-DLOCALDIR=$inst_dir/share/games/fortunes", 51 | ( $IS_WIN ? ("-DCMAKE_BUILD_TYPE=Debug") : () ), 52 | $ENV{SRC_DIR} 53 | ] 54 | } 55 | ); 56 | do_system( { cmd => [ $MAKE, 'install', ] } ); 57 | chdir($cwd); 58 | 59 | return $inst_dir; 60 | } 61 | 62 | 1; 63 | __END__ 64 | 65 | =head1 COPYRIGHT & LICENSE 66 | 67 | Copyright 2019 by Shlomi Fish 68 | 69 | This program is distributed under the MIT / Expat License: 70 | L 71 | 72 | Permission is hereby granted, free of charge, to any person 73 | obtaining a copy of this software and associated documentation 74 | files (the "Software"), to deal in the Software without 75 | restriction, including without limitation the rights to use, 76 | copy, modify, merge, publish, distribute, sublicense, and/or sell 77 | copies of the Software, and to permit persons to whom the 78 | Software is furnished to do so, subject to the following 79 | conditions: 80 | 81 | The above copyright notice and this permission notice shall be 82 | included in all copies or substantial portions of the Software. 83 | 84 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 85 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 86 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 87 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 88 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 89 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 90 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 91 | OTHER DEALINGS IN THE SOFTWARE. 92 | 93 | =cut 94 | -------------------------------------------------------------------------------- /fortune-mod/tests/t/test-fortune-h-flag.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | use strict; 4 | use warnings; 5 | use 5.014; 6 | 7 | use FindBin; 8 | use lib "$FindBin::Bin/lib"; 9 | use FortTestInst (); 10 | use Test::More tests => 1; 11 | use Test::Trap 12 | qw( trap $trap :flow:stderr(systemsafe):stdout(systemsafe):warn ); 13 | 14 | { 15 | my $inst_dir = FortTestInst::install("fortune-help-flag"); 16 | my @cmd = ( $inst_dir->child( 'games', 'fortune' ), "-h", ); 17 | 18 | print "Running [@cmd]\n"; 19 | trap 20 | { 21 | system(@cmd); 22 | }; 23 | 24 | # TEST 25 | unlike( $trap->stderr(), qr/\A[^\n]*?invalid option/ms, 26 | "negative integer" ); 27 | } 28 | -------------------------------------------------------------------------------- /fortune-mod/tests/t/test-fortune-m--wetpaint.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | use strict; 4 | use warnings; 5 | use 5.014; 6 | 7 | use FindBin; 8 | use lib "$FindBin::Bin/lib"; 9 | use FortTestInst (); 10 | use Test::More tests => 2; 11 | 12 | { 13 | my $inst_dir = FortTestInst::install("fortune-m--wpaint"); 14 | my @cmd = ( $inst_dir->child( 'games', 'fortune' ), '-m', '"wet paint"' ); 15 | 16 | print "Running [@cmd]\n"; 17 | my $text = `@cmd`; 18 | my $rc = $?; 19 | print "AfterRun rc=$rc [@cmd]\n"; 20 | 21 | # TEST 22 | like( $text, qr/wet paint/, 'fortune -m matched' ); 23 | 24 | # TEST 25 | unlike( $text, qr/wet paint.*?wet paint/ms, 'no duplicate fortunes' ); 26 | } 27 | -------------------------------------------------------------------------------- /fortune-mod/tests/t/test-fortune-m.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | use strict; 4 | use warnings; 5 | use 5.014; 6 | 7 | use FindBin; 8 | use lib "$FindBin::Bin/lib"; 9 | use FortTestInst (); 10 | use Test::More tests => 1; 11 | 12 | { 13 | my $inst_dir = FortTestInst::install("fortune-m--giants"); 14 | my @cmd = ( $inst_dir->child( 'games', 'fortune' ), '-m', 'giants' ); 15 | 16 | print "Running [@cmd]\n"; 17 | my $text = `@cmd`; 18 | my $rc = $?; 19 | print "AfterRun rc=$rc [@cmd]\n"; 20 | 21 | # TEST 22 | like( $text, qr/Newton/, 'fortune -m matched' ); 23 | } 24 | -------------------------------------------------------------------------------- /fortune-mod/tests/t/test-fortune-o-rot.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # See: 4 | # https://github.com/shlomif/fortune-mod/issues/26 5 | # " Offensive fortunes not automatically decrypting #26 " 6 | 7 | use strict; 8 | use warnings; 9 | 10 | use Path::Tiny qw/ path tempdir tempfile cwd /; 11 | 12 | use FindBin; 13 | use lib "$FindBin::Bin/lib"; 14 | use FortTestInst (); 15 | use Test::More; 16 | 17 | if ( $^O eq "MSWin32" ) 18 | { 19 | plan skip_all => 'srandom() is different on MS Windows'; 20 | } 21 | 22 | plan tests => 1; 23 | 24 | { 25 | my $inst_dir = FortTestInst::install("fortune-o-rot"); 26 | local $ENV{FORTUNE_MOD_RAND_HARD_CODED_VALS} = 240; 27 | my $inst_bin = $inst_dir->child( "games", "fortune" ); 28 | my $text = `$inst_bin -o`; 29 | 30 | # TEST 31 | like( $text, qr/Rabin/ms, 'fortune -o was not rotated' ); 32 | } 33 | -------------------------------------------------------------------------------- /fortune-mod/tests/t/test-fortune-percent.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | use strict; 4 | use warnings; 5 | use 5.014; 6 | 7 | use FindBin; 8 | use lib "$FindBin::Bin/lib"; 9 | use FortTestInst (); 10 | use Test::More tests => 2; 11 | use Test::Trap 12 | qw( trap $trap :flow:stderr(systemsafe):stdout(systemsafe):warn ); 13 | 14 | { 15 | my $inst_dir = FortTestInst::install("fortune-percent-overflow"); 16 | my $IS_WIN = ( $^O eq "MSWin32" ); 17 | my @cmd = ( 18 | $inst_dir->child( 'games', 'fortune' ), 19 | "999999999999999%", "songs-poems" 20 | ); 21 | 22 | print "Running [@cmd]\n"; 23 | trap 24 | { 25 | system(@cmd); 26 | }; 27 | 28 | # TEST 29 | like( $trap->stderr(), 30 | qr/Overflow percentage detected at argument "999999999999999%"!/, 31 | "right error." ); 32 | 33 | # TEST 34 | unlike( $trap->stderr(), qr/-[0-9]/, "negative integer" ); 35 | } 36 | -------------------------------------------------------------------------------- /fortune-mod/tests/t/tidyall.t: -------------------------------------------------------------------------------- 1 | package main; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use Test::More; 7 | my $SKIP_KEY = 'FORTUNE_TEST_TIDY'; 8 | if ( !$ENV{$SKIP_KEY} ) 9 | { 10 | plan skip_all => "Skipping because $SKIP_KEY is not set"; 11 | } 12 | 13 | package MyCacheModel; 14 | 15 | require Moo; 16 | Moo->import; 17 | 18 | extends('Code::TidyAll::CacheModel'); 19 | 20 | my $DUMMY_LAST_MOD = 0; 21 | 22 | sub _build_cache_value 23 | { 24 | my ($self) = @_; 25 | 26 | return $self->_sig( 27 | [ $self->base_sig, $DUMMY_LAST_MOD, $self->file_contents ] ); 28 | } 29 | 30 | package main; 31 | require Test::Code::TidyAll; 32 | 33 | my $KEY = 'TIDYALL_DATA_DIR'; 34 | Test::Code::TidyAll::tidyall_ok( 35 | conf_file => "$ENV{SRC_DIR}/.tidyallrc", 36 | cache_model_class => 'MyCacheModel', 37 | ( exists( $ENV{$KEY} ) ? ( data_dir => $ENV{$KEY} ) : () ) 38 | ); 39 | -------------------------------------------------------------------------------- /fortune-mod/tests/t/trailing-space-and-CRs.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use File::Find::Object (); 7 | use Path::Tiny qw/ path /; 8 | use Test::More tests => 3; 9 | use Test::Differences (qw( eq_or_diff )); 10 | 11 | my $tree = File::Find::Object->new( {}, $ENV{SRC_DIR} ); 12 | 13 | my %do_not_check = ( 14 | map { $_ => 1 } 15 | qw( 16 | fortune/fortune 17 | util/rot 18 | util/strfile 19 | util/unstr 20 | ) 21 | ); 22 | 23 | my @cr_or_backspace_results; 24 | my @trailing_whitespace_results; 25 | my @tabs_results; 26 | while ( my $r = $tree->next_obj() ) 27 | { 28 | if ( $r->is_file ) 29 | { 30 | my $bn = $r->basename; 31 | my $fn = $r->path; 32 | if ( 33 | not( $bn =~ /\A\..*?\.swp\z/ 34 | or $bn =~ /\.(?:dat|o|valgrind-log)\z/ 35 | or 36 | exists( $do_not_check{ join '/', @{ $r->full_components } } ) ) 37 | ) 38 | { 39 | my $contents = path($fn)->slurp_raw; 40 | 41 | if ( $contents =~ /[\b\r]/ ) 42 | { 43 | push @cr_or_backspace_results, $fn; 44 | } 45 | elsif ( $contents =~ /[ \t]$/ms ) 46 | { 47 | push @trailing_whitespace_results, $fn; 48 | } 49 | elsif ( $bn =~ /\.[ch]\z/ and $contents =~ /\t/ ) 50 | { 51 | push @tabs_results, $fn; 52 | } 53 | } 54 | } 55 | else 56 | { 57 | if ( ( $r->dir_components->[-1] // '' ) eq '.git' ) 58 | { 59 | $tree->prune; 60 | } 61 | } 62 | } 63 | 64 | # TEST 65 | eq_or_diff( \@cr_or_backspace_results, [], 66 | "Files containing carriage returns or \"\\b\"s." ); 67 | 68 | # TEST 69 | eq_or_diff( \@trailing_whitespace_results, 70 | [], "Files containing trailing whitespace." ); 71 | 72 | # TEST 73 | eq_or_diff( \@tabs_results, [], "Source files containing tabs." ); 74 | 75 | __END__ 76 | 77 | =head1 COPYRIGHT & LICENSE 78 | 79 | Copyright 2016 by Shlomi Fish 80 | 81 | This program is distributed under the MIT (X11) License: 82 | L 83 | 84 | Permission is hereby granted, free of charge, to any person 85 | obtaining a copy of this software and associated documentation 86 | files (the "Software"), to deal in the Software without 87 | restriction, including without limitation the rights to use, 88 | copy, modify, merge, publish, distribute, sublicense, and/or sell 89 | copies of the Software, and to permit persons to whom the 90 | Software is furnished to do so, subject to the following 91 | conditions: 92 | 93 | The above copyright notice and this permission notice shall be 94 | included in all copies or substantial portions of the Software. 95 | 96 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 97 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 98 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 99 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 100 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 101 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 102 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 103 | OTHER DEALINGS IN THE SOFTWARE. 104 | 105 | =cut 106 | -------------------------------------------------------------------------------- /fortune-mod/util/FortuneMod/ManPage/Generate/App.pm: -------------------------------------------------------------------------------- 1 | package FortuneMod::ManPage::Generate::App; 2 | 3 | use strict; 4 | use warnings; 5 | use autodie; 6 | 7 | use Getopt::Long qw/ GetOptions /; 8 | use Path::Tiny qw/ path tempdir tempfile cwd /; 9 | 10 | sub do_system 11 | { 12 | my ( $self, $args ) = @_; 13 | 14 | my $cmd = $args->{cmd}; 15 | print "Running [@$cmd]\n"; 16 | if ( system(@$cmd) ) 17 | { 18 | die "Running [@$cmd] failed!"; 19 | } 20 | 21 | return; 22 | } 23 | 24 | sub run 25 | { 26 | my $self = shift; 27 | my $CMAKE_CURRENT_SOURCE_DIR; 28 | my $basename; 29 | my $dest_basename; 30 | my $out_basename; 31 | my $out_section = '1'; 32 | my $subdir = 'util'; 33 | GetOptions( 34 | '--basename=s' => \$basename, 35 | '--dest-basename=s' => \$dest_basename, 36 | '--out-basename=s' => \$out_basename, 37 | '--out-section=s' => \$out_section, 38 | '--src-dir=s' => \$CMAKE_CURRENT_SOURCE_DIR, 39 | '--subdir=s' => \$subdir, 40 | ) or die "Wrong options - $!"; 41 | $dest_basename = $basename if ( not defined $dest_basename ); 42 | $out_basename = $basename if ( not defined $out_basename ); 43 | 44 | die "missing --src-dir" if ( not $CMAKE_CURRENT_SOURCE_DIR ); 45 | { 46 | local %ENV = %ENV; 47 | if ( my $path_prefix = delete( $ENV{DOCMAKE_PATH_PREFIX} ) ) 48 | { 49 | $ENV{PATH} = $path_prefix . $ENV{PATH}; 50 | } 51 | my @args = ( 52 | "manpages", 53 | "${CMAKE_CURRENT_SOURCE_DIR}/${subdir}/${basename}.docbook5.xml", 54 | ); 55 | eval { 56 | require App::Docmake; 57 | local @ARGV = @args; 58 | if ( App::Docmake->new( { argv => [@ARGV] } )->run() ) 59 | { 60 | warn "could not invoke App::Docmake :: run() properly"; 61 | die; 62 | } 63 | }; 64 | my $Err = $@; 65 | if ($Err) 66 | { 67 | warn "App::Docmake from CPAN malfunctioned. $@"; 68 | __PACKAGE__->do_system( 69 | { 70 | cmd => [ "docmake", @args, ], 71 | }, 72 | ); 73 | } 74 | } 75 | 76 | path("${CMAKE_CURRENT_SOURCE_DIR}/${subdir}/${dest_basename}.man") 77 | ->spew_utf8( 78 | cwd()->child("${out_basename}.${out_section}")->slurp_utf8() =~ 79 | s#^[\t ]+(\.RE|\.PP)[\t ]*$#$1#gmrs =~ s#^[\t ]+$##gmrs =~ 80 | s#\n\n+#\n\n#gmrs ); 81 | 82 | return; 83 | } 84 | 85 | 1; 86 | -------------------------------------------------------------------------------- /fortune-mod/util/README.randstr: -------------------------------------------------------------------------------- 1 | randstr is a simple utility that implements the minimal functionality of 2 | the fortune program. Give it the name of a strfile text or data 3 | (pointer) file, and it will randomly select and print one text string. 4 | 5 | It isn't intended to do a lot; it's supposed to be a sample 6 | implementation of a minimal strfile type random text retrieval function, 7 | such as might be used to generate random .signature files. 8 | 9 | For example: 10 | 11 | Create a file of signatures in strfile format (none more than four lines 12 | long, please!). Call it signatures, for ease of understanding. 13 | 14 | Run it through strfile to create the pointer file; put both files in a 15 | safe place--your home directory, for instance. 16 | 17 | In your .login or .profile, add the line: 18 | randstr $HOME/signatures >.signature 19 | 20 | Each time you log in, your signature will change randomly to one of those 21 | in the file signatures. If you change the file, be sure to update the 22 | pointers file! (use strfile) 23 | 24 | If you happen to have root privileges, you might be able to hack Pnews 25 | to change the sig randomly whenever you post. The solution is left as 26 | an exercise for the student (gee, I *always* wanted to say that!). 27 | 28 | Another example: 29 | 30 | As root, create a shell or Perl script to read /etc/passwd and create 31 | a strfile text file containing login name (line one) and GECOS (line 32 | two). 33 | 34 | Add an entry to crontab.root that runs that script once a month, then 35 | uses strfile to create the data file, and randstr to select one entry 36 | at random. 37 | 38 | Give valuable prizes to the winning login. The script can also auto-mail 39 | to the user, with Cc: root. 40 | 41 | Any other 'lottery'-style function could be implemented the same way. 42 | 43 | Both of these examples are more easily implemented with randstr (which 44 | doesn't care where the files are, and accepts no parameters) than with 45 | fortune, which expects files to be in a place specified at compile-time. 46 | 47 | Amy A. Lewis alewis@email.unc.edu 48 | -------------------------------------------------------------------------------- /fortune-mod/util/README.rot: -------------------------------------------------------------------------------- 1 | This is a very simple caesar cipher, rotating alphabetic characters (A-Z 2 | and a-z) by 13. It's used by the Makefile for the "offensive" fortunes, 3 | since there's no guarantee that 'caesar' is available on a particular 4 | machine; there is no specific target for it otherwise. Behavior should 5 | be identical to caesar 13, and it's best used as a filter (e.g., cat 6 | filename | rot >newfilename produces a file that's been rot13'd, just as 7 | cat filename | caesar 13 >newfilename does). 8 | 9 | You shouldn't need this toy, if you have caesar. If you don't have 10 | caesar, either get it, or copy the binary of rot to a safe place after 11 | making the data files (make cookies). 12 | 13 | Amy Lewis alewis@email.unc.edu 14 | -------------------------------------------------------------------------------- /fortune-mod/util/find_duplicate_fortunes.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/python 2 | 3 | # Copyright (c) 2024 Ingo van Lil ( https://github.com/inguin ) 4 | # Author: Ingo van Lil ( https://github.com/inguin ) 5 | # Author: Shlomi Fish ( https://www.shlomifish.org/ ) 6 | # 7 | 8 | import re 9 | import subprocess 10 | import sys 11 | 12 | ''' 13 | 14 | Permission is hereby granted, free of charge, to any person obtaining a 15 | copy of this software and associated documentation files (the "Software"), 16 | to deal in the Software without restriction, including without limitation 17 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | and/or sell copies of the Software, and to permit persons to whom the 19 | Software is furnished to do so, subject to the following conditions: 20 | 21 | The above copyright notice and this permission notice shall be included in all 22 | copies or substantial portions of the Software. 23 | 24 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 27 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 28 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 29 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 30 | OTHER DEALINGS IN THE SOFTWARE. 31 | 32 | ''' 33 | 34 | ''' 35 | 36 | python3 util/find_duplicate_fortunes.py \ 37 | $(git ls-files ./datfiles/ | grep -vE 'CMa|/data/' | 38 | perl -E '@l=(<>);sub aa{return shift()=~m#^datfiles/off#ms;}; 39 | @o=sort{(aa($a)<=>aa($b)) or ($a cmp $b)}@l;say@o;' 40 | ) 41 | 42 | ''' 43 | 44 | 45 | def files_processing_transaction(filenames_list): 46 | """docstring for files_processing_transaction""" 47 | 48 | locations_by_text = {} 49 | 50 | for filename in filenames_list: 51 | with open(filename) as fh: 52 | text = "" 53 | startlineno = 1 54 | 55 | for lineno, line in enumerate(fh, 1): 56 | if line == "%\n": 57 | if text not in locations_by_text: 58 | locations_by_text[text] = [] 59 | locations_by_text[text].append( 60 | (filename, startlineno, lineno) 61 | ) 62 | text = "" 63 | startlineno = lineno + 1 64 | else: 65 | text += line 66 | 67 | if text: 68 | if text not in locations_by_text: 69 | locations_by_text[text] = [] 70 | locations_by_text[text].append((filename, startlineno, lineno)) 71 | 72 | byfn = {} 73 | for text, locations in locations_by_text.items(): 74 | if len(locations) > 1: 75 | print(f"Multiple occurrences of '{text.__repr__()[:60]}':") 76 | for filename, startlineno, lineno in locations[1:]: 77 | if filename not in byfn: 78 | byfn[filename] = [] 79 | byfn[filename].append((startlineno, lineno)) 80 | # print(f"{filename}:{startlineno}:{lineno}") 81 | 82 | for filename, matches in byfn.items(): 83 | m = list(reversed(sorted(matches))) 84 | print(filename, m) 85 | with open(filename) as fh: 86 | lines = fh.readlines() 87 | for start, end in m: 88 | lines = lines[:(start - 1)] + lines[(end+0):] 89 | with open(filename, "wt") as fh: 90 | for li in lines: 91 | fh.write(li) 92 | 93 | 94 | if sys.argv[1:] == ['--fortune-mod-dwim']: 95 | cmd = "git ls-files ./datfiles/" 96 | outputbytes = subprocess.check_output(cmd, shell=True) 97 | output = outputbytes.decode('utf-8') 98 | filenames_list = output.split("\n") 99 | # print(filenames_list) 100 | filenames_list = [ 101 | x for x in filenames_list if not re.search('CMa|/data/', x) 102 | ] 103 | 104 | def _mykey(x): 105 | is_off = True if re.search('datfiles/off', x) else False 106 | return (is_off, x) 107 | filenames_list = [x for x in filenames_list if len(x) > 0] 108 | filenames_list = sorted(filenames_list, key=_mykey) 109 | files_processing_transaction(filenames_list=filenames_list) 110 | else: 111 | files_processing_transaction(filenames_list=sys.argv) 112 | -------------------------------------------------------------------------------- /fortune-mod/util/fortmod_gen_manpage.pl: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env perl 2 | # 3 | # Short description for fortmod_gen_manpage.pl 4 | # 5 | # Version 0.0.1 6 | # Copyright (C) 2020 Shlomi Fish < https://www.shlomifish.org/ > 7 | # 8 | # Licensed under the terms of the MIT license. 9 | 10 | use strict; 11 | use warnings; 12 | use 5.014; 13 | use autodie; 14 | 15 | use Path::Tiny qw/ path tempdir tempfile cwd /; 16 | 17 | use FortuneMod::ManPage::Generate::App (); 18 | 19 | FortuneMod::ManPage::Generate::App->run(); 20 | -------------------------------------------------------------------------------- /fortune-mod/util/fortune-mod-common.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1991, 1993 3 | * The Regents of the University of California. All rights reserved. 4 | * 5 | * This code is derived from software contributed to Berkeley by 6 | * Ken Arnold. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 3. All advertising materials mentioning features or use of this software 17 | * must display the following acknowledgement: 18 | * This product includes software developed by the University of 19 | * California, Berkeley and its contributors. 20 | * 4. Neither the name of the University nor the names of its contributors 21 | * may be used to endorse or promote products derived from this software 22 | * without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 25 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 | * SUCH DAMAGE. 35 | * 36 | * @(#)strfile.h 8.1 (Berkeley) 5/31/93 37 | */ 38 | #pragma once 39 | #include 40 | #include 41 | #ifdef _WIN32 42 | /* For ntohl() */ 43 | #include 44 | #define getpid() 0 45 | #include 46 | #include "getopt.h" 47 | #define random(x) rand(x) 48 | #define srandom(x) srand(x) 49 | #define sleep(n) Sleep((n) * 1000) 50 | #else 51 | #include 52 | #include 53 | #endif 54 | #include 55 | #include "strfile.h" 56 | #include 57 | #include 58 | #include 59 | #include 60 | #include 61 | #include 62 | #ifndef MAXPATHLEN 63 | #define MAXPATHLEN 1024 64 | #endif /* MAXPATHLEN */ 65 | #include 66 | #include 67 | 68 | #ifndef FORTUNE_EXCLUDE_SRANDOM 69 | static void call_srandom(void) 70 | { 71 | srandom((unsigned)(time((time_t *)NULL) + getpid())); 72 | } 73 | #endif 74 | -------------------------------------------------------------------------------- /fortune-mod/util/fortune-util-set-outfn.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | static char *input_filename = NULL, output_filename[MAXPATHLEN] = ""; 4 | static void set_output_filename(const char *s) 5 | { 6 | if (s) 7 | { 8 | (void)strncpy(output_filename, s, sizeof(output_filename)); 9 | LAST(output_filename) = '\0'; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /fortune-mod/util/fortune-util.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | static void input_fn_2_data_fn(void) 4 | { 5 | if (strlen(input_filename) > COUNT(data_filename) - 10) 6 | { 7 | fprintf(stderr, "%s\n", "input filname is too long"); 8 | exit(1); 9 | } 10 | /* Hmm. Don't output anything if we can help it. 11 | * fprintf(stderr, "Input file: %s\n",input_filename); */ 12 | char *const extc = strrchr(input_filename, '.'); 13 | if (!extc) 14 | { 15 | snprintf(data_filename, COUNT(data_filename), "%s.dat", input_filename); 16 | } 17 | else 18 | { 19 | strncpy(data_filename, input_filename, COUNT(data_filename)); 20 | LAST(data_filename) = '\0'; 21 | *extc = '\0'; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fortune-mod/util/getopt.c: -------------------------------------------------------------------------------- 1 | #include "getopt.h" // make sure you construct the header file as dictated above 2 | 3 | /* 4 | * Copyright (c) 1987, 1993, 1994 5 | * The Regents of the University of California. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 3. All advertising materials mentioning features or use of this software 16 | * must display the following acknowledgement: 17 | * This product includes software developed by the University of 18 | * California, Berkeley and its contributors. 19 | * 4. Neither the name of the University nor the names of its contributors 20 | * may be used to endorse or promote products derived from this software 21 | * without specific prior written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 24 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 | * SUCH DAMAGE. 34 | */ 35 | 36 | #include 37 | #include 38 | 39 | int opterr = 1, /* if error message should be printed */ 40 | optind = 1, /* index into parent argv vector */ 41 | optopt, /* character checked for validity */ 42 | optreset; /* reset getopt */ 43 | char *optarg; /* argument associated with option */ 44 | 45 | #define BADCH (int)'?' 46 | #define BADARG (int)':' 47 | #define EMSG "" 48 | 49 | /* 50 | * getopt -- 51 | * Parse argc/argv argument vector. 52 | */ 53 | int getopt(int nargc, char *const nargv[], const char *ostr) 54 | { 55 | static char *place = EMSG; /* option letter processing */ 56 | const char *oli; /* option letter list index */ 57 | 58 | if (optreset || !*place) 59 | { /* update scanning pointer */ 60 | optreset = 0; 61 | if (optind >= nargc || *(place = nargv[optind]) != '-') 62 | { 63 | place = EMSG; 64 | return (-1); 65 | } 66 | if (place[1] && *++place == '-') 67 | { /* found "--" */ 68 | ++optind; 69 | place = EMSG; 70 | return (-1); 71 | } 72 | } /* option letter okay? */ 73 | if ((optopt = (int)*place++) == (int)':' || !(oli = strchr(ostr, optopt))) 74 | { 75 | /* 76 | * if the user didn't specify '-' as an option, 77 | * assume it means -1. 78 | */ 79 | if (optopt == (int)'-') 80 | { 81 | return (-1); 82 | } 83 | if (!*place) 84 | { 85 | ++optind; 86 | } 87 | if (opterr && *ostr != ':') 88 | { 89 | (void)printf("illegal option -- %c\n", optopt); 90 | } 91 | return (BADCH); 92 | } 93 | if (*++oli != ':') 94 | { /* don't need argument */ 95 | optarg = NULL; 96 | if (!*place) 97 | { 98 | ++optind; 99 | } 100 | } 101 | else 102 | { /* need an argument */ 103 | if (*place) /* no white space */ 104 | { 105 | optarg = place; 106 | } 107 | else if (nargc <= ++optind) 108 | { /* no arg */ 109 | place = EMSG; 110 | if (*ostr == ':') 111 | { 112 | return (BADARG); 113 | } 114 | if (opterr) 115 | { 116 | (void)printf("option requires an argument -- %c\n", optopt); 117 | } 118 | return (BADCH); 119 | } 120 | else /* white space */ 121 | { 122 | optarg = nargv[optind]; 123 | } 124 | place = EMSG; 125 | ++optind; 126 | } 127 | return (optopt); /* dump back option letter */ 128 | } 129 | -------------------------------------------------------------------------------- /fortune-mod/util/getopt.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | extern int opterr, /* if error message should be printed */ 3 | optind, /* index into parent argv vector */ 4 | optopt, /* character checked for validity */ 5 | optreset; /* reset getopt */ 6 | extern char *optarg; /* argument associated with option */ 7 | int getopt(int nargc, char *const nargv[], const char *ostr); 8 | -------------------------------------------------------------------------------- /fortune-mod/util/randstr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The following code has been derived chiefly from the BSD distributions 3 | * of the utility program unstr and the random quote displayer fortune. 4 | * The utility produced by this code shares characteristics of both 5 | * (it might be regarded as a minimalist implementation of fortune, for 6 | * large values of 'minimal'), and is here offered so as to have the 7 | * minimal necessary tools for rabbiting a strfile routine into some other, 8 | * more significant program, all in one place. A programmer who cares and 9 | * has the proper training could probably clean this up significantly; it's 10 | * all stolen code (first rule of programming: steal) hacked together to 11 | * fit. Or, to paraphrase the old saw about how the British built ships, 12 | * it's coded by the mile and cut off to order. In that analogy, this 13 | * program's about an inch--and separated with an axe. 14 | * 15 | * Axe murderess programming. Wotta concept! 16 | * 17 | * Use at your own peril, especially as a pattern (kludge, kludge!). This 18 | * program, at least, shouldn't have any real chance of corrupting data, 19 | * though; it opens files ro and dumps to the screen. If you redirect 20 | * output, you definitely do so at your own peril (I lost six hours of 21 | * editing on a fortune file that way, by redirecting the output of unstr 22 | * before it had an outputfile option, trying to skip over the mv x.sorted 23 | * x step. Axe murderess redirection, in that case). 24 | * 25 | * Blame Amy A. Lewis. September, 1995. alewis@email.unc.edu 26 | */ 27 | 28 | /*- 29 | * Copyright (c) 1991, 1993 30 | * The Regents of the University of California. All rights reserved. 31 | * 32 | * This code is derived from software contributed to Berkeley by 33 | * Ken Arnold. 34 | * 35 | * Redistribution and use in source and binary forms, with or without 36 | * modification, are permitted provided that the following conditions 37 | * are met: 38 | * 1. Redistributions of source code must retain the above copyright 39 | * notice, this list of conditions and the following disclaimer. 40 | * 2. Redistributions in binary form must reproduce the above copyright 41 | * notice, this list of conditions and the following disclaimer in the 42 | * documentation and/or other materials provided with the distribution. 43 | * 3. All advertising materials mentioning features or use of this software 44 | * must display the following acknowledgement: 45 | * This product includes software developed by the University of 46 | * California, Berkeley and its contributors. 47 | * 4. Neither the name of the University nor the names of its contributors 48 | * may be used to endorse or promote products derived from this software 49 | * without specific prior written permission. 50 | * 51 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 52 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 53 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 54 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 55 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 56 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 57 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 58 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 59 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 60 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 61 | * SUCH DAMAGE. 62 | */ 63 | 64 | /* randstr repeats the minimum functionality of the fortune program. It 65 | * finds the fortune text or data file specified on the command line -- 66 | * one or the other, not both -- generates a random number, and displays 67 | * the text string indexed. No provision is made for any other command 68 | * line switches. At all. 69 | * 70 | * Usage: 71 | * 72 | * randstr filename[.ext] 73 | * 74 | * Example: run sed or Perl over your /etc/passwd, and kick out a 75 | * strfile-format file containing lognames on the first line and full 76 | * names on the second. Write a script called 'lottery' which is 77 | * called once a month from crontab; it in turn calls randstr lusers, 78 | * and the winning luser gets a prize notification sent by email from 79 | * the lottery script. Living up to promises is optional. 80 | * 81 | * Note: if you're a sysadmin who regularly reads _Mein Kampf_ for the 82 | * deep truths buried in it, and believe in Truth, Justice, and the 83 | * American Family, you could use this to replace fortune, by pointing 84 | * it at a small, Family Values database. The great advantage to this, 85 | * in my opinion, is that it wouldn't take up any disk space at all. 86 | * Who're you gonna quote? Dan Quayle? 87 | */ 88 | 89 | #include "fortune-mod-common.h" 90 | 91 | static char *input_filename, data_filename[MAXPATHLEN]; 92 | 93 | static FILE *Inf, *Dataf; 94 | 95 | static off_t pos, Seekpts[2]; /* seek pointers to fortunes */ 96 | 97 | #include "fortune-util.h" 98 | 99 | static void getargs(char *argv[]) 100 | { 101 | argv += optind + 1; 102 | 103 | if (*argv) 104 | { 105 | input_filename = *argv; 106 | input_fn_2_data_fn(); 107 | } 108 | else 109 | { 110 | /* { 111 | * Don't write out errors here, either; trust in exit codes and sh 112 | * fprintf(stderr, "No input file name\n"); 113 | * fprintf(stderr, "Usage:\n\tunstr [-c C] datafile[.ext] 114 | * [outputfile]\n"); 115 | */ 116 | exit(1); 117 | /* } */ 118 | } 119 | } 120 | 121 | /* 122 | * get_pos: 123 | * Get the position from the pos file, if there is one. If not, 124 | * return a random number. 125 | */ 126 | static void get_pos(STRFILE *fp) 127 | { 128 | pos = random() % fp->str_numstr; 129 | if (++(pos) >= (off_t)(fp->str_numstr)) 130 | { 131 | pos -= fp->str_numstr; 132 | } 133 | } 134 | 135 | /* 136 | * get_fort: 137 | * Get the fortune data file's seek pointer for the next fortune. 138 | */ 139 | static void get_fort(STRFILE fp) 140 | { 141 | get_pos(&fp); 142 | fseek(Dataf, (long)((long)sizeof(fp) + pos * (long)sizeof(Seekpts[0])), 143 | SEEK_SET); 144 | if (!fread(Seekpts, sizeof Seekpts, 1, Dataf)) 145 | { 146 | exit(1); 147 | } 148 | Seekpts[0] = ntohl((uint32_t)Seekpts[0]); 149 | Seekpts[1] = ntohl((uint32_t)Seekpts[1]); 150 | } 151 | 152 | static void display(FILE *fp, STRFILE table) 153 | { 154 | char line[BUFSIZ]; 155 | 156 | fseek(fp, (long)Seekpts[0], SEEK_SET); 157 | for (; fgets(line, sizeof line, fp) && !STR_ENDSTRING(line, table);) 158 | { 159 | if (table.str_flags & STR_ROTATED) 160 | { 161 | char ch; 162 | for (char *p = line; (ch = *p); ++p) 163 | { 164 | if (isupper(ch)) 165 | { 166 | *p = 'A' + (ch - 'A' + 13) % 26; 167 | } 168 | else if (islower(ch)) 169 | { 170 | *p = 'a' + (ch - 'a' + 13) % 26; 171 | } 172 | } 173 | } 174 | fputs(line, stdout); 175 | } 176 | fflush(stdout); 177 | } 178 | 179 | int main(int argc GCC_UNUSED, char **argv) 180 | { 181 | static STRFILE tbl; /* description table */ 182 | 183 | getargs(argv); 184 | if (!(Inf = fopen(input_filename, "r"))) 185 | { 186 | perror(input_filename); 187 | exit(1); 188 | } 189 | if (!(Dataf = fopen(data_filename, "r"))) 190 | { 191 | perror(data_filename); 192 | exit(1); 193 | } 194 | if (!fread((char *)&tbl, sizeof tbl, 1, Dataf)) 195 | { 196 | exit(1); 197 | } 198 | tbl.str_version = ntohl(tbl.str_version); 199 | tbl.str_numstr = ntohl(tbl.str_numstr); 200 | tbl.str_longlen = ntohl(tbl.str_longlen); 201 | tbl.str_shortlen = ntohl(tbl.str_shortlen); 202 | tbl.str_flags = ntohl(tbl.str_flags); 203 | 204 | call_srandom(); 205 | get_fort(tbl); 206 | display(Inf, tbl); 207 | 208 | fclose(Inf); 209 | fclose(Dataf); 210 | 211 | return 0; 212 | } 213 | -------------------------------------------------------------------------------- /fortune-mod/util/randstr.docbook5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | RANDSTR 10 | 1 11 | October 1995 12 | Linux hackery 13 | 14 | 15 | randstr 16 | fetch a random text string from a specified file 17 | 18 | 19 | 20 | SYNOPIS 21 | randstr filename 22 | 23 | 24 | DESCRIPTION 25 | In essence, 26 | randstr 27 | is a stripped-down, minimalist version of the popular 28 | fortune6 29 | program. 30 | 31 | It reads files with the same structure as the fortunes databases, and 32 | displays a random string. 33 | 34 | Usage 35 | randstr 36 | might be used, with a database of signatures created with a text editor 37 | and the 38 | strfile8 and unstr8 39 | utilities, to randomly change the 40 | $HOME/.signature 41 | file. To do so, create the necessary database as, for example, 42 | signatures and signatures.dat 43 | in the home directory, and add the following line to 44 | .profile or .login: 45 |
46 | randstr signatures 47 | >.signature 48 |
49 | 50 | As superuser, a similar sort of thing could be placed in the 51 | Pnews1 or Rnmail1 52 | scripts, although it should certainly test to be certain that the files 53 | exist, and creating the files of signatures might require a good deal of 54 | help for a lot of users. 55 | 56 | Also as superuser, one might use 57 | randstr 58 | with a shell or 59 | Perl 60 | script to read the 61 | etc/passwd 62 | database and create a 63 | strfile 64 | type database, and use this database to run a monthly lottery. 65 |
66 |
67 | 68 | BUGS 69 | None known. 70 | 71 | 72 | SEE ALSO 73 | fortune6, strfile1 74 | 75 |
76 | 77 | -------------------------------------------------------------------------------- /fortune-mod/util/rot.c: -------------------------------------------------------------------------------- 1 | // An extremely simpleminded function. Read characters from stdin, 2 | // rot13 them, and put them on stdout. Totally unnecessary, of course. 3 | #include 4 | #include 5 | 6 | int main(void) 7 | { 8 | int a; 9 | while ((a = getchar()) != EOF) 10 | { 11 | putchar(isupper(a) ? ('A' + (a - 'A' + 13) % 26) 12 | : islower(a) ? ('a' + (a - 'a' + 13) % 26) 13 | : a); 14 | } 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /fortune-mod/util/rot.pl: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env perl 2 | # 3 | # Short description for rot.pl 4 | # 5 | # rot13 fallback for cross compiling builds: 6 | # 7 | # https://github.com/shlomif/fortune-mod/issues/58 8 | # 9 | # Version 0.0.1 10 | # Copyright (C) 2021 Shlomi Fish < https://www.shlomifish.org/ > 11 | # 12 | # Licensed under the terms of the MIT license. 13 | 14 | use strict; 15 | use warnings; 16 | use autodie; 17 | 18 | while (<>) 19 | { 20 | tr/A-Za-z/N-ZA-Mn-za-m/; 21 | print $_; 22 | } 23 | -------------------------------------------------------------------------------- /fortune-mod/util/strfile.h: -------------------------------------------------------------------------------- 1 | /* $NetBSD: strfile.h,v 1.3 1995/03/23 08:28:49 cgd Exp $ */ 2 | 3 | /*- 4 | * Copyright (c) 1991, 1993 5 | * The Regents of the University of California. All rights reserved. 6 | * 7 | * This code is derived from software contributed to Berkeley by 8 | * Ken Arnold. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 3. All advertising materials mentioning features or use of this software 19 | * must display the following acknowledgement: 20 | * This product includes software developed by the University of 21 | * California, Berkeley and its contributors. 22 | * 4. Neither the name of the University nor the names of its contributors 23 | * may be used to endorse or promote products derived from this software 24 | * without specific prior written permission. 25 | * 26 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 27 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 28 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 29 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 30 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 31 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 | * SUCH DAMAGE. 37 | * 38 | * @(#)strfile.h 8.1 (Berkeley) 5/31/93 39 | */ 40 | #include 41 | 42 | #define STR_ENDSTRING(line, tbl) \ 43 | ((line)[0] == (tbl).str_delim && (line)[1] == '\n') 44 | 45 | typedef struct 46 | { /* information table */ 47 | #define STRFILE_VERSION 2 48 | uint32_t str_version; /* version number */ 49 | uint32_t str_numstr; /* # of strings in the file */ 50 | uint32_t str_longlen; /* length of longest string */ 51 | uint32_t str_shortlen; /* length of shortest string */ 52 | #define STR_RANDOM 0x1 /* randomized pointers */ 53 | #define STR_ORDERED 0x2 /* ordered pointers */ 54 | #define STR_ROTATED 0x4 /* rot-13'd text */ 55 | uint32_t str_flags; /* bit field for flags */ 56 | uint8_t stuff[4]; /* long aligned space */ 57 | #define str_delim stuff[0] /* delimiting character */ 58 | } STRFILE; 59 | -------------------------------------------------------------------------------- /fortune-mod/util/unstr.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: unstr.c,v 1.3 1995/03/23 08:29:00 cgd Exp $ */ 2 | 3 | /*- 4 | * Copyright (c) 1991, 1993 5 | * The Regents of the University of California. All rights reserved. 6 | * 7 | * This code is derived from software contributed to Berkeley by 8 | * Ken Arnold. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 3. All advertising materials mentioning features or use of this software 19 | * must display the following acknowledgement: 20 | * This product includes software developed by the University of 21 | * California, Berkeley and its contributors. 22 | * 4. Neither the name of the University nor the names of its contributors 23 | * may be used to endorse or promote products derived from this software 24 | * without specific prior written permission. 25 | * 26 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 27 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 28 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 29 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 30 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 31 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 | * SUCH DAMAGE. 37 | */ 38 | 39 | /* 40 | * This program un-does what "strfile" makes, thereby obtaining the 41 | * original file again. This can be invoked with the name of the output 42 | * file, the input file, or both. If invoked with only a single argument 43 | * ending in ".dat", it is pressumed to be the input file and the output 44 | * file will be the same stripped of the ".dat". If the single argument 45 | * doesn't end in ".dat", then it is presumed to be the output file, and 46 | * the input file is that name prepended by a ".dat". If both are given 47 | * they are treated literally as the input and output files. 48 | * 49 | * Ken Arnold Aug 13, 1978 50 | */ 51 | 52 | /* 53 | * Umm. Well, when I got this thing, it didn't work like that. It now 54 | * treats the *first* filename listed as the name of the datafile; if 55 | * the file happens to have an extension, that's stripped off and the 56 | * result is the name of the strings file. If there is no extension, then 57 | * the datafile has '.dat' added, and the strings file is the filename. 58 | * The only problem with this is if you happen to have a strings file 59 | * with a dot in it--in that case, specify the dat file fully. 60 | * 61 | * The program also now accepts an optional second filename, which is the 62 | * name of the output file; if not specified, it dumps to stdout. 63 | * 64 | * It can also take one parameter, which defines a new separator character. 65 | * This was added chiefly in order to avoid having to run sed over a 66 | * strings file; unstr *can* do it easily, so it should. 67 | * 68 | * We also had to add some code to make the special cases of a null fortune 69 | * (two separators on successive lines, a common enough error when editing 70 | * a strings file) and no trailing separator be treated properly. Unstr 71 | * now writes out a separator string at the end of a file; strfile does 72 | * not consider the null string following this to be a fortune. Be careful 73 | * not to put an extra newline after the required last newline--if so, you'll 74 | * get a fortune that contains nothing but a newline. Karo syrup, syrup. 75 | * For the gory details, and lots of cussing, see strfile.c 76 | */ 77 | 78 | #define FORTUNE_EXCLUDE_SRANDOM 1 79 | #include "fortune-mod-common.h" 80 | #include "fortune-util-set-outfn.h" 81 | 82 | static char data_filename[MAXPATHLEN], delimiter_char; 83 | 84 | static char new_delimiter_char = '\0'; 85 | 86 | static FILE *Inf, *Dataf, *Outf; 87 | 88 | #include "fortune-util.h" 89 | 90 | /* ARGSUSED */ 91 | static void getargs(int argc, char *argv[]) 92 | { 93 | int ch; 94 | 95 | while ((ch = getopt(argc, argv, "c:")) != EOF) 96 | { 97 | switch (ch) 98 | { 99 | case 'c': 100 | new_delimiter_char = *optarg; 101 | if (!isascii(new_delimiter_char)) 102 | { 103 | fprintf(stderr, "Bad delimiting characher: '\\%o'\n", 104 | (unsigned int)new_delimiter_char); 105 | } 106 | break; 107 | case '?': 108 | default: 109 | fprintf(stderr, "%s", 110 | "Usage:\n\tunstr [-c C] datafile[.ext] [outputfile]\n"); 111 | exit(1); 112 | } 113 | } 114 | 115 | argv += optind; 116 | 117 | if (*argv) 118 | { 119 | input_filename = *argv; 120 | input_fn_2_data_fn(); 121 | set_output_filename(*++argv); 122 | } 123 | else 124 | { 125 | fprintf(stderr, "%s", "No input file name\n"); 126 | fprintf(stderr, "%s", 127 | "Usage:\n\tunstr [-c C] datafile[.ext] [outputfile]\n"); 128 | exit(1); 129 | } 130 | if (!strcmp(input_filename, output_filename)) 131 | { 132 | fprintf(stderr, 133 | "The input file for strings (%s) must be different from the output " 134 | "file (%s)\n", 135 | input_filename, output_filename); 136 | exit(1); 137 | } 138 | } 139 | 140 | static void order_unstr(STRFILE *tbl) 141 | { 142 | int32_t pos; 143 | char buf[BUFSIZ]; 144 | int printedsome; 145 | 146 | for (uint32_t i = 0; i <= tbl->str_numstr; ++i) 147 | { 148 | if (!fread((char *)&pos, 1, sizeof pos, Dataf)) 149 | { 150 | exit(1); 151 | } 152 | fseek(Inf, ntohl((uint32_t)pos), SEEK_SET); 153 | printedsome = 0; 154 | for (;;) 155 | { 156 | char *const sp = fgets(buf, sizeof buf, Inf); 157 | if ((!sp) || STR_ENDSTRING(sp, *tbl)) 158 | { 159 | if (sp || printedsome) 160 | fprintf(Outf, "%c\n", delimiter_char); 161 | break; 162 | } 163 | else 164 | { 165 | printedsome = 1; 166 | fputs(sp, Outf); 167 | } 168 | } 169 | } 170 | } 171 | 172 | int main(int argc, char **argv) 173 | { 174 | static STRFILE tbl; /* description table */ 175 | 176 | getargs(argc, argv); 177 | if (!(Inf = fopen(input_filename, "r"))) 178 | { 179 | perror(input_filename); 180 | exit(1); 181 | } 182 | if (!(Dataf = fopen(data_filename, "r"))) 183 | { 184 | perror(data_filename); 185 | exit(1); 186 | } 187 | if (*output_filename == '\0') 188 | { 189 | Outf = stdout; 190 | } 191 | else if (!(Outf = fopen(output_filename, "w+"))) 192 | { 193 | perror(output_filename); 194 | exit(1); 195 | } 196 | #define err_fread(a, b, c, d) \ 197 | if (!fread(a, b, c, d)) \ 198 | { \ 199 | perror("fread"); \ 200 | exit(1); \ 201 | } 202 | err_fread(&tbl.str_version, sizeof(tbl.str_version), 1, Dataf); 203 | err_fread(&tbl.str_numstr, sizeof(tbl.str_numstr), 1, Dataf); 204 | err_fread(&tbl.str_longlen, sizeof(tbl.str_longlen), 1, Dataf); 205 | err_fread(&tbl.str_shortlen, sizeof(tbl.str_shortlen), 1, Dataf); 206 | err_fread(&tbl.str_flags, sizeof(tbl.str_flags), 1, Dataf); 207 | err_fread(tbl.stuff, sizeof(tbl.stuff), 1, Dataf); 208 | if (!(tbl.str_flags & (STR_ORDERED | STR_RANDOM)) && (!new_delimiter_char)) 209 | { 210 | fprintf(stderr, "nothing to do -- table in file order\n"); 211 | exit(1); 212 | } 213 | if (new_delimiter_char) 214 | { 215 | delimiter_char = new_delimiter_char; 216 | } 217 | else 218 | { 219 | delimiter_char = (char)tbl.str_delim; 220 | } 221 | order_unstr(&tbl); 222 | fclose(Inf); 223 | fclose(Dataf); 224 | fclose(Outf); 225 | exit(0); 226 | } 227 | -------------------------------------------------------------------------------- /fortune-mod/ver.txt: -------------------------------------------------------------------------------- 1 | 3.24.0 2 | -------------------------------------------------------------------------------- /scripts/debian-packaging/build-rinutils-debian-package--using-docker.pl: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | use 5.014; 6 | use autodie; 7 | 8 | use Path::Tiny qw/ cwd /; 9 | use Docker::CLI::Wrapper::Container v0.0.4 (); 10 | 11 | my $obj = Docker::CLI::Wrapper::Container->new( 12 | { container => "rinutils--deb--test-build", sys => "debian:sid", } ); 13 | 14 | my $USER = "mygbp"; 15 | my $HOMEDIR = "/home/$USER"; 16 | 17 | $obj->clean_up(); 18 | $obj->run_docker(); 19 | my $REPO = 'rinutils'; 20 | my $BRANCH = 'master'; 21 | my $URL = "https://salsa.debian.org/shlomif-guest/$REPO"; 22 | 23 | if ( !-e $REPO ) 24 | { 25 | $obj->do_system( { cmd => [ "git", "clone", "-b", $BRANCH, $URL, ] } ); 26 | } 27 | my $cwd = cwd; 28 | chdir "./$REPO"; 29 | $obj->do_system( { cmd => [ "git", "pull", "--ff-only", ] } ); 30 | chdir $cwd; 31 | 32 | my $LOG_FN = "git-buildpackage-log.txt"; 33 | 34 | my $BASH_SAFETY = "set -e -x ; set -o pipefail ; "; 35 | 36 | # $obj->docker( { cmd => [ 'cp', "../scripts", "fcsfed:scripts", ] } ); 37 | my $script = <<"EOSCRIPTTTTTTT"; 38 | $BASH_SAFETY 39 | apt-get -y update 40 | apt-get -y install eatmydata sudo 41 | sudo eatmydata apt -y install build-essential chrpath cmake dgit git-buildpackage librecode-dev perl recode 42 | sudo adduser --disabled-password --gecos '' "$USER" 43 | sudo usermod -a -G sudo "$USER" 44 | echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers 45 | EOSCRIPTTTTTTT 46 | 47 | $obj->exe_bash_code( { code => $script, } ); 48 | 49 | $obj->docker( 50 | { cmd => [ 'cp', "./$REPO", $obj->container() . ":$HOMEDIR/$REPO", ] } ); 51 | $obj->exe_bash_code( 52 | { 53 | code => "$BASH_SAFETY chown -R $USER:$USER $HOMEDIR", 54 | } 55 | ); 56 | 57 | $script = <<"EOSCRIPTTTTTTT"; 58 | $BASH_SAFETY 59 | cd "$HOMEDIR/$REPO" 60 | git clean -dxf . 61 | (if ! gbp buildpackage 2>&1 ; then cat /tmp/rinutils*diff* || true ; exit 0 ; fi) | tee -a ~/"$LOG_FN" 62 | (if ! dpkg-buildpackage --changes-option=-S 2>&1 ; then cat /tmp/rinutils*diff* || true; exit 0 ; fi) | tee -a ~/"$LOG_FN" 63 | ( ls -lRA ) | tee -a ~/"$LOG_FN" 64 | (if ! debuild -i -us -uc -S 2>&1 ; then cat /tmp/rinutils*diff* ; exit 1 ; fi) | tee -a ~/"$LOG_FN" 65 | ( ls -lRA ) | tee -a ~/"$LOG_FN" 66 | (if ! dgit push-source --gbp 2>&1 ; then exit 0 || cat /tmp/rinutils*diff* ; exit 1 ; fi) | tee -a ~/"$LOG_FN" 67 | sudo dpkg -i ~/librinutils-dev_0.10.0-2_all.deb 68 | test -f /usr/include/rinutils/rinutils.h 69 | test -f /usr/include/rinutils/alloc_wrap.h 70 | EOSCRIPTTTTTTT 71 | 72 | $obj->exe_bash_code( 73 | { 74 | user => $USER, 75 | code => $script, 76 | } 77 | ); 78 | $obj->docker( 79 | { cmd => [ 'cp', $obj->container() . ":$HOMEDIR/$LOG_FN", $LOG_FN, ] } ); 80 | 81 | $obj->clean_up(); 82 | 83 | __END__ 84 | 85 | =head1 COPYRIGHT & LICENSE 86 | 87 | Copyright 2019 by Shlomi Fish 88 | 89 | This program is distributed under the MIT / Expat License: 90 | L 91 | 92 | Permission is hereby granted, free of charge, to any person 93 | obtaining a copy of this software and associated documentation 94 | files (the "Software"), to deal in the Software without 95 | restriction, including without limitation the rights to use, 96 | copy, modify, merge, publish, distribute, sublicense, and/or sell 97 | copies of the Software, and to permit persons to whom the 98 | Software is furnished to do so, subject to the following 99 | conditions: 100 | 101 | The above copyright notice and this permission notice shall be 102 | included in all copies or substantial portions of the Software. 103 | 104 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 105 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 106 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 107 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 108 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 109 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 110 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 111 | OTHER DEALINGS IN THE SOFTWARE. 112 | 113 | =cut 114 | -------------------------------------------------------------------------------- /scripts/debian-packaging/docker-test.pl: -------------------------------------------------------------------------------- 1 | build-fortune-mod-debian-package--using-docker.pl -------------------------------------------------------------------------------- /scripts/debian-packaging/pbuilderrc: -------------------------------------------------------------------------------- 1 | # pbuilder defaults; edit /etc/pbuilderrc to override these and see 2 | # pbuilderrc.5 for documentation 3 | 4 | # Set how much output you want from pbuilder, valid values are 5 | # E => errors only 6 | # W => errors and warnings 7 | # I => errors, warnings and informational 8 | # D => all of the above and debug messages 9 | LOGLEVEL=I 10 | # if positive, some log messagges (errors, warnings, debugs) will be colored 11 | # auto => try automatically detection 12 | # yes => always use colors 13 | # no => never use colors 14 | USECOLORS=auto 15 | 16 | BASETGZ=/var/cache/pbuilder/base.tgz 17 | #EXTRAPACKAGES="" 18 | #export DEBIAN_BUILDARCH=athlon 19 | BUILDPLACE=/var/cache/pbuilder/build 20 | # directory inside the chroot where the build happens. See #789404 21 | BUILDDIR=/build 22 | # what be used as value for HOME during builds. See #441052 23 | # The default value prevents builds to write on HOME, which is prevented on 24 | # Debian buildds too. You can set it to $BUILDDIR to get a working HOME, if 25 | # you need to. 26 | BUILD_HOME=/nonexistent 27 | MIRRORSITE=http://deb.debian.org/debian 28 | #OTHERMIRROR="deb http://www.home.com/updates/ ./" 29 | #export http_proxy=http://your-proxy:8080/ 30 | USESHM=yes 31 | USEPROC=yes 32 | USEDEVFS=no 33 | USEDEVPTS=yes 34 | USESYSFS=yes 35 | USENETWORK=no 36 | USECGROUP=yes 37 | BUILDRESULT=/var/cache/pbuilder/result/ 38 | 39 | # specifying the distribution forces the distribution on "pbuilder update" 40 | #DISTRIBUTION=sid 41 | # specifying the architecture passes --arch= to debootstrap; the default is 42 | # to use the architecture of the host 43 | #ARCHITECTURE=$(dpkg --print-architecture) 44 | # specifying the components of the distribution, for instance to enable all 45 | # components on Debian use "main contrib non-free" and on Ubuntu "main 46 | # restricted universe multiverse" 47 | COMPONENTS="main" 48 | #specify the cache for APT 49 | APTCACHE="/var/cache/pbuilder/aptcache/" 50 | APTCACHEHARDLINK="yes" 51 | REMOVEPACKAGES="" 52 | #HOOKDIR="/usr/lib/pbuilder/hooks" 53 | HOOKDIR="" 54 | EATMYDATA=no 55 | # NB: this var is private to pbuilder; ccache uses "CCACHE_DIR" instead 56 | # CCACHEDIR="/var/cache/pbuilder/ccache" 57 | CCACHEDIR="" 58 | 59 | # make debconf not interact with user 60 | export DEBIAN_FRONTEND="noninteractive" 61 | 62 | #for pbuilder debuild 63 | BUILDSOURCEROOTCMD="fakeroot" 64 | PBUILDERROOTCMD="sudo -E" 65 | # use cowbuilder for pdebuild 66 | #PDEBUILD_PBUILDER="cowbuilder" 67 | 68 | # Whether to generate an additional .changes file for a source-only upload, 69 | # whilst still producing a full .changes file for any binary packages built. 70 | SOURCE_ONLY_CHANGES=yes 71 | 72 | # additional build results to copy out of the package build area 73 | #ADDITIONAL_BUILDRESULTS=(xunit.xml .coverage) 74 | 75 | # command to satisfy build-dependencies; the default is an internal shell 76 | # implementation which is relatively slow; there are two alternate 77 | # implementations, the "experimental" implementation, 78 | # "pbuilder-satisfydepends-experimental", which might be useful to pull 79 | # packages from experimental or from repositories with a low APT Pin Priority, 80 | # and the "aptitude" implementation, which will resolve build-dependencies and 81 | # build-conflicts with aptitude which helps dealing with complex cases but does 82 | # not support unsigned APT repositories 83 | PBUILDERSATISFYDEPENDSCMD="/usr/lib/pbuilder/pbuilder-satisfydepends" 84 | 85 | # Arguments for $PBUILDERSATISFYDEPENDSCMD. 86 | # PBUILDERSATISFYDEPENDSOPT=() 87 | 88 | # You can optionally make pbuilder accept untrusted repositories by setting 89 | # this option to yes, but this may allow remote attackers to compromise the 90 | # system. Better set a valid key for the signed (local) repository with 91 | # $APTKEYRINGS (see below). 92 | ALLOWUNTRUSTED=no 93 | 94 | # Option to pass to apt-get always. 95 | export APTGETOPT=() 96 | # Option to pass to aptitude always. 97 | export APTITUDEOPT=() 98 | 99 | # Whether to use debdelta or not. If "yes" debdelta will be installed in the 100 | # chroot 101 | DEBDELTA=no 102 | 103 | #Command-line option passed on to dpkg-buildpackage. 104 | #DEBBUILDOPTS="-IXXX -iXXX" 105 | DEBBUILDOPTS="${DEBBUILDOPTS}" 106 | 107 | #APT configuration files directory 108 | APTCONFDIR="" 109 | 110 | # the username and ID used by pbuilder, inside chroot. Needs fakeroot, really 111 | BUILDUSERID=1234 112 | BUILDUSERNAME=pbuilder 113 | 114 | # BINDMOUNTS is a space separated list of things to mount 115 | # inside the chroot. 116 | BINDMOUNTS="" 117 | 118 | # Set the debootstrap variant to 'buildd' type. 119 | DEBOOTSTRAPOPTS=( 120 | '--variant=buildd' 121 | '--force-check-gpg' 122 | ) 123 | # or unset it to make it not a buildd type. 124 | # unset DEBOOTSTRAPOPTS 125 | 126 | # Keyrings to use for package verification with apt, not used for debootstrap 127 | # (use DEBOOTSTRAPOPTS). By default the debian-archive-keyring package inside 128 | # the chroot is used. 129 | APTKEYRINGS=() 130 | 131 | # Set the PATH I am going to use inside pbuilder: default is "/usr/sbin:/usr/bin:/sbin:/bin" 132 | export PATH="/usr/sbin:/usr/bin:/sbin:/bin" 133 | 134 | # SHELL variable is used inside pbuilder by commands like 'su'; and they need sane values 135 | export SHELL=/bin/bash 136 | 137 | # The name of debootstrap command, you might want "cdebootstrap". 138 | DEBOOTSTRAP="debootstrap" 139 | 140 | # default file extension for pkgname-logfile 141 | PKGNAME_LOGFILE_EXTENSION="_$(dpkg --print-architecture).build" 142 | 143 | # default PKGNAME_LOGFILE 144 | PKGNAME_LOGFILE="" 145 | 146 | # default AUTOCLEANAPTCACHE 147 | AUTOCLEANAPTCACHE="" 148 | 149 | #default COMPRESSPROG 150 | COMPRESSPROG="gzip" 151 | 152 | # pbuilder copies some configuration files (like /etc/hosts or /etc/hostname) 153 | # from the host system into the chroot. If the directory specified here 154 | # exists and contains one of the copied files (without the leading /etc) that 155 | # file will be copied from here instead of the system one 156 | CONFDIR="/etc/pbuilder/conf_files" 157 | --------------------------------------------------------------------------------