After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 626291 - Some patches
Some patches
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: VPN: openvpn
git master
Other Linux
: Normal normal
: ---
Assigned To: Dan Williams
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2010-08-07 02:31 UTC by Pablo Castellano (IRC: pablog)
Modified: 2015-02-25 14:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use g_str_has_suffix instead of strcmp to compare extensions (12.00 KB, patch)
2010-08-07 02:32 UTC, Pablo Castellano (IRC: pablog)
none Details | Review
Minor changes (12.13 KB, patch)
2010-08-07 02:33 UTC, Pablo Castellano (IRC: pablog)
committed Details | Review
Make error strings translatable (12.46 KB, patch)
2010-08-07 02:40 UTC, Pablo Castellano (IRC: pablog)
none Details | Review
get_args now returns nitems parameter and fixed memleaks (9.29 KB, patch)
2010-08-07 02:41 UTC, Pablo Castellano (IRC: pablog)
committed Details | Review
Use g_str_has_suffix instead of strcmp to compare extensions (good) (2.43 KB, patch)
2010-08-10 11:51 UTC, Pablo Castellano (IRC: pablog)
none Details | Review
Make error strings translatable (fixed _literal) (16.47 KB, patch)
2010-08-10 12:59 UTC, Pablo Castellano (IRC: pablog)
none Details | Review
Use g_str_has_suffix instead of strcmp to compare extensions (2.40 KB, patch)
2010-10-28 23:24 UTC, Pablo Castellano (IRC: pablog)
none Details | Review
Make error strings translatable (fixed _literal) v2 (16.91 KB, patch)
2010-10-28 23:24 UTC, Pablo Castellano (IRC: pablog)
none Details | Review

Description Pablo Castellano (IRC: pablog) 2010-08-07 02:31:29 UTC
Some patches to review
Comment 1 Pablo Castellano (IRC: pablog) 2010-08-07 02:32:02 UTC
Created attachment 167296 [details] [review]
Use g_str_has_suffix instead of strcmp to compare extensions
Comment 2 Pablo Castellano (IRC: pablog) 2010-08-07 02:33:18 UTC
Created attachment 167297 [details] [review]
Minor changes

 * Sort alphabetically constants and Makefile.am
 * Added a trailing space to the constants when needed
 * initialize have_sk before
 * fixed typo in tests
 * removed useless 'else' for default values
 * update .gitignore
Comment 3 Pablo Castellano (IRC: pablog) 2010-08-07 02:40:17 UTC
Created attachment 167298 [details] [review]
Make error strings translatable

These error strings are shown in dialogs
Comment 4 Pablo Castellano (IRC: pablog) 2010-08-07 02:41:26 UTC
Created attachment 167299 [details] [review]
get_args now returns nitems parameter and fixed memleaks

This patch avoids calling many times g_strv_length()
Comment 5 Dan Williams 2010-08-09 16:39:44 UTC
The first patch (Use g_str_has_suffix instead of strcmp to compare extensions) does not appear to be a patch; it looks like a VIM swapfile or something.  Could you re-attach with the actual patch?
Comment 6 Dan Williams 2010-08-09 16:41:59 UTC
The first patch (Use g_str_has_suffix instead of strcmp to compare extensions) does not appear to be a patch; it looks like a VIM swapfile or something.  Could you re-attach with the actual patch?
Comment 7 Dan Williams 2010-08-09 16:43:35 UTC
I've applied "Minor changes" except for the bits that remove the default args from openvpn.  The default args help protect against if/when openvpn changes defaults, and sometimes programs get their configuration information from other sources as well, and this helps ensure that openvpn only gets the configuration we want it to get.

2f7540f3d482e4fc53f5cdee2b23629eec97aca5
Comment 8 Dan Williams 2010-08-09 16:47:42 UTC
In the error string translation patch, could you update it to use g_set_error_literal() where you've removed the "%s" arguments?  Certain compiler options will complain if we pass a constant string to varags function in place of the format argument.  So, where the code was this:

g_set_error (error, X, X, "%s", "foobar");

instead it should be this:

g_set_error_literal (error, X, X, "foobar");


thanks!
Comment 9 Pablo Castellano (IRC: pablog) 2010-08-10 11:51:17 UTC
Created attachment 167503 [details] [review]
Use g_str_has_suffix instead of strcmp to compare extensions (good)
Comment 10 Pablo Castellano (IRC: pablog) 2010-08-10 12:59:04 UTC
Created attachment 167507 [details] [review]
Make error strings translatable (fixed _literal)

Here they are.
Comment 11 Pablo Castellano (IRC: pablog) 2010-08-31 13:40:00 UTC
Should I commit them now?

What about the g_strv_length one?
Comment 12 Dan Williams 2010-10-28 22:16:18 UTC
I fixed up the g_strv_length patch for current git and did a few formatting cleanups.  Pushed as:

0cfd6b966c80de0e689badedf9d6ad50dd355e4f
Comment 13 Dan Williams 2010-10-28 22:17:11 UTC
The g_str_has_prefix() patch looks good, though there's some odd formatting of the if() in tls_default_filter().
Comment 14 Dan Williams 2010-10-28 22:19:24 UTC
For the translations thing, one more fix: make sure you add any new translatable files to po/POTFILES.in, import-export.c is missing.  After that, I think its good to push to master. Thanks!
Comment 15 Pablo Castellano (IRC: pablog) 2010-10-28 23:24:02 UTC
Created attachment 173446 [details] [review]
Use g_str_has_suffix instead of strcmp to compare extensions

Good! Here they are.
Comment 16 Pablo Castellano (IRC: pablog) 2010-10-28 23:24:38 UTC
Created attachment 173447 [details] [review]
Make error strings translatable (fixed _literal) v2
Comment 17 Pablo Castellano (IRC: pablog) 2010-10-28 23:26:25 UTC
BTW: Is there any style guide about formatting if sentences? I have always had doubts...
Comment 18 Milan Bouchet-Valat 2012-01-18 09:34:48 UTC
Does that still apply to master?
Comment 19 Lubomir Rintel 2015-02-07 11:59:28 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.

f2936bb Make error strings translatable
08517dc Use g_str_has_suffix instead of strcmp to compare extensions

(In reply to comment #17)
> BTW: Is there any style guide about formatting if sentences? I have always had
> doubts...

Not really. The best advice so far is follow whatever you see used (which works as far as there are no conflicting uses...)