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 ?<br>
<br><div class="gmail_quote">On Tue, Apr 23, 2013 at 10:51 PM, Nick M. Daly <span dir="ltr"><<a href="mailto:nick.m.daly@gmail.com" target="_blank">nick.m.daly@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thought you folks might like this one.  I'm so sorry, Bdale :)<br>
<br>
AGPL3 compliance isn't simple, but we can make it better by making<br>
compliance easier.  The trick seems to involve making it trivial to<br>
publish your changes: if it's any work at all, people won't do it.<br>
Therefore, publishing your changes must automatically be part of<br>
publishing your project.<br>
<br>
With that, I give you a simple makefile recipe for self-publishing both<br>
the project's entire history and the current version of any project.<br>
You can start the process by running:<br>
<br>
: $ make hosting<br>
<br>
The actual makefile juju is below.  May the gods forgive me for<br>
inflicting recursive makefiles upon the world:<br>
<br>
: SLEEP_TIME=300<br>
: ALL_BUT_GZ=$(subst $(wildcard *.tar.gz),,$(wildcard *))<br>
: EXCLUDES=--exclude=*.tar.gz --exclude=*~ --exclude=my-private-data/<br>
:<br>
: # start hosting the project<br>
: hosting:<br>
:         ./start.sh 8080 &<br>
:         while [ 1 ]; do make current-checkout.tar.gz current-repository.tar.gz; sleep $(SLEEP_TIME); done<br>
:<br>
: # publish the current version of the project<br>
: current-checkout.tar.gz: $(ALL_BUT_GZ)<br>
:         tar cz $(EXCLUDES) * > current-checkout.tar.gz<br>
:<br>
: # publish the project and all the history<br>
: current-repository.tar.gz: $(ALL_BUT_GZ)<br>
:         tar cz $(EXCLUDES) * .git > current-repository.tar.gz<br>
<br>
You'll need to modify the EXCLUDES and the included revision control<br>
directory (on the last line) as necessary, but that's it.<br>
<br>
It appears to be bash and dash compliant, meaning that the recipe should<br>
be fit for including into init scripts, if something this ridiculous can<br>
be permitted.<br>
<span class="HOEnZb"><font color="#888888"><br>
Nick<br>
</font></span><br>_______________________________________________<br>
Freedombox-discuss mailing list<br>
<a href="mailto:Freedombox-discuss@lists.alioth.debian.org">Freedombox-discuss@lists.alioth.debian.org</a><br>
<a href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/freedombox-discuss" target="_blank">http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/freedombox-discuss</a><br></blockquote></div><br>