Re: [dev] [dmenu] versioning and patching

From: Boruch Baum <boruch_baum_AT_gmx.com>
Date: Tue, 15 Mar 2016 04:45:05 -0400

On 03/15/2016 04:14 AM, Boruch Baum wrote:
> On 03/15/2016 03:02 AM, Martin K├╝hne wrote:
>> how do you want to tell what patches have been applied? setting up the infrastructure for that would be ridiculously complex, since the codebase is anything but luxury in that regard and neither is the build tools that are used.
>> ffs, we use patch and make here, please tell me how are unified diffs supposed to extend an array of array of char to incrementally record what patches have been applied?
>>
>> cheers!
>> mar77i
>>
> How about this: ask each patched feature to add one line of code at the
> main level to append its description to a single suckless.org defined
> version_string variable, conceptually:
>
> version_string = version_string + newline +
> my_patch_description_with_version
>
> The vanilla version of dmenu (and other suckless tools) would add a
> uniform print function in response to a uniform command line parameter
> that would print the variable version_string and exit with a success
> exit code.
>
> A patched version of source with three patches would conceptually look
> like this:
>
> * original code
> * version_string defined
> PATCH3: version_string modified
> PATCH2: version_string modified
> PATCH1: version_string modified
> * version print function defined
> * more original code
> PATCH3: content of patch
> PATCH2: content of patch
> PATCH1: content of patch
>
> The patches are listed in reverse sequence order because that's what
> diff would come up with, anchoring the patch to original code.
>
> The definition and modification of the version_string need not be source
> code, but could be compile time macros.
>
_AT_myself: The 'correct' way would be to use compile-time macros. If
dmenu/suckless wants to go the way of compile-time macros, that's also
an alternative to keeping the code of the suckless/official patches
external to the dmenu source code file (Use a compile-time macro
'switch', just a set of IF/THENS based upon a compile-time variable).

-- 
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0
Received on Tue Mar 15 2016 - 09:45:05 CET

This archive was generated by hypermail 2.3.0 : Tue Mar 15 2016 - 09:48:10 CET