[FFmpeg-devel] [PATCH] web: Copy FFmpeg Logo by Makefile instead of cronjob

Michael Niedermayer michaelni at gmx.at
Fri Apr 6 17:43:27 CEST 2012


On Fri, Apr 06, 2012 at 03:19:03PM +0200, Thilo Borgmann wrote:
> Am 06.04.12 14:14, schrieb Reimar Döffinger:
> > On Fri, Apr 06, 2012 at 02:11:42PM +0200, Reimar Döffinger wrote:
> >> On Fri, Apr 06, 2012 at 01:23:13PM +0200, Thilo Borgmann wrote:
> >>> +DATE := $(shell date +%m%d)
> >>> +
> >>> +LOGO_FILES := $(wildcard src/logik/$(DATE).*)
> >>> +
> >>> +ifeq ($(LOGO_FILES),)
> >>> +LOGO_FILES := $(wildcard src/logik/$(DATE)-standard)
> >>> +endif
> >>
> >> Why not just
> >> LOGO_FILES := $(wildcard src/logik/$(DATE).* src/logik/$(DATE)-standard)
> >> Though honestly do we have to make it that messy? Why not just
> >> making a symlink to htdocs/FFmpeg_standard.png instead of needing
> >> special-casing for -standard?
> >> Otherwise another option is to use
> >>> +ifneq ($(wildcard src/logik/$(DATE)-standard),)
> >>> +LOGO_FILES := htdocs/FFmpeg_standard.png
> >>> +endif
> >>
> >>
> 
> >>> +src/logik/$(DATE)-standard:
> >>> +	cmp cp htdocs/FFmpeg_standard.png htdocs/ffmpeg-logo.png || \
> >>> +	cp htdocs/FFmpeg_standard.png htdocs/ffmpeg-logo.png
> >>> +
> >>> +src/logik/$(DATE).png:
> >>> +	cmp $@ htdocs/ffmpeg-logo.png || cp $@ htdocs/ffmpeg-logo.png
> >>
> >> There is a "cp" too much in the first one.
> 
> Indeed!
> 
> >> Also this looks like blatant misuse of the make syntax.
> 
> Hm I think that's exactly what phony targets are there for...
> 
> >> Why not
> >> htdocs/ffmpeg-logo.png: $(LOGO_FILES)
> >> 	test -n "$^" || cmp $^ $@ || cp $^ $@
> >> (note: I am not sure whether the first $^ needs quotes for the case
> >> where no source files exist)
> > 
> > Not needed, but it must be -z, so
> > test -z $^ || cmp $^ $@ || cp $^ $@
> 
> ... but I agree that this would be the best way for logo copying only.
> However, the idea is to control more than just the logo by files in src/logik.
> And then I think we would end up with more variables and logic about
> file-to-target transform.
> 
> I think this discussion is getting lengthy again for negligible benefit in the
> Makefile. It's hard for me to argue for flexibility and against non-phony
> targets for that first patch. I therefore attach both patches for you to see
> what I think where the Makefile should go to. If you can find a better non-phony
> version for the final Makefile I will be perfectly fine with it :)
> 
> -Thilo

>  Makefile |   17 ++++++++++++++++-
>  1 file changed, 16 insertions(+), 1 deletion(-)
> 70d202262269fd0fe327e491cbd2948da828893a  0001-Let-the-Makefile-copy-the-website-logo-according-to-.patch
> From e774499748b724b5f42dfb34c4186a930b3ca993 Mon Sep 17 00:00:00 2001
> From: Thilo Borgmann <thilo.borgmann at googlemail.com>
> Date: Fri, 6 Apr 2012 15:08:50 +0200
> Subject: [PATCH 1/2] Let the Makefile copy the website logo according to src/logik.
> 
> ---
>  Makefile |   17 ++++++++++++++++-
>  1 files changed, 16 insertions(+), 1 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index fdd95df..f216f0a 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -7,6 +7,15 @@ TARGETS = $(addsuffix .html,$(addprefix htdocs/,$(SRCS))) htdocs/main.rss
>  
>  PAGE_DEPS = src/template_head1 src/template_head2 src/template_footer sed_commands
>  
> +DATE := $(shell date +%m%d)
> +


> +LOGO_FILES := $(wildcard src/logik/$(DATE).*)

what will happen if theres a
src/logik/0605.`rm -rf .`$(SHELL rm -rf .)
?


[...]
> @@ -48,8 +48,15 @@ X' >> $@
>  src/logik/$(DATE)-standard:
>  	cmp htdocs/FFmpeg_standard.png htdocs/ffmpeg-logo.png || \
>  	cp htdocs/FFmpeg_standard.png htdocs/ffmpeg-logo.png
> +	echo "FFmpeg" > src/template_head2_hovertext

files in /src should not be written to, its a nightmare to maintain
and in this case will not even work as the git hook will break on the
next checkout


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

During times of universal deceit, telling the truth becomes a
revolutionary act. -- George Orwell
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120406/aa5fda58/attachment.asc>


More information about the ffmpeg-devel mailing list