We missed to update `scripts/version-bump` for Meson and so `meson.build` still thought we are about to release Geany 1.38 :smile:. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/3599
-- Commit Summary --
* Update meson.build also on version bumps
-- File Changes --
M meson.build (2) M scripts/version-bump (1)
-- Patch Links --
https://github.com/geany/geany/pull/3599.patch https://github.com/geany/geany/pull/3599.diff
@kugel- commented on this pull request.
@@ -23,6 +23,7 @@ s/^(#define VER_FILEVERSION_STR *)[^ ].*$/\1"'"$VER"'"/
' -i geany_private.rc
sed -e 's/^(AC_INIT([^,]*, *[)[^]]*(],)/\1'"$VER"'\2/' -i configure.ac +sed -e 's/^( *version: *)[^,]*(,)/\1'"'$VER'"'\2/' -i meson.build
Rather greedy. For OK, but I *will* add another line that matches one day or another.
@kugel- approved this pull request.
@eht16 commented on this pull request.
@@ -23,6 +23,7 @@ s/^(#define VER_FILEVERSION_STR *)[^ ].*$/\1"'"$VER"'"/
' -i geany_private.rc
sed -e 's/^(AC_INIT([^,]*, *[)[^]]*(],)/\1'"$VER"'\2/' -i configure.ac +sed -e 's/^( *version: *)[^,]*(,)/\1'"'$VER'"'\2/' -i meson.build
True. I tried two things already but failed: - include the single quotes in the groups in the regex but failed badly on the proper quoting for shell and sed of single quotes within a single quoted string :( - tried to define the Geany version as variable in `meson.build` but Meson has a strict policy that the `project()` must be the very the first instruction in the file. Newer versions of Meson can read the version within the `project()` call from a command which would give more flexibility but we require an older version which does not support this.
Anyway, I also think this is OK for now. It is "just" the version-bump script which we use only manually and will notice when the regex fails at some later point and can adjust it when needed.
What about simply adding a `q` command after the first replacement so only that one is handled?
Le 15 octobre 2023 10:05:04 GMT+02:00, "Enrico Tröger" ***@***.***> a écrit :
@eht16 commented on this pull request.
@@ -23,6 +23,7 @@ s/^(#define VER_FILEVERSION_STR *)[^ ].*$/\1"'"$VER"'"/
' -i geany_private.rc
sed -e 's/^(AC_INIT([^,]*, *[)[^]]*(],)/\1'"$VER"'\2/' -i configure.ac +sed -e 's/^( *version: *)[^,]*(,)/\1'"'$VER'"'\2/' -i meson.build
True. I tried two things already but failed:
- include the single quotes in the groups in the regex but failed badly on the proper quoting for shell and sed of single quotes within a single quoted string :(
- tried to define the Geany version as variable in `meson.build` but Meson has a strict policy that the `project()` must be the very the first instruction in the file. Newer versions of Meson can read the version within the `project()` call from a command which would give more flexibility but we require an older version which does not support this.
Anyway, I also think this is OK for now. It is "just" the version-bump script which we use only manually and will notice when the regex fails at some later point and can adjust it when needed.
-- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/3599#discussion_r1359807460 You are receiving this because you are subscribed to this thread.
Message ID: ***@***.***>
What about simply adding a `q` command after the first replacement so only that one is handled?
I don't know how to do, my sed skills are still on a beginner level and I guess this will remain so :). Tried: `sed -e 's/^( *version: *)[^,]*(,)/\1'"'$VER'"'\2/;q' -i meson.build` but then `sed` stops any processing directly after the first line and since we modify the file inline, `meson.build` only has its first line left.
Then I tried: `sed -e 's/^( *version: *)[^,]*(,)/\1'"'$VER'"'\2/1' -i meson.build` which should, to my understanding, replace only the first match of the regex and then stop. In my tests, it replaced multiple matches anyway.
After all, I think this is a rather small problem and once it occurs, we can handle it. Again, it is only the version-bump script.
@dolik-rce commented on this pull request.
@@ -23,6 +23,7 @@ s/^(#define VER_FILEVERSION_STR *)[^ ].*$/\1"'"$VER"'"/
' -i geany_private.rc
sed -e 's/^(AC_INIT([^,]*, *[)[^]]*(],)/\1'"$VER"'\2/' -i configure.ac +sed -e 's/^( *version: *)[^,]*(,)/\1'"'$VER'"'\2/' -i meson.build
I'm not sure if I understand correctly what you would like from this `sed` to do, but here is a very strictly matching version: ```suggestion sed -e '1,/^\s*version:\s*/ s/^(\s*version:\s*''')[^''']*(.*)/\1'"$VER"'\2/' -i meson.build ``` It will match: - only the very first line containing `version:` - it requires it to be followed be single-quoted string
@b4n commented on this pull request.
@@ -23,6 +23,7 @@ s/^(#define VER_FILEVERSION_STR *)[^ ].*$/\1"'"$VER"'"/
' -i geany_private.rc
sed -e 's/^(AC_INIT([^,]*, *[)[^]]*(],)/\1'"$VER"'\2/' -i configure.ac +sed -e 's/^( *version: *)[^,]*(,)/\1'"'$VER'"'\2/' -i meson.build
…or: ```suggestion sed -re '/^project\W/,/[)]/s/^(.*\Wversion\s*:\s*)'''[^''']*'''(.*)$/\1'"'$VER'"'\2/' -i meson.build ```
Which should match only the single-quoted value of `version` inside `project()`.
Whichever you like best.
@eht16 pushed 1 commit.
ec30b893a7f4a1ef747bbca3ab047bbbca678ff2 Update scripts/version-bump
@eht16 commented on this pull request.
@@ -23,6 +23,7 @@ s/^(#define VER_FILEVERSION_STR *)[^ ].*$/\1"'"$VER"'"/
' -i geany_private.rc
sed -e 's/^(AC_INIT([^,]*, *[)[^]]*(],)/\1'"$VER"'\2/' -i configure.ac +sed -e 's/^( *version: *)[^,]*(,)/\1'"'$VER'"'\2/' -i meson.build
Thank you both, @dolik-rce and @b4n. I comitted @b4n's version which is probably future safe enough by including the "project" additionally.
Could at least the part setting the version in meson.build to "2.0" be merged? geany-plugins now depend on 2.0 and this prevents a successful build when meson is used for Geany.
(I'd like to test if everything is alright for the macOS build before the release.)
@b4n commented on this pull request.
@@ -23,6 +23,7 @@ s/^(#define VER_FILEVERSION_STR *)[^ ].*$/\1"'"$VER"'"/
' -i geany_private.rc
sed -e 's/^(AC_INIT([^,]*, *[)[^]]*(],)/\1'"$VER"'\2/' -i configure.ac +sed -e 's/^( *version: *)[^,]*(,)/\1'"'$VER'"'\2/' -i meson.build
@dolik-rce would have been just as fine as IIUC project() has to be the first thing in the file anyway. Hopefully my version won't break too soon :laughing:
@b4n approved this pull request.
WFM
OK to merge so I can test the full macOS build + bundling tomorrow?
Merged #3599 into master.
github-comments@lists.geany.org