From b849bc64d624ac819f2cbdaac1384f1b42a22479 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Andr=C3=A9e?= Date: Tue, 10 Dec 2013 15:26:59 +0100 Subject: [PATCH 1/2] fix some errors the pony files and quote files + add fortune-mod-mlp (script to automate the creation of the the fortune-mod-mlp package already in AUR) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- .gitignore | 2 +- extras/fortune-mod-mlp/.gitignore | 3 ++ extras/fortune-mod-mlp/COPYING | 31 ++++++++++++ extras/fortune-mod-mlp/DEPENDENCIES | 10 ++++ extras/fortune-mod-mlp/LICENSE | 1 + extras/fortune-mod-mlp/Makefile | 73 +++++++++++++++++++++++++++++ extras/fortune-mod-mlp/name-pony.sh | 32 +++++++++++++ ponies/cadance.pony | 2 +- ponies/cadancecrystal.pony | 2 +- ponies/cadancescruffy.pony | 2 +- ponies/fillycadance.pony | 2 +- ponyquotes/chrysalis.0 | 2 +- ponyquotes/chrysalis.1 | 2 +- 13 files changed, 157 insertions(+), 7 deletions(-) create mode 100644 extras/fortune-mod-mlp/.gitignore create mode 100644 extras/fortune-mod-mlp/COPYING create mode 100644 extras/fortune-mod-mlp/DEPENDENCIES create mode 120000 extras/fortune-mod-mlp/LICENSE create mode 100644 extras/fortune-mod-mlp/Makefile create mode 100755 extras/fortune-mod-mlp/name-pony.sh diff --git a/.gitignore b/.gitignore index 29cd02e0..9f32cd2f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ ## Private workspace directory -/_/ +_/ /*.pony diff --git a/extras/fortune-mod-mlp/.gitignore b/extras/fortune-mod-mlp/.gitignore new file mode 100644 index 00000000..46c0799e --- /dev/null +++ b/extras/fortune-mod-mlp/.gitignore @@ -0,0 +1,3 @@ +obj/ +/pony +/pony.dat diff --git a/extras/fortune-mod-mlp/COPYING b/extras/fortune-mod-mlp/COPYING new file mode 100644 index 00000000..1d1f8939 --- /dev/null +++ b/extras/fortune-mod-mlp/COPYING @@ -0,0 +1,31 @@ +fortune-mod-mlp — Fortune quotes from My Little Pony Friendship is Magic + +Derived work from ponysay. +Derived work from fortune-mod-mlp as released to the + Arch Linux User Repository by Matthias Devlamynck + + +Copyright (C) 2012, 2013 Erkin Batu Altunbaş et al. + + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + + +If you intend to redistribute ponysay or a fork of it commercially, +it contains aggregated images, some of which may not be commercially +redistribute, you would be required to remove those. To determine +whether or not you may commercially redistribute an image make use +that line ‘FREE: yes’, is included inside the image between two ‘$$$’ +lines and the ‘FREE’ is and upper case and directly followed by +the colon. diff --git a/extras/fortune-mod-mlp/DEPENDENCIES b/extras/fortune-mod-mlp/DEPENDENCIES new file mode 100644 index 00000000..bf21618c --- /dev/null +++ b/extras/fortune-mod-mlp/DEPENDENCIES @@ -0,0 +1,10 @@ +MAKE DEPENDENCIES + +make +findutils +grep +sed +coreutils +sh +fortune-mod + diff --git a/extras/fortune-mod-mlp/LICENSE b/extras/fortune-mod-mlp/LICENSE new file mode 120000 index 00000000..30cff740 --- /dev/null +++ b/extras/fortune-mod-mlp/LICENSE @@ -0,0 +1 @@ +../../LICENSE \ No newline at end of file diff --git a/extras/fortune-mod-mlp/Makefile b/extras/fortune-mod-mlp/Makefile new file mode 100644 index 00000000..a31de7a3 --- /dev/null +++ b/extras/fortune-mod-mlp/Makefile @@ -0,0 +1,73 @@ +PKGNAME=fortune-mod-mlp +PREFIX=/usr +DATA=/share +DATADIR=$(PREFIX)$(DATA) +FORTUNEDIR=$(DATADIR)/fortune +LICENSEDIR=$(DATADIR)/licenses/$(PKGNAME) + +SRC = ../../ponyquotes +PSRC = ../../ponies + +PONIES = $(shell find "$(SRC)" | grep '$(SRC).*\..' | sed -e "s:^$(SRC)::" | sed -e "s:^/::g" | cut -d . -f 1 | sort | uniq) + + +# Tab symbol for use with `echo`. echo -e is not POSIX +empty = +tab = $(empty) $(empty) + + +.PHONY: all +all: pony pony.dat + + +pony.dat: pony + strfile pony + + +pony: $(foreach P, $(PONIES), obj/$(P)) + cat $^ > $@ + + +obj/%: $(SRC)/%.* + @mkdir -p obj + test -f $@ && rm $@ || true + pony="$$(./name-pony.sh "$(PSRC)" $*)" && \ + for file in $^; do \ + cat $$file >> $@ && \ + echo "$(tab)-- $$pony" >> $@ && \ + echo % >> $@ \ + || exit 1; \ + done + + +.PHONY: install +install: pony pony.dat + install -d -- "$(DESTDIR)$(FORTUNEDIR)" + install -m644 pony pony.dat -- "$(DESTDIR)$(FORTUNEDIR)" + + +.PHONY: install-license +install-license: + install -Dm644 -- COPYING "$(DESTDIR)$(LICENSEDIR)/COPYING" + install -Dm644 -- "$(shell realpath LICENSE)" "$(DESTDIR)$(LICENSEDIR)/LICENSE" + + +.PHONY: uninstall +uninstall: + -rm -- "$(DESTDIR)$(FORTUNEDIR)/pony" + -rm -- "$(DESTDIR)$(FORTUNEDIR)/pony.dat" + -rm -- "$(DESTDIR)$(LICENSEDIR)/COPYING" + -rm -- "$(DESTDIR)$(LICENSEDIR)/LICENSE" + -rmdir -- "$(DESTDIR)$(LICENSEDIR)" + + +.PHONY: list-ponies +list-ponies: + @for p in $(PONIES); do echo "$$p"; done + + +.PHONY: clean +clean: + -rm -r obj + -rm pony pony.dat + diff --git a/extras/fortune-mod-mlp/name-pony.sh b/extras/fortune-mod-mlp/name-pony.sh new file mode 100755 index 00000000..49c00823 --- /dev/null +++ b/extras/fortune-mod-mlp/name-pony.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +file="$1/$2.pony" +pony="$2" +name="" + +case "${pony}" in # Exceptions not supported by the name extraction below + (carrot) name="Carrot";; + (chrysalis) name="Chrysalis";; + (lemonhearts) name="Lemon Hearts";; + (lily) name="Lily Valley";; + (snowflake) name="Snowflake";; + (twinkleshine) name="Twinkleshine";; + (rumble) name="Rumble";; +esac + +if [ -n "${name}" ]; then + exit 0 +fi + +name="$(cat "$file" | grep '^NAME: ' | sed -e 's/^NAME: //g')" +name="$(echo $(echo "$name" | grep -o '[^,(]*' | head -n 1))" + +full_name="$(cat "$file" | grep '^OTHER NAMES: ' | sed -e 's/^OTHER NAMES: /, /g')" +full_name="$(echo $(echo "$full_name" | grep -o ', [^,(]* (official, full name[a-z]*)' | grep -o ' [^,(]*' | head -n 1))" + +if test -n "${full_name}"; then + echo "${full_name}" +else + echo "${name}" +fi + diff --git a/ponies/cadance.pony b/ponies/cadance.pony index b8c143db..05cc9596 100644 --- a/ponies/cadance.pony +++ b/ponies/cadance.pony @@ -13,7 +13,7 @@ KIND: alicorn LINK: regular MANE: pastel NAME: Cadance -OTHER NAMES: Princess Cadance (official, titled), Mi Amore Cadenza (official, full named without title), Princess Mi Amore Cadenza (official, full named) +OTHER NAMES: Princess Cadance (official, titled), Mi Amore Cadenza (official, full name without title), Princess Mi Amore Cadenza (official, full name) POSE: stand SOURCE: [jristz] WIDTH: 55 diff --git a/ponies/cadancecrystal.pony b/ponies/cadancecrystal.pony index 2f4c7711..fe612a56 100644 --- a/ponies/cadancecrystal.pony +++ b/ponies/cadancecrystal.pony @@ -14,7 +14,7 @@ LINK: regular MANE: pastel MASTER: cadance NAME: Cadance -OTHER NAMES: Princess Cadance (official, titled), Mi Amore Cadenza (official, full named without title), Princess Mi Amore Cadenza (official, full named) +OTHER NAMES: Princess Cadance (official, titled), Mi Amore Cadenza (official, full name without title), Princess Mi Amore Cadenza (official, full name) POSE: stand SOURCE: [jristz] WIDTH: 46 diff --git a/ponies/cadancescruffy.pony b/ponies/cadancescruffy.pony index ad00bde0..7d1f25d4 100644 --- a/ponies/cadancescruffy.pony +++ b/ponies/cadancescruffy.pony @@ -14,7 +14,7 @@ LINK: regular MANE: pastel MASTER: cadance NAME: Cadance -OTHER NAMES: Princess Cadance (official, titled), Mi Amore Cadenza (official, full named without title), Princess Mi Amore Cadenza (official, full named) +OTHER NAMES: Princess Cadance (official, titled), Mi Amore Cadenza (official, full named without title), Princess Mi Amore Cadenza (official, full name) POSE: scruffy SOURCE: (robokitty) Desktop ponies WIDTH: 48 diff --git a/ponies/fillycadance.pony b/ponies/fillycadance.pony index 13db09bc..7ed82da7 100644 --- a/ponies/fillycadance.pony +++ b/ponies/fillycadance.pony @@ -14,7 +14,7 @@ LINK: regular MANE: pastel MASTER: cadance NAME: Cadance -OTHER NAMES: Princess Cadance (official, titled), Mi Amore Cadenza (official, full named without title), Princess Mi Amore Cadenza (official, full named) +OTHER NAMES: Princess Cadance (official, titled), Mi Amore Cadenza (official, full named without title), Princess Mi Amore Cadenza (official, full name) POSE: filly SOURCE: (Kloopp) Desktop ponies WIDTH: 49 diff --git a/ponyquotes/chrysalis.0 b/ponyquotes/chrysalis.0 index fb09aa6f..161df9cb 100644 --- a/ponyquotes/chrysalis.0 +++ b/ponyquotes/chrysalis.0 @@ -1,5 +1,5 @@ This day has been just perfect The kind of day I've dreamed since I was small Everypony I'll soon control -Every Stallion, mare and foal +Every stallion, mare and foal Who says a girl can't really have it all? diff --git a/ponyquotes/chrysalis.1 b/ponyquotes/chrysalis.1 index 5ea7168f..1b36ae3b 100644 --- a/ponyquotes/chrysalis.1 +++ b/ponyquotes/chrysalis.1 @@ -1 +1 @@ -You do realize the reception has been canceled, don't you? \ No newline at end of file +You do realize the reception has been canceled, don't you? From 9405806e7c15744b4295069aacb64a282c786cee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Andr=C3=A9e?= Date: Tue, 10 Dec 2013 16:14:45 +0100 Subject: [PATCH 2/2] derp: forgot to print the hardcoded names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- extras/fortune-mod-mlp/name-pony.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/extras/fortune-mod-mlp/name-pony.sh b/extras/fortune-mod-mlp/name-pony.sh index 49c00823..3316a7d8 100755 --- a/extras/fortune-mod-mlp/name-pony.sh +++ b/extras/fortune-mod-mlp/name-pony.sh @@ -15,6 +15,7 @@ case "${pony}" in # Exceptions not supported by the name extraction below esac if [ -n "${name}" ]; then + echo "${name}" exit 0 fi