Monday, January 31, 2022

Re: www/purritobin: @sample files (Was Re: [update] net/usockets-0.8.1, www/uwebsockets-20.8.0, www/purritobin-0.6.7)

aisha <openbsd.ports@aisha.cc> writes:

>> [...]
>> Index: patches/patch-frontend_index_html
>> ===================================================================
>> RCS file: patches/patch-frontend_index_html
>> diff -N patches/patch-frontend_index_html
>> --- /dev/null 1 Jan 1970 00:00:00 -0000
>> +++ patches/patch-frontend_index_html 31 Jan 2022 13:14:59 -0000
>> @@ -0,0 +1,14 @@
>> +$OpenBSD$
>> +
>> +Index: frontend/index.html
>> +--- frontend/index.html.orig
>> ++++ frontend/index.html
>> +@@ -26,7 +26,7 @@
>> + the pasting website in its headers.
>> + Look at the man page for an example.
>> + */
>> +- var PURRITOBIN_URL = "https://bsd.ac:42069";
>> ++ var PURRITOBIN_URL = location.protocol+"//"+location.host+":42069";
>> +
>
> Oh, this is quite nice!
> I'll add this patch in the repo too!
>
> It should hopefully be fine for this small patch to be in the tree for now.

thanks! :)

>> [...]
>> +@owner
>> +@group
>> +share/PurritoBin/
>> +share/PurritoBin/POSIX_shell_client.sh
>> +share/PurritoBin/about.html
>> +@sample /var/www/purritobin/about.html
>> +share/PurritoBin/index.html
>> +@sample /var/www/purritobin/index.html
>> +share/PurritoBin/paste.html
>> +@sample /var/www/purritobin/paste.html
>>
>
> Regarding the bottom sample, the concept and change is fine but I don't understand it fully.
> Does it automagically copy the files from share/ to /var/www/ ?
>
> I read the @sample explanation in porting topics but this doesn't seem to be applicable there (its not under /share/examples).

you can @sample files pretty much where you want, just grep for @sample
for some examples (at the moment I don't have an example in mind, but
I'm sure it's done on various other ports.)

The idea is that this way the original file are stored somewhere in
/usr/local/, completely under the control of pkg_add, but upon
installation are automatically copied to another place. Then, if the
user don't change it, upon upgrade the files are replaced with a new
version. It's intended for configuration files mostly (you don't want
your tweaked configuration to be replaced upon every update, don't you?
:D) but it's really useful for these kinds of stuff too.

No comments:

Post a Comment