[PATCH] Make sure mkbundle executables work if they are run from a path on the PATH environment variable.

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] Make sure mkbundle executables work if they are run from a path on the PATH environment variable.

R Zaghi
This is a patch to enable mkbundle executable files to work when they are run from a path that is on the PATH environment variable.

Mono mini has a function probe_embedded() which looks for the program's file (using argv[0]). If the program is run from a path on the PATH environment variable then the open() fails and only a single parameter is sent to the mono_main() which in turn causes an if condition to print the help and exit.

This patch searches through the directories specified in the current environment's PATH variable and tries to open() then first file found.

Apologies if this is not the right way to submit patches but I had a quick look at the contribution page online and my understanding is that I must send a patch this to the community with the most likely or relevant owner(s) on the CC.

Please let me know if I need to do anything else to push this (change log!?).


Thanks



Ramin Zaghi

Mosaic3DX™ | User Interface Technology
St John's Innovation Centre,
Cowley Road,
Cambridge,
CB4 0WS, UK
T: +44 1223 421 311



_______________________________________________
Mono-devel-list mailing list
[hidden email]
http://lists.dot.net/mailman/listinfo/mono-devel-list

0001-Make-sure-mkbundle-executables-work-if-they-are-run-.patch (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Make sure mkbundle executables work if they are run from a path on the PATH environment variable.

Zoltan Varga
Hi,

 The best way to submit patches nowdays is through github PRs:


   Zoltan

On Fri, Dec 1, 2017 at 2:12 PM, R Zaghi <[hidden email]> wrote:
This is a patch to enable mkbundle executable files to work when they are run from a path that is on the PATH environment variable.

Mono mini has a function probe_embedded() which looks for the program's file (using argv[0]). If the program is run from a path on the PATH environment variable then the open() fails and only a single parameter is sent to the mono_main() which in turn causes an if condition to print the help and exit.

This patch searches through the directories specified in the current environment's PATH variable and tries to open() then first file found.

Apologies if this is not the right way to submit patches but I had a quick look at the contribution page online and my understanding is that I must send a patch this to the community with the most likely or relevant owner(s) on the CC.

Please let me know if I need to do anything else to push this (change log!?).


Thanks



Ramin Zaghi

Mosaic3DX™ | User Interface Technology
St John's Innovation Centre,
Cowley Road,
Cambridge,
CB4 0WS, UK
T: <a href="tel:+44%201223%20421311" value="+441223421311" target="_blank">+44 1223 421 311




_______________________________________________
Mono-devel-list mailing list
[hidden email]
http://lists.dot.net/mailman/listinfo/mono-devel-list
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Make sure mkbundle executables work if they are run from a path on the PATH environment variable.

R Zaghi
Thanks Zoltan,

In that case I will do that.
Just realised I left a printf() in the patch which shouldn't be there so I will do a PR with the new one.






Ramin Zaghi

Mosaic3DX™ | User Interface Technology
St John's Innovation Centre,
Cowley Road,
Cambridge,
CB4 0WS, UK
T: +44 1223 421 311


On Fri, Dec 1, 2017 at 7:15 PM, Zoltan Varga <[hidden email]> wrote:
Hi,

 The best way to submit patches nowdays is through github PRs:


   Zoltan

On Fri, Dec 1, 2017 at 2:12 PM, R Zaghi <[hidden email]> wrote:
This is a patch to enable mkbundle executable files to work when they are run from a path that is on the PATH environment variable.

Mono mini has a function probe_embedded() which looks for the program's file (using argv[0]). If the program is run from a path on the PATH environment variable then the open() fails and only a single parameter is sent to the mono_main() which in turn causes an if condition to print the help and exit.

This patch searches through the directories specified in the current environment's PATH variable and tries to open() then first file found.

Apologies if this is not the right way to submit patches but I had a quick look at the contribution page online and my understanding is that I must send a patch this to the community with the most likely or relevant owner(s) on the CC.

Please let me know if I need to do anything else to push this (change log!?).


Thanks



Ramin Zaghi

Mosaic3DX™ | User Interface Technology
St John's Innovation Centre,
Cowley Road,
Cambridge,
CB4 0WS, UK
T: <a href="tel:+44%201223%20421311" value="+441223421311" target="_blank">+44 1223 421 311





_______________________________________________
Mono-devel-list mailing list
[hidden email]
http://lists.dot.net/mailman/listinfo/mono-devel-list
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Make sure mkbundle executables work if they are run from a path on the PATH environment variable.

Rafael Teixeira
In reply to this post by R Zaghi
Hi Ramin,

Nowadays GitHub 'Pull Requests' is the preferred way to make contributions.


Rafael Teixeira
O..:.)oooo

On Fri, Dec 1, 2017 at 5:12 PM, R Zaghi <[hidden email]> wrote:
This is a patch to enable mkbundle executable files to work when they are run from a path that is on the PATH environment variable.

Mono mini has a function probe_embedded() which looks for the program's file (using argv[0]). If the program is run from a path on the PATH environment variable then the open() fails and only a single parameter is sent to the mono_main() which in turn causes an if condition to print the help and exit.

This patch searches through the directories specified in the current environment's PATH variable and tries to open() then first file found.

Apologies if this is not the right way to submit patches but I had a quick look at the contribution page online and my understanding is that I must send a patch this to the community with the most likely or relevant owner(s) on the CC.

Please let me know if I need to do anything else to push this (change log!?).


Thanks



Ramin Zaghi

Mosaic3DX™ | User Interface Technology
St John's Innovation Centre,
Cowley Road,
Cambridge,
CB4 0WS, UK
T: <a href="tel:+44%201223%20421311" value="+441223421311" target="_blank">+44 1223 421 311



_______________________________________________
Mono-devel-list mailing list
[hidden email]
http://lists.dot.net/mailman/listinfo/mono-devel-list



_______________________________________________
Mono-devel-list mailing list
[hidden email]
http://lists.dot.net/mailman/listinfo/mono-devel-list
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Make sure mkbundle executables work if they are run from a path on the PATH environment variable.

Ludovic Henry (XAMARIN) via Mono-devel-list
In reply to this post by R Zaghi

The patch looks great, as you work to submitting it via GitHub, can you make sure that you keep the exitsing code style for braces as well?

 

Miguel.

 

From: R Zaghi <[hidden email]>
Reply-To: "[hidden email]" <[hidden email]>
Date: Friday, December 1, 2017 at 2:12 PM
To: Mono Devel Mailing List <[hidden email]>
Cc: Miguel de Icaza <[hidden email]>, Zoltan Varga <[hidden email]>
Subject: [PATCH] Make sure mkbundle executables work if they are run from a path on the PATH environment variable.

 

This is a patch to enable mkbundle executable files to work when they are run from a path that is on the PATH environment variable.

 

Mono mini has a function probe_embedded() which looks for the program's file (using argv[0]). If the program is run from a path on the PATH environment variable then the open() fails and only a single parameter is sent to the mono_main() which in turn causes an if condition to print the help and exit.

 

This patch searches through the directories specified in the current environment's PATH variable and tries to open() then first file found.

 

Apologies if this is not the right way to submit patches but I had a quick look at the contribution page online and my understanding is that I must send a patch this to the community with the most likely or relevant owner(s) on the CC.

 

Please let me know if I need to do anything else to push this (change log!?).

 

 

Thanks

 

 

 

Ramin Zaghi

 

Mosaic3DX™ | User Interface Technology

St John's Innovation Centre,

Cowley Road,

Cambridge,

CB4 0WS, UK

T: +44 1223 421 311

 

 


_______________________________________________
Mono-devel-list mailing list
[hidden email]
http://lists.dot.net/mailman/listinfo/mono-devel-list
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Make sure mkbundle executables work if they are run from a path on the PATH environment variable.

R Zaghi
On Fri, Dec 1, 2017 at 7:20 PM, Miguel de Icaza <[hidden email]> wrote:

The patch looks great, as you work to submitting it via GitHub, can you make sure that you keep the exitsing code style for braces as well?


Ok. I tried my best to match the existing source file in style.
PR done.

Thanks
Ramin


 

 

Miguel.

 

From: R Zaghi <[hidden email]>
Reply-To: "[hidden email]" <[hidden email]>
Date: Friday, December 1, 2017 at 2:12 PM
To: Mono Devel Mailing List <[hidden email]>
Cc: Miguel de Icaza <[hidden email]>, Zoltan Varga <[hidden email]>
Subject: [PATCH] Make sure mkbundle executables work if they are run from a path on the PATH environment variable.

 

This is a patch to enable mkbundle executable files to work when they are run from a path that is on the PATH environment variable.

 

Mono mini has a function probe_embedded() which looks for the program's file (using argv[0]). If the program is run from a path on the PATH environment variable then the open() fails and only a single parameter is sent to the mono_main() which in turn causes an if condition to print the help and exit.

 

This patch searches through the directories specified in the current environment's PATH variable and tries to open() then first file found.

 

Apologies if this is not the right way to submit patches but I had a quick look at the contribution page online and my understanding is that I must send a patch this to the community with the most likely or relevant owner(s) on the CC.

 

Please let me know if I need to do anything else to push this (change log!?).

 

 

Thanks

 

 

 

Ramin Zaghi

 

Mosaic3DX™ | User Interface Technology

St John's Innovation Centre,

Cowley Road,

Cambridge,

CB4 0WS, UK

T: <a href="tel:+44%201223%20421311" value="+441223421311" target="_blank">+44 1223 421 311

 

 



_______________________________________________
Mono-devel-list mailing list
[hidden email]
http://lists.dot.net/mailman/listinfo/mono-devel-list