lists.geany.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
List overview
Commits
October 2019
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
commits@lists.geany.org
1 participants
94 discussions
Start a n
N
ew thread
[geany/infrastructure] 0915e3: irclog.py: Handle missing log file and add a dummy log message
by Enrico Tröger
22 Oct '19
22 Oct '19
Branch: refs/heads/master Author: Enrico Tröger <enrico.troeger(a)uvena.de> Committer: Enrico Tröger <enrico.troeger(a)uvena.de> Date: Tue, 22 Oct 2019 20:35:53 UTC Commit: 0915e3887af0d72b1b3726986fba02ee6be92126
https://github.com/geany/infrastructure/commit/0915e3887af0d72b1b3726986fba…
Log Message: ----------- irclog.py: Handle missing log file and add a dummy log message Closes #6. Modified Paths: -------------- scripts/irclog.py Modified: scripts/irclog.py 19 lines changed, 15 insertions(+), 4 deletions(-) =================================================================== @@ -7,6 +7,7 @@ # License: GPLv2 # +from os.path import exists from html.entities import entitydefs from time import ctime import datetime @@ -209,7 +210,7 @@ def _setup_entity_definitions(self): # ---------------------------------------------------------------------- def format(self): - self._get_contents(self._input_filename) + self._get_contents() content = self._create_table() if self._output_filename == '-': date = '' @@ -229,9 +230,19 @@ def format(self): output_file.write(output) # ---------------------------------------------------------------------- - def _get_contents(self, file_name): - with open(file_name) as file_handle: - self._log_lines = list() + def _get_contents(self): + self._log_lines = list() + if not exists(self._input_filename): + # the logfile is missing after rotation and before Supybot has flushed the + # current log to disk, so use a dummy log message + entry = LogEntry() + entry.date = datetime.datetime.now() + entry.nick = 'SweetGeany' + entry.msg = 'Nothing has been logged yet' + self._log_lines.append(entry) + return + + with open(self._input_filename) as file_handle: for line in file_handle: match = REGEXP_MSG.match(line) if match and len(match.groups()) == 8: -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-osx] a9b5e5: Make sure we use the right case when looking for locale
by Jiří Techet
22 Oct '19
22 Oct '19
Branch: refs/heads/master Author: Jiří Techet <techet(a)gmail.com> Committer: Jiří Techet <techet(a)gmail.com> Date: Tue, 22 Oct 2019 17:24:44 UTC Commit: a9b5e5a91e0b66dee7edac956b5edd6a9b4c5951
https://github.com/geany/geany-osx/commit/a9b5e5a91e0b66dee7edac956b5edd6a9…
Log Message: ----------- Make sure we use the right case when looking for locale Modified Paths: -------------- LauncherGtk3/geany/geany/main.m Modified: LauncherGtk3/geany/geany/main.m 4 lines changed, 2 insertions(+), 2 deletions(-) =================================================================== @@ -22,12 +22,12 @@ NSString *lang; NSArray<NSString *> *comps = [lng componentsSeparatedByString:@"-"]; if (comps.count > 1) { - lang = [NSString stringWithFormat:@"%@_%@", comps[0], comps[1]]; + lang = [NSString stringWithFormat:@"%@_%@", [comps[0] lowercaseString], [comps[1] uppercaseString]]; NSString *path = [NSString stringWithFormat:@"%@/locale/%@", bundle_data, lang]; found = [[NSFileManager defaultManager] fileExistsAtPath:path]; } if (!found && comps.count > 0) { - NSString *lng = comps[0]; + NSString *lng = [comps[0] lowercaseString]; NSString *path = [NSString stringWithFormat:@"%@/locale/%@", bundle_data, lng]; found = [[NSFileManager defaultManager] fileExistsAtPath:path]; if (found && comps.count == 1) { -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-osx] bdde32: Add gtk-key-theme-name=Mac to be sure it's set
by Jiří Techet
22 Oct '19
22 Oct '19
Branch: refs/heads/master Author: Jiří Techet <techet(a)gmail.com> Committer: Jiří Techet <techet(a)gmail.com> Date: Tue, 22 Oct 2019 17:24:17 UTC Commit: bdde325753006c09930aa93eed367459b31dc84f
https://github.com/geany/geany-osx/commit/bdde325753006c09930aa93eed367459b…
Log Message: ----------- Add gtk-key-theme-name=Mac to be sure it's set Modified Paths: -------------- settings.ini Modified: settings.ini 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -1,4 +1,4 @@ [Settings] gtk-icon-theme-name=Papirus gtk-theme-name=Mojave-light-solid - +gtk-key-theme-name=Mac -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-osx] ea173c: Add locales for more packages
by Jiří Techet
22 Oct '19
22 Oct '19
Branch: refs/heads/master Author: Jiří Techet <techet(a)gmail.com> Committer: Jiří Techet <techet(a)gmail.com> Date: Tue, 22 Oct 2019 17:08:53 UTC Commit: ea173c555947b48faafc906d5034fb2a486b399a
https://github.com/geany/geany-osx/commit/ea173c555947b48faafc906d5034fb2a4…
Log Message: ----------- Add locales for more packages Modified Paths: -------------- geany-gtk3.bundle Modified: geany-gtk3.bundle 15 lines changed, 15 insertions(+), 0 deletions(-) =================================================================== @@ -85,9 +85,24 @@ want to copy in to the bundle. The "dest" attribute is optional, as usual. Bundler will find all translations of that library/program under the indicated directory and copy them.--> + <translations name="glib20"> + ${prefix}/share/locale + </translations> + <translations name="atk10"> + ${prefix}/share/locale + </translations> <translations name="gtk30"> ${prefix}/share/locale </translations> + <translations name="gdk-pixbuf"> + ${prefix}/share/locale + </translations> + <translations name="gtk30-properties"> + ${prefix}/share/locale + </translations> + <translations name="gtk-mac-integration"> + ${prefix}/share/locale + </translations> <translations name="vte-2.91"> ${prefix}/share/locale </translations> -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-osx] 38c2b3: Minor launcher improvements
by Jiří Techet
22 Oct '19
22 Oct '19
Branch: refs/heads/master Author: Jiří Techet <techet(a)gmail.com> Committer: Jiří Techet <techet(a)gmail.com> Date: Tue, 22 Oct 2019 15:48:17 UTC Commit: 38c2b3f4b0eeed7a14e5331608f5bf136e333884
https://github.com/geany/geany-osx/commit/38c2b3f4b0eeed7a14e5331608f5bf136…
Log Message: ----------- Minor launcher improvements Modified Paths: -------------- LauncherGtk3/geany/geany/main.m Modified: LauncherGtk3/geany/geany/main.m 10 lines changed, 5 insertions(+), 5 deletions(-) =================================================================== @@ -4,9 +4,9 @@ */ #import <Foundation/Foundation.h> -#include <dlfcn.h> -#define MAX_ARR_SIZE 100 +#include <dlfcn.h> +#include <limits.h> static NSString *get_locale(NSString *bundle_data) { NSString *fallback = @"en_US.UTF-8"; @@ -55,7 +55,7 @@ static int fill_argv_array(const char *arr[], NSArray<NSString *> *array) { for (NSString *value in array) { arr[i] = [value UTF8String]; i++; - if (i == MAX_ARR_SIZE - 1) { + if (i == ARG_MAX - 1) { break; } } @@ -95,7 +95,7 @@ static int run_geany() { @"LC_ALL": lang, //Geany variables - @"GEANY_PLUGINS_SHARE_PATH": [bundle_res stringByAppendingPathComponent: @"share/geany-plugins"], + @"GEANY_PLUGINS_SHARE_PATH": [bundle_data stringByAppendingPathComponent: @"geany-plugins"], @"ENCHANT_MODULE_PATH": [bundle_lib stringByAppendingPathComponent: @"enchant"], @"GIO_MODULE_DIR": [bundle_lib stringByAppendingPathComponent: @"gio/modules"], }; @@ -119,7 +119,7 @@ static int run_geany() { export_env_array(env); - const char *argv[MAX_ARR_SIZE]; + const char *argv[ARG_MAX]; int argc = fill_argv_array(argv, args); /* -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-osx] a72362: Load libgeany using dlopen() instead of using exec() to run Geany
by Jiří Techet
21 Oct '19
21 Oct '19
Branch: refs/heads/master Author: Jiří Techet <techet(a)gmail.com> Committer: Jiří Techet <techet(a)gmail.com> Date: Mon, 21 Oct 2019 19:55:00 UTC Commit: a7236208827453dc83bcb943b0db686ee931b977
https://github.com/geany/geany-osx/commit/a7236208827453dc83bcb943b0db686ee…
Log Message: ----------- Load libgeany using dlopen() instead of using exec() to run Geany macOS Catalina apparently doesn't like when we first run the launcher, which sets environment variables, and from it run Geany using exec(). It confuses the dock and finder which think Geany isn't running and when opening a file, they create a new instance of Geany. Instead of using the binary as a launcher, we can just replace Geany's main binary and call the libgeany's main_lib() by ourselves. However, statically linking the library doesn't work as the environment variables are set too late (the libraries are already loaded and upon loading they read the old values). Therefore, we have to load libgeany dynamically using dlopen(). Modified Paths: -------------- LauncherGtk3/geany/geany/main.m Modified: LauncherGtk3/geany/geany/main.m 69 lines changed, 40 insertions(+), 29 deletions(-) =================================================================== @@ -1,4 +1,10 @@ +/* + can also be compiled using + clang -fobjc-arc $OBJCFLAGS $LDFLAGS -framework Foundation -framework Cocoa LauncherGtk3/geany/geany/main.m -o geany + */ + #import <Foundation/Foundation.h> +#include <dlfcn.h> #define MAX_ARR_SIZE 100 @@ -37,21 +43,14 @@ } -static void fill_env_array(const char *arr[], NSDictionary<NSString *, NSString *> *dict) { - int i = 0; +static void export_env_array(NSDictionary<NSString *, NSString *> *dict) { for (NSString *key in dict) { - NSString *var = [NSString stringWithFormat:@"%@=%@", key, dict[key]]; - arr[i] = [var UTF8String]; - i++; - if (i == MAX_ARR_SIZE - 1) { - break; - } + setenv([key UTF8String], [dict[key] UTF8String], 1); } - arr[i] = NULL; } -static void fill_argv_array(const char *arr[], NSArray<NSString *> *array) { +static int fill_argv_array(const char *arr[], NSArray<NSString *> *array) { int i = 0; for (NSString *value in array) { arr[i] = [value UTF8String]; @@ -61,10 +60,11 @@ static void fill_argv_array(const char *arr[], NSArray<NSString *> *array) { } } arr[i] = NULL; + return i; } -static void run_geany() { +static int run_geany() { NSString *bundle_dir = [[NSBundle mainBundle] bundlePath]; NSString *bundle_contents = [bundle_dir stringByAppendingPathComponent: @"Contents"]; @@ -77,8 +77,7 @@ static void run_geany() { //set environment variables //see
https://developer.gnome.org/gtk3/stable/gtk-running.html
- NSMutableDictionary<NSString *, NSString *> *env = [[[NSProcessInfo processInfo] environment] mutableCopy]; - NSDictionary<NSString *, NSString *> *env2 = @{ + NSDictionary<NSString *, NSString *> *env = @{ @"XDG_CONFIG_DIRS": bundle_etc, @"XDG_DATA_DIRS": bundle_data, @@ -100,12 +99,9 @@ static void run_geany() { @"ENCHANT_MODULE_PATH": [bundle_lib stringByAppendingPathComponent: @"enchant"], @"GIO_MODULE_DIR": [bundle_lib stringByAppendingPathComponent: @"gio/modules"], }; - [env addEntriesFromDictionary: env2]; //set binary name and command line arguments - NSArray<NSString *> *argv = NSProcessInfo.processInfo.arguments; - NSString *binary = [argv[0] stringByAppendingString:@"-bin"]; - NSMutableArray<NSString *> *args = [argv mutableCopy]; + NSMutableArray<NSString *> *args = [NSProcessInfo.processInfo.arguments mutableCopy]; if (args.count > 1 && [args[1] hasPrefix:@"-psn_"]) { [args removeObjectAtIndex: 1]; @@ -119,25 +115,40 @@ static void run_geany() { [args removeObject:verbose_param]; NSLog(@"env: %@", env); NSLog(@"argv: %@", args); - NSLog(@"executable: %@", binary); } - const char *envp[MAX_ARR_SIZE]; - fill_env_array(envp, env); + export_env_array(env); - const char *argp[MAX_ARR_SIZE]; - fill_argv_array(argp, args); - - execve([binary UTF8String], (char * const *)argp, (char * const *)envp); + const char *argv[MAX_ARR_SIZE]; + int argc = fill_argv_array(argv, args); + + /* + We need to load libgeany dynamically - if we loaded it statically, it would have + been loaded by now already and the environment variables above would be set + too late (apparently they are read already when some of the libraries are loading) + */ + int ret = 1; + void *lib_handle = dlopen([[bundle_lib stringByAppendingPathComponent:@"libgeany.0.dylib"] UTF8String], RTLD_LAZY|RTLD_GLOBAL); + if (lib_handle) { + int (*main_lib)(int, char**) = dlsym(lib_handle, "main_lib"); + if (main_lib) { + ret = main_lib(argc, (char **)argv); + } + else { + NSLog(@"dlsym() failed"); + } + dlclose(lib_handle); + } + else { + NSLog(@"dlopen() failed"); + } - //should never reach this - NSLog(@"execve() failed"); + return ret; } -int main(int argc, const char * argv[]) { +int main(int argc, const char *argv[]) { @autoreleasepool { - run_geany(); + return run_geany(); } - return 1; } -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-osx] 6f71ec: Further configurable shell fixes
by Jiří Techet
20 Oct '19
20 Oct '19
Branch: refs/heads/master Author: Jiří Techet <techet(a)gmail.com> Committer: Jiří Techet <techet(a)gmail.com> Date: Sun, 20 Oct 2019 11:02:56 UTC Commit: 6f71ec99ec3f74a646429c525c5c80c59d9d89dd
https://github.com/geany/geany-osx/commit/6f71ec99ec3f74a646429c525c5c80c59…
Log Message: ----------- Further configurable shell fixes Modified Paths: -------------- patches/01-geany_config_shell.patch Modified: patches/01-geany_config_shell.patch 30 lines changed, 20 insertions(+), 10 deletions(-) =================================================================== @@ -1,4 +1,4 @@ -From e69a91be45c1b92ff4b75f28bb2515507cc72c7e Mon Sep 17 00:00:00 2001 +From 7ae8e240bb29d300d8343ad0166405cde76d3ec9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Techet?= <techet(a)gmail.com> Date: Wed, 16 Oct 2019 13:21:45 -0700 Subject: [PATCH] Make the shell used by Geany to run various commands @@ -19,8 +19,6 @@ The affected places where we used hard-coded /bin/sh are: On macOS, the shell defaults to /bin/bash, on other systems to /bin/sh. ----- - Use /bin/sh in some cases 1. Use /bin/sh as the default value of the terminal command - it's @@ -32,8 +30,6 @@ and this way we can be sure it's run using compatible shell. Also remove the shebang at the beginning of the launch script - we never run it directory, only as a paramter of a shell command so it's useless. ----- - Make sure we run a shell as a login shell on macOS Unlike other unixes, macOS runs shell inside the Terminal app as a login @@ -45,14 +41,14 @@ loaded. All the shels supported by Geany have the -l option. --- data/geany.glade | 44 +++++++++++++++++++++++++++++++++++++++++++- - src/build.c | 20 +++++++++++++++----- + src/build.c | 26 ++++++++++++++++++++------ src/keyfile.c | 22 ++++++++++++++-------- src/prefs.c | 13 ++++++++++++- src/prefs.h | 10 ++++++++++ src/printing.c | 11 +++++++++-- src/utils.c | 10 ++++++++++ src/utils.h | 2 ++ - 8 files changed, 115 insertions(+), 17 deletions(-) + 8 files changed, 120 insertions(+), 18 deletions(-) diff --git a/data/geany.glade b/data/geany.glade index 3864a0ad1..5fef5c4b0 100644 @@ -127,7 +123,7 @@ index 3864a0ad1..5fef5c4b0 100644 <packing> <property name="expand">False</property> diff --git a/src/build.c b/src/build.c -index 4c9f4ebb2..06346c465 100644 +index 4c9f4ebb2..aa811fc60 100644 --- a/src/build.c +++ b/src/build.c @@ -772,7 +772,13 @@ static gchar *build_replace_placeholder(const GeanyDocument *doc, const gchar *s @@ -145,7 +141,21 @@ index 4c9f4ebb2..06346c465 100644 gchar *working_dir; gchar *utf8_working_dir; gchar *cmd_string; -@@ -1160,10 +1166,14 @@ static gchar *build_create_shellscript(const gchar *working_dir, const gchar *cm +@@ -799,8 +805,12 @@ static void build_spawn_cmd(GeanyDocument *doc, const gchar *cmd, const gchar *d + + #ifdef G_OS_UNIX + cmd_string = utils_get_locale_from_utf8(cmd); +- argv[2] = cmd_string; + cmd = NULL; /* under Unix, use argv to start cmd via sh for compatibility */ ++# ifdef __APPLE__ ++ argv[3] = cmd_string; /* because of the extra -l argument */ ++# else ++ argv[2] = cmd_string; ++# endif + #else + /* Expand environment variables like %blah%. */ + cmd_string = win32_expand_environment_variables(cmd); +@@ -1160,10 +1170,14 @@ static gchar *build_create_shellscript(const gchar *working_dir, const gchar *cm escaped_dir = g_shell_quote(working_dir); str = g_strdup_printf( @@ -165,7 +175,7 @@ index 4c9f4ebb2..06346c465 100644 if (!g_file_set_contents(fname, str, -1, error)) diff --git a/src/keyfile.c b/src/keyfile.c -index a5f6e9dfd..1a46fb20c 100644 +index a5f6e9dfd..09b0f7414 100644 --- a/src/keyfile.c +++ b/src/keyfile.c @@ -98,6 +98,11 @@ -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-osx] ef9f31: Fix the Geany patch
by Jiří Techet
19 Oct '19
19 Oct '19
Branch: refs/heads/master Author: Jiří Techet <techet(a)gmail.com> Committer: Jiří Techet <techet(a)gmail.com> Date: Sat, 19 Oct 2019 18:31:54 UTC Commit: ef9f31e085012da0f6d3956a62db4d33c485cb1e
https://github.com/geany/geany-osx/commit/ef9f31e085012da0f6d3956a62db4d33c…
Log Message: ----------- Fix the Geany patch Modified Paths: -------------- patches/01-geany_config_shell.patch Modified: patches/01-geany_config_shell.patch 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -212,7 +212,7 @@ index a5f6e9dfd..1a46fb20c 100644 + /* run as a login shell as the macOS terminal app does this and users + * typically update their login shell configuration file */ + if (strstr(shell, "-l") == NULL) -+ SETPTR(vc->shell, g_strconcat(shell, " -l", NULL); ++ SETPTR(vc->shell, g_strconcat(shell, " -l", NULL)); +#endif vc->font = utils_get_setting_string(config, "VTE", "font", GEANY_DEFAULT_FONT_EDITOR); vc->scroll_on_key = utils_get_setting_boolean(config, "VTE", "scroll_on_key", TRUE); -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-osx] 08113c: Add Geany patch to make shell configurable
by Jiří Techet
19 Oct '19
19 Oct '19
Branch: refs/heads/master Author: Jiří Techet <techet(a)gmail.com> Committer: Jiří Techet <techet(a)gmail.com> Date: Sat, 19 Oct 2019 18:19:03 UTC Commit: 08113ceb5ae8fafdb7c6eec5c5d7d8468d1ded80
https://github.com/geany/geany-osx/commit/08113ceb5ae8fafdb7c6eec5c5d7d8468…
Log Message: ----------- Add Geany patch to make shell configurable Modified Paths: -------------- geany.modules patches/01-geany_config_shell.patch Modified: geany.modules 5 lines changed, 4 insertions(+), 1 deletions(-) =================================================================== @@ -167,7 +167,10 @@ <branch repo="
download.geany.org
" module="geany-${version}.tar.bz2" checkoutdir="geany-${version}" - version="1.36"/> + version="1.36"> + <!-- This patch corresponds to
https://github.com/geany/geany/pull/2363
--> + <patch file="
https://github.com/geany/geany-osx/raw/master/patches/01-geany_config_shell…
" strip="1" /> + </branch> <dependencies> <dep package="geany-deps-gtk3" /> </dependencies> Modified: patches/01-geany_config_shell.patch 368 lines changed, 368 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,368 @@ +From e69a91be45c1b92ff4b75f28bb2515507cc72c7e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ji=C5=99=C3=AD=20Techet?= <techet(a)gmail.com> +Date: Wed, 16 Oct 2019 13:21:45 -0700 +Subject: [PATCH] Make the shell used by Geany to run various commands + configurable + +Because each shell has its own configuration file which can contain +different environment settings, it is useful to be able to specify +which shell Geany should use. + +To limit the shells to only those we know that work with Geany, this +implementation only allows users to select from /bin/sh, /bin/bash and +/bin/zsh. More shells can be added in the future. + +The affected places where we used hard-coded /bin/sh are: +1. Running commands (in VTE or without, with launch script or without) +2. Build commands +3. Print command + +On macOS, the shell defaults to /bin/bash, on other systems to /bin/sh. + +---- + +Use /bin/sh in some cases + +1. Use /bin/sh as the default value of the terminal command - it's +configurable anyway +2. Use /bin/sh for running the launch script in VTE - the user already has +the environment variables set using the shell he uses for the terminal +and this way we can be sure it's run using compatible shell. + +Also remove the shebang at the beginning of the launch script - we never +run it directory, only as a paramter of a shell command so it's useless. + +---- + +Make sure we run a shell as a login shell on macOS + +Unlike other unixes, macOS runs shell inside the Terminal app as a login +shell. This means that most users put their environment variables into +e.g. .bash_profile instead of .bashrc like linux users. So if we wouldn't +run the shell as a login shell, user's environment variables wouldn't be +loaded. + +All the shels supported by Geany have the -l option. +--- + data/geany.glade | 44 +++++++++++++++++++++++++++++++++++++++++++- + src/build.c | 20 +++++++++++++++----- + src/keyfile.c | 22 ++++++++++++++-------- + src/prefs.c | 13 ++++++++++++- + src/prefs.h | 10 ++++++++++ + src/printing.c | 11 +++++++++-- + src/utils.c | 10 ++++++++++ + src/utils.h | 2 ++ + 8 files changed, 115 insertions(+), 17 deletions(-) + +diff --git a/data/geany.glade b/data/geany.glade +index 3864a0ad1..5fef5c4b0 100644 +--- a/data/geany.glade ++++ b/data/geany.glade +@@ -724,6 +724,12 @@ + </row> + </data> + </object> ++ <object class="GtkListStore" id="shell_list"> ++ <columns> ++ <!-- column-name text --> ++ <column type="gchararray"/> ++ </columns> ++ </object> + <object class="GtkListStore" id="tab_pos_list"> + <columns> + <!-- column-name item --> +@@ -4798,10 +4804,13 @@ + <object class="GtkTable" id="table1"> + <property name="visible">True</property> + <property name="can_focus">False</property> +- <property name="n_rows">3</property> ++ <property name="n_rows">4</property> + <property name="n_columns">3</property> + <property name="column_spacing">6</property> + <property name="row_spacing">3</property> ++ <child> ++ <placeholder/> ++ </child> + <child> + <object class="GtkLabel" id="label97"> + <property name="visible">True</property> +@@ -4960,6 +4969,39 @@ + <property name="y_options"/> + </packing> + </child> ++ <child> ++ <object class="GtkLabel" id="label27"> ++ <property name="visible">True</property> ++ <property name="can_focus">False</property> ++ <property name="xalign">0</property> ++ <property name="label" translatable="yes">Shell:</property> ++ </object> ++ <packing> ++ <property name="top_attach">3</property> ++ <property name="bottom_attach">4</property> ++ <property name="x_options">GTK_FILL</property> ++ <property name="y_options"/> ++ </packing> ++ </child> ++ <child> ++ <object class="GtkComboBox" id="combo_shell"> ++ <property name="visible">True</property> ++ <property name="can_focus">True</property> ++ <property name="model">shell_list</property> ++ <child> ++ <object class="GtkCellRendererText" id="cellrenderertext6"/> ++ <attributes> ++ <attribute name="text">0</attribute> ++ </attributes> ++ </child> ++ </object> ++ <packing> ++ <property name="left_attach">1</property> ++ <property name="right_attach">2</property> ++ <property name="top_attach">3</property> ++ <property name="bottom_attach">4</property> ++ </packing> ++ </child> + </object> + <packing> + <property name="expand">False</property> +diff --git a/src/build.c b/src/build.c +index 4c9f4ebb2..06346c465 100644 +--- a/src/build.c ++++ b/src/build.c +@@ -772,7 +772,13 @@ static gchar *build_replace_placeholder(const GeanyDocument *doc, const gchar *s + static void build_spawn_cmd(GeanyDocument *doc, const gchar *cmd, const gchar *dir) + { + GError *error = NULL; +- gchar *argv[] = { "/bin/sh", "-c", NULL, NULL }; ++ gchar *argv[] = { (gchar *)utils_get_shell_path(tool_prefs.shell), ++#ifdef __APPLE__ ++ /* run as a login shell as the macOS terminal app does this and users ++ * typically update their login shell configuration file */ ++ "-l", ++#endif ++ "-c", NULL, NULL }; + gchar *working_dir; + gchar *utf8_working_dir; + gchar *cmd_string; +@@ -1160,10 +1166,14 @@ static gchar *build_create_shellscript(const gchar *working_dir, const gchar *cm + + escaped_dir = g_shell_quote(working_dir); + str = g_strdup_printf( +- "#!/bin/sh\n\nrm $0\n\ncd %s\n\n%s\n\necho \"\n\n------------------\n(program exited with code: $?)\" \ +- \n\n%s\n", escaped_dir, cmd, (autoclose) ? "" : +- "\necho \"Press return to continue\"\n#to be more compatible with shells like " +- "dash\ndummy_var=\"\"\nread dummy_var"); ++ "rm $0\n\n" ++ "cd %s\n\n" ++ "%s\n\n" ++ "echo \"\n\n------------------\n(program exited with code: $?)\"\n\n" ++ "%s\n", ++ escaped_dir, cmd, (autoclose) ? "" : ++ "\necho \"Press return to continue\"\n#to be more compatible with shells like " ++ "dash\ndummy_var=\"\"\nread dummy_var"); + g_free(escaped_dir); + + if (!g_file_set_contents(fname, str, -1, error)) +diff --git a/src/keyfile.c b/src/keyfile.c +index a5f6e9dfd..1a46fb20c 100644 +--- a/src/keyfile.c ++++ b/src/keyfile.c +@@ -98,6 +98,11 @@ + #define GEANY_MAX_AUTOCOMPLETE_WORDS 30 + #define GEANY_MAX_SYMBOLS_UPDATE_FREQ 250 + #define GEANY_DEFAULT_FILETYPE_REGEX "-\\*-\\s*([^\\s]+)\\s*-\\*-" ++#ifdef __APPLE__ ++# define GEANY_DEFAULT_SHELL GEANY_SHELL_BASH ++#else ++# define GEANY_DEFAULT_SHELL GEANY_SHELL_SH ++#endif + + + static gchar *scribble_text = NULL; +@@ -523,6 +528,7 @@ static void save_dialog_prefs(GKeyFile *config) + g_key_file_set_string(config, "tools", "terminal_cmd", tool_prefs.term_cmd ? tool_prefs.term_cmd : ""); + g_key_file_set_string(config, "tools", "browser_cmd", tool_prefs.browser_cmd ? tool_prefs.browser_cmd : ""); + g_key_file_set_string(config, "tools", "grep_cmd", tool_prefs.grep_cmd ? tool_prefs.grep_cmd : ""); ++ g_key_file_set_integer(config, "tools", "shell", tool_prefs.shell); + g_key_file_set_string(config, PACKAGE, "context_action_cmd", tool_prefs.context_action_cmd); + + /* build menu */ +@@ -883,14 +889,7 @@ static void load_dialog_prefs(GKeyFile *config) + { + StashGroup *group; + struct passwd *pw = getpwuid(getuid()); +- const gchar *shell = (pw != NULL) ? pw->pw_shell : "/bin/sh"; +- +-#ifdef __APPLE__ +- /* Geany is started using launchd on OS X and we don't get any environment variables +- * so PS1 isn't defined. Start as a login shell to read the corresponding config files. */ +- if (strcmp(shell, "/bin/bash") == 0) +- shell = "/bin/bash -l"; +-#endif ++ const gchar *shell = (pw != NULL) ? pw->pw_shell : utils_get_shell_path(tool_prefs.shell); + + vc = g_new0(VteConfig, 1); + vte_info.dir = utils_get_setting_string(config, "VTE", "last_dir", NULL); +@@ -902,6 +901,12 @@ static void load_dialog_prefs(GKeyFile *config) + vte_info.dir = g_strdup("/"); + + vc->shell = utils_get_setting_string(config, "VTE", "shell", shell); ++#ifdef __APPLE__ ++ /* run as a login shell as the macOS terminal app does this and users ++ * typically update their login shell configuration file */ ++ if (strstr(shell, "-l") == NULL) ++ SETPTR(vc->shell, g_strconcat(shell, " -l", NULL); ++#endif + vc->font = utils_get_setting_string(config, "VTE", "font", GEANY_DEFAULT_FONT_EDITOR); + vc->scroll_on_key = utils_get_setting_boolean(config, "VTE", "scroll_on_key", TRUE); + vc->scroll_on_out = utils_get_setting_boolean(config, "VTE", "scroll_on_out", TRUE); +@@ -965,6 +970,7 @@ static void load_dialog_prefs(GKeyFile *config) + tool_prefs.term_cmd = cmd; + tool_prefs.browser_cmd = utils_get_setting_string(config, "tools", "browser_cmd", GEANY_DEFAULT_TOOLS_BROWSER); + tool_prefs.grep_cmd = utils_get_setting_string(config, "tools", "grep_cmd", GEANY_DEFAULT_TOOLS_GREP); ++ tool_prefs.shell = utils_get_setting_integer(config, "tools", "shell", GEANY_DEFAULT_SHELL); + + tool_prefs.context_action_cmd = utils_get_setting_string(config, PACKAGE, "context_action_cmd", ""); + +diff --git a/src/prefs.c b/src/prefs.c +index 5d1b5fc97..b2cd1ee4c 100644 +--- a/src/prefs.c ++++ b/src/prefs.c +@@ -683,6 +683,9 @@ static void prefs_init_dialog(void) + if (tool_prefs.grep_cmd) + gtk_entry_set_text(GTK_ENTRY(ui_lookup_widget(ui_widgets.prefs_dialog, "entry_grep")), tool_prefs.grep_cmd); + ++ widget = ui_lookup_widget(ui_widgets.prefs_dialog, "combo_shell"); ++ gtk_widget_set_tooltip_text(widget, _("Shell used at various places, e.g. to run compilers, execute commands, etc.")); ++ gtk_combo_box_set_active(GTK_COMBO_BOX(widget), tool_prefs.shell); + + /* Template settings */ + widget = ui_lookup_widget(ui_widgets.prefs_dialog, "entry_template_developer"); +@@ -1160,6 +1163,8 @@ on_prefs_dialog_response(GtkDialog *dialog, gint response, gpointer user_data) + g_free(tool_prefs.grep_cmd); + tool_prefs.grep_cmd = g_strdup(gtk_entry_get_text(GTK_ENTRY(widget))); + ++ widget = ui_lookup_widget(ui_widgets.prefs_dialog, "combo_shell"); ++ tool_prefs.shell = gtk_combo_box_get_active(GTK_COMBO_BOX(widget)); + + /* Template settings */ + widget = ui_lookup_widget(ui_widgets.prefs_dialog, "entry_template_developer"); +@@ -1655,7 +1660,7 @@ void prefs_show_dialog(void) + { + if (ui_widgets.prefs_dialog == NULL) + { +- GtkListStore *eol_list; ++ GtkListStore *eol_list, *shell_list; + GtkWidget *label; + + ui_widgets.prefs_dialog = create_prefs_dialog(); +@@ -1788,6 +1793,12 @@ void prefs_show_dialog(void) + GTK_FILE_CHOOSER_ACTION_OPEN, + GTK_ENTRY(ui_lookup_widget(ui_widgets.prefs_dialog, "entry_grep"))); + ++ /* init the shell combo box */ ++ shell_list = ui_builder_get_object("shell_list"); ++ list_store_append_text(shell_list, utils_get_shell_path(GEANY_SHELL_SH)); ++ list_store_append_text(shell_list, utils_get_shell_path(GEANY_SHELL_BASH)); ++ list_store_append_text(shell_list, utils_get_shell_path(GEANY_SHELL_ZSH)); ++ + /* tools commands */ + ui_setup_open_button_callback(ui_lookup_widget(ui_widgets.prefs_dialog, "button_contextaction"), + NULL, +diff --git a/src/prefs.h b/src/prefs.h +index dcf33a502..049c04478 100644 +--- a/src/prefs.h ++++ b/src/prefs.h +@@ -42,6 +42,15 @@ typedef struct GeanyPrefs + } + GeanyPrefs; + ++/** Shell types used for running commands */ ++typedef enum ++{ ++ GEANY_SHELL_SH = 0, /**< /bin/sh */ ++ GEANY_SHELL_BASH, /**< /bin/bash */ ++ GEANY_SHELL_ZSH, /**< /bin/zsh */ ++} ++GeanyShell; ++ + /** Tools preferences */ + typedef struct GeanyToolPrefs + { +@@ -49,6 +58,7 @@ typedef struct GeanyToolPrefs + gchar *term_cmd; /**< terminal emulator command */ + gchar *grep_cmd; /**< grep command */ + gchar *context_action_cmd; /**< context action command */ ++ GeanyShell shell; /**< shell used for running commands */ + } + GeanyToolPrefs; + +diff --git a/src/printing.c b/src/printing.c +index e974c6a85..c229f45ef 100644 +--- a/src/printing.c ++++ b/src/printing.c +@@ -41,6 +41,7 @@ + #include "support.h" + #include "utils.h" + #include "ui_utils.h" ++#include "prefs.h" + + #include <math.h> + #include <time.h> +@@ -599,10 +600,16 @@ static void print_external(GeanyDocument *doc) + doc->file_name, cmdline)) + { + GError *error = NULL; +- /* /bin/sh -c emulates the system() call and makes complex commands possible ++ /* $SHELL -c emulates the system() call and makes complex commands possible + * but only on non-win32 systems due to the lack of win32's shell capabilities */ + #ifdef G_OS_UNIX +- gchar *argv[] = { "/bin/sh", "-c", cmdline, NULL }; ++ gchar *argv[] = { (gchar *)utils_get_shell_path(tool_prefs.shell), ++ # ifdef __APPLE__ ++ /* run as a login shell as the macOS terminal app does this and users ++ * typically update their login shell configuration file */ ++ "-l", ++ # endif ++ "-c", cmdline, NULL }; + + if (!spawn_async(NULL, NULL, argv, NULL, NULL, &error)) + #else +diff --git a/src/utils.c b/src/utils.c +index 4e3788ad6..a1c84b6a4 100644 +--- a/src/utils.c ++++ b/src/utils.c +@@ -400,6 +400,16 @@ const gchar *utils_get_eol_char(gint eol_mode) + } + } + ++const gchar *utils_get_shell_path(gint shell_type) ++{ ++ switch (shell_type) ++ { ++ case GEANY_SHELL_BASH: return "/bin/bash"; break; ++ case GEANY_SHELL_ZSH: return "/bin/zsh"; break; ++ default: return "/bin/sh"; break; ++ } ++} ++ + + /* Converts line endings to @a target_eol_mode. */ + void utils_ensure_same_eol_characters(GString *string, gint target_eol_mode) +diff --git a/src/utils.h b/src/utils.h +index bdbe7bb27..2246a1995 100644 +--- a/src/utils.h ++++ b/src/utils.h +@@ -245,6 +245,8 @@ const gchar *utils_get_eol_name(gint eol_mode); + + const gchar *utils_get_eol_short_name(gint eol_mode); + ++const gchar *utils_get_shell_path(gint shell_type); ++ + gboolean utils_atob(const gchar *str); + + void utils_tidy_path(gchar *filename); +-- +2.17.1 + -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-osx] 3684fa: Bring Info.plist in sync with what XCode creates for new projects
by Jiří Techet
15 Oct '19
15 Oct '19
Branch: refs/heads/master Author: Jiří Techet <techet(a)gmail.com> Committer: Jiří Techet <techet(a)gmail.com> Date: Tue, 15 Oct 2019 17:44:38 UTC Commit: 3684fa9cf9bb5e1adf8f8208839ca449a1fa52d4
https://github.com/geany/geany-osx/commit/3684fa9cf9bb5e1adf8f8208839ca449a…
Log Message: ----------- Bring Info.plist in sync with what XCode creates for new projects Modified Paths: -------------- Info.plist Modified: Info.plist 6 lines changed, 4 insertions(+), 2 deletions(-) =================================================================== @@ -6,8 +6,6 @@ <string>1.36</string> <key>CFBundleVersion</key> <string>1.36</string> - <key>CFBundleGetInfoString</key> - <string>1.36 (C) 2019 The Geany Team,
https://www.geany.org
</string> <key>NSHumanReadableCopyright</key> <string>Copyright 2019 The Geany Team, GNU General Public License</string> @@ -33,6 +31,10 @@ <string>public.app-category.developer-tools</string> <key>NSHighResolutionCapable</key> <true/> + <key>CFBundleVersion</key> + <string>1</string> + <key>NSPrincipalClass</key> + <string>NSApplication</string> <!-- Register .geany extension in the system --> <key>UTExportedTypeDeclarations</key> -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
9
10
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
Results per page:
10
25
50
100
200