Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command line tool to download the configurations #422

Open
matlo opened this issue Dec 14, 2016 · 14 comments
Open

Command line tool to download the configurations #422

matlo opened this issue Dec 14, 2016 · 14 comments
Milestone

Comments

@matlo
Copy link
Owner

matlo commented Dec 14, 2016

No description provided.

@CodeOhms
Copy link

CodeOhms commented Aug 5, 2018

Hi Matlo,
If you are still interested I can make such an application for you. Should it be a stand alone program, or should it be apart of the 'gimx' command line tool?

I have a few queries to make sure I'm on the right track. Looking at the OnMenuGetConfigs method seems to have the code for doing this in the GIU. It seems I would just need to strip out some for loops that - I think - handle the GUI and simply use the configupdater class. Instead the gist of it will simply be:

  1. Get the config directory in a string variable.
  2. Get the list of configs from configupdater().getconfiglist( ) method. And get the initial status of the download as well.
  3. Call configupdater().getconfig( ) to retrieve the actual config file.
  4. Finish by calling these two functions: cleanDownload(), readConfigs(). I assume the first removes temporary stuff and the second checks to make sure the config is okay.

@matlo
Copy link
Owner Author

matlo commented Aug 5, 2018

Hi,
Yes, I'm still interested. I think it should be handled in a separate binary (for example "gimx-download"). In addition to manual download, it may allow automatic config download based on the plugged in devices, like performed in launcherFrame::autoConfig().

@CodeOhms
Copy link

CodeOhms commented Aug 6, 2018

Okay. I'll add the autoConfig for the second release.

@CodeOhms
Copy link

CodeOhms commented Aug 6, 2018

I apologise, but I'm having a lot of difficulty trying to compile the project on Windows. Currently I'm using Eclipse to write in C++. Make complains that command 'cc' wasn't found - this was when I tried to compile using make in Cygwin. I'll try and develop it on my RPi as this project seems more geared towards Linux.

@matlo
Copy link
Owner Author

matlo commented Aug 6, 2018

For Windows the current build system is based on Msys2/MinGW64:
https://gimx.fr/wiki/index.php?title=Development_on_Windows

@CodeOhms
Copy link

CodeOhms commented Aug 7, 2018

I tried the instructions above, but it doesn't cover all the issues I'm having. I followed each step, using the bash scripts to install and build. However, I still had to download some dependencies myself. Now I cannot link the main project as printf is undefined to the linker.
Looking around I found some other undefined functions called 'libintl_snprintf'. I tried installing wxWidgets to see if it needed the intl.h from there. Unfortunately, nothing has worked.

Sorry to bother you. I try some fresh approaches tomorrow after work.

@matlo
Copy link
Owner Author

matlo commented Aug 7, 2018

GIMX is not meant to be compiled with anything other that msys2/mingw64. Porting it to any other build system probably requires a huge amount of work. It seems a waste of time to me.

I just updated the build scripts so that it can work with latest msys2 version. Compilation throws a lot of warnings but seems successful.

@CodeOhms
Copy link

CodeOhms commented Aug 8, 2018

Thanks Matlo. The hot fix works. I can now compile in the suggested environment.

@CodeOhms
Copy link

Hi Matlo,
just a quick update before going on holiday for a week. Here is the work I've done so far https://github.com/CodeOhms/GIMX/tree/master/gimxFileDownloader.
The only thing that remains for the basic version being complete is I need to figure out why -3 status is returned when trying to download the config list.

I had to recreate the progress_callback_configupdater() function to work with the terminal, among a few other functions. I simply remapped the callback functionality, exposed by the class configupdater, to go through my TUI front end classes.

However, I think I'm missing something when I ported this function to work in a TUI environment.
The line where I invoke the configupdater::getconfiglist() function is in 'configDownload.cpp' line 97.

@matlo
Copy link
Owner Author

matlo commented Aug 16, 2018

Hi CodeOhms,
Thanks a lot! I'll test it as soon as possible. Once you are satisfied with your code, please make a merge request.

@CodeOhms
Copy link

Hi again,
I still haven't managed to fix the downloading issue. I dug deeper in the code and found that CURLE_SSL_CACERT_BADFILE is returned within Downloader::download().
It occurs on line 232 with the call CURLcode res = curl_easy_perform(m_curl_handle);.

Here is a screenshot of the discovery in gdb.exe
cacert_error

I've tried running my application with admin privileges to no avail.

@CodeOhms
Copy link

I've almost finished the basics. Just polishing it and getting rid of obvious bugs. Will send pull request when done.

@matlo matlo added this to the GIMX 9 milestone Oct 23, 2018
@matlo
Copy link
Owner Author

matlo commented Oct 23, 2018

Thanks again for your work on this. I'll try to integrate it for version 9.

@CodeOhms
Copy link

#622 this is the latest version of the pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants