[Freedombox-discuss] Unforgivable Hacks for AGPL Compliance
This Makefile regenerates packages pretty much frequently. I'm not sure,
but I'm concerned it might lead to a race condition where someone
downloading the package could download a corrupt file if it copies the file
while it's beeing partially written. Does the file system or webserver or
something else provide some kind of lock to avoid reading a partially but
not completely re-written file ?
On Tue, Apr 23, 2013 at 10:51 PM, Nick M. Daly <nick.m.daly at gmail.com>wrote:
> Thought you folks might like this one. I'm so sorry, Bdale :)
> AGPL3 compliance isn't simple, but we can make it better by making
> compliance easier. The trick seems to involve making it trivial to
> publish your changes: if it's any work at all, people won't do it.
> Therefore, publishing your changes must automatically be part of
> publishing your project.
> With that, I give you a simple makefile recipe for self-publishing both
> the project's entire history and the current version of any project.
> You can start the process by running:
> : $ make hosting
> The actual makefile juju is below. May the gods forgive me for
> inflicting recursive makefiles upon the world:
> : SLEEP_TIME=300
> : ALL_BUT_GZ=$(subst $(wildcard *.tar.gz),,$(wildcard *))
> : EXCLUDES=--exclude=*.tar.gz --exclude=*~ --exclude=my-private-data/
> : # start hosting the project
> : hosting:
> : ./start.sh 8080 &
> : while [ 1 ]; do make current-checkout.tar.gz
> current-repository.tar.gz; sleep $(SLEEP_TIME); done
> : # publish the current version of the project
> : current-checkout.tar.gz: $(ALL_BUT_GZ)
> : tar cz $(EXCLUDES) * > current-checkout.tar.gz
> : # publish the project and all the history
> : current-repository.tar.gz: $(ALL_BUT_GZ)
> : tar cz $(EXCLUDES) * .git > current-repository.tar.gz
> You'll need to modify the EXCLUDES and the included revision control
> directory (on the last line) as necessary, but that's it.
> It appears to be bash and dash compliant, meaning that the recipe should
> be fit for including into init scripts, if something this ridiculous can
> be permitted.
> Freedombox-discuss mailing list
> Freedombox-discuss at lists.alioth.debian.org
-------------- next part --------------
An HTML attachment was scrubbed...