From d4a0445873924cee567436c8899a80eb0abcef86 Mon Sep 17 00:00:00 2001 From: a martin Date: Tue, 7 Aug 2018 15:04:26 -0400 Subject: [PATCH 01/14] Added the install instruction for Fedora Tested on Fedora 28 --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index d09b292..36dc5df 100644 --- a/README.md +++ b/README.md @@ -133,6 +133,11 @@ these packages: libboost-all-dev libcurl4-openssl-dev libexpat1-dev libcppunit-dev binutils-dev \ debhelper zlib1g-dev dpkg-dev pkg-config +Fedora: + + sudo dnf install git cmake libgcrypt-devel g++ libstdc++ yajl-devel boost libcurl-devel expat-devel binutils zlib + + FreeBSD: pkg install git cmake boost-libs yajl libgcrypt pkgconf cppunit libbfd From 60ecd5b0ff71840e3054f9966cf2ee012119fd3f Mon Sep 17 00:00:00 2001 From: Alex Martin Date: Mon, 8 Oct 2018 13:36:37 -0400 Subject: [PATCH 02/14] Changed the g++ package to gcc-c++ Fixed the Fedora install directions. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 36dc5df..f1546f8 100644 --- a/README.md +++ b/README.md @@ -135,7 +135,7 @@ these packages: Fedora: - sudo dnf install git cmake libgcrypt-devel g++ libstdc++ yajl-devel boost libcurl-devel expat-devel binutils zlib + sudo dnf install git cmake libgcrypt-devel gcc-c++ libstdc++ yajl-devel boost libcurl-devel expat-devel binutils zlib FreeBSD: From e3e18fe16aec7b5ae849275234fbd824e4c83a95 Mon Sep 17 00:00:00 2001 From: Jan Schulz Date: Mon, 3 Dec 2018 21:21:49 +0100 Subject: [PATCH 03/14] Escape folder when calling sync from change listener The old version would pass in an unescaped directory, which then got unescaped by the sync call. In some cases it worked but resulted in foldername wold not matched reality (example: google-drive -> google/drive) and error out when checking if that folder exists. --- systemd/grive-sync.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systemd/grive-sync.sh b/systemd/grive-sync.sh index 42d6ae8..bb837ba 100755 --- a/systemd/grive-sync.sh +++ b/systemd/grive-sync.sh @@ -107,7 +107,7 @@ listen_directory() { while true #run indefinitely do # Use a different call to not need to change exit into return - inotifywait -q -r -e modify,attrib,close_write,move,create,delete --exclude ".grive_state|.grive" "${_directory}" > /dev/null 2>&1 && ${SCRIPT} sync "${_directory}" + inotifywait -q -r -e modify,attrib,close_write,move,create,delete --exclude ".grive_state|.grive" "${_directory}" > /dev/null 2>&1 && ${SCRIPT} sync $(systemd-escape "${_directory}") #echo ${SCRIPT} "${_directory}" done From f9cad3b635d91059e2b6b7fdf19558411acb6bee Mon Sep 17 00:00:00 2001 From: Jan Schulz Date: Mon, 3 Dec 2018 21:34:10 +0100 Subject: [PATCH 04/14] Update readme how to enable and start systemd units It missed that escaping was essential if you didn't use a all [a-z] foldername... --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d09b292..0e1da4c 100644 --- a/README.md +++ b/README.md @@ -90,10 +90,10 @@ Prepare a Google Drive folder in your $HOME directory with `grive -a`. ```bash # 'google-drive' is the name of your Google Drive folder in your $HOME directory -systemctl --user enable grive-timer@google-drive.timer -systemctl --user start grive-timer@google-drive.timer -systemctl --user enable grive-changes@google-drive.service -systemctl --user start grive-changes@google-drive.service +systemctl --user enable grive-timer@$(systemd-escape google-drive).timer +systemctl --user start grive-timer@$(systemd-escape google-drive).timer +systemctl --user enable grive-changes@$(systemd-escape google-drive).service +systemctl --user start grive-changes@$(systemd-escape google-drive).service ``` You can enable and start these two units for multiple folders in your `$HOME` From d4742fd470fb160bd6bff4f9364a5b826d4a5367 Mon Sep 17 00:00:00 2001 From: Jan Schulz Date: Wed, 5 Dec 2018 00:03:44 +0100 Subject: [PATCH 05/14] Remove unneded link-time dependency on libz and libexpat --- libgrive/CMakeLists.txt | 7 ------- libgrive/src/xml/TreeBuilder.cc | 1 - 2 files changed, 8 deletions(-) diff --git a/libgrive/CMakeLists.txt b/libgrive/CMakeLists.txt index d9dbebb..c7ad3cb 100644 --- a/libgrive/CMakeLists.txt +++ b/libgrive/CMakeLists.txt @@ -4,12 +4,10 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") find_package(LibGcrypt REQUIRED) find_package(CURL REQUIRED) -find_package(EXPAT REQUIRED) find_package(Boost 1.40.0 COMPONENTS program_options filesystem unit_test_framework regex system REQUIRED) find_package(BFD) find_package(CppUnit) find_package(Iberty) -find_package(ZLIB) find_package(PkgConfig) pkg_check_modules(YAJL REQUIRED yajl) @@ -37,10 +35,6 @@ else ( IBERTY_FOUND ) set( IBERTY_LIBRARY "" ) endif ( IBERTY_FOUND ) -if ( ZLIB_FOUND ) - set( OPT_LIBS ${OPT_LIBS} ${ZLIB_LIBRARIES} ) -endif ( ZLIB_FOUND ) - include_directories( ${libgrive_SOURCE_DIR}/src ${libgrive_SOURCE_DIR}/test @@ -88,7 +82,6 @@ target_link_libraries( grive ${Boost_REGEX_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${IBERTY_LIBRARY} - ${EXPAT_LIBRARY} ${OPT_LIBS} ) diff --git a/libgrive/src/xml/TreeBuilder.cc b/libgrive/src/xml/TreeBuilder.cc index 9d57501..1414255 100644 --- a/libgrive/src/xml/TreeBuilder.cc +++ b/libgrive/src/xml/TreeBuilder.cc @@ -23,7 +23,6 @@ #include "Node.hh" #include "util/log/Log.hh" -#include #include #include From 13ac9bd1a96fc0e1b84c7f4a49f53874c210fc14 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Mon, 11 Nov 2019 21:10:40 +0300 Subject: [PATCH 06/14] Add ACHTUNG note to the README --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 4d37a7d..eef78e6 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,19 @@ +# ACHTUNG + +Most of Google Drive APIs are currently locked. R.I.P grive2 and other opensource +Google Drive clients :) + +Details: + +Here https://developers.google.com/drive/api/v3/about-auth?hl=ru most APIs are marked as restricted + +And here https://support.google.com/cloud/answer/9110914 they say that + +**The following application types are examples of apps that are no longer allowed per the Permitted Application Types policy: +Apps that store or backup data other than email messages in Gmail.** + +So, go tell Google they're morons and quit using google drive NOW :) + # Grive2 0.5.1-dev 28 Sep 2016, Vitaliy Filippov From 548ea362f319cd1f7fcbad0344fde8449fa14255 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Wed, 13 Nov 2019 01:04:29 +0300 Subject: [PATCH 07/14] Update client_id and client_secret -> maybe Google will verify it? --- CMakeLists.txt | 2 +- README.md | 47 +++++++++++++-------------------- grive/src/main.cc | 4 +-- libgrive/src/protocol/OAuth2.cc | 7 +---- 4 files changed, 22 insertions(+), 38 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 951d874..1b3f9a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8) include(GNUInstallDirs) # Grive version. remember to update it for every new release! -set( GRIVE_VERSION "0.5.1-dev" ) +set( GRIVE_VERSION "0.5.1" ) # common compile options add_definitions( -DVERSION="${GRIVE_VERSION}" ) diff --git a/README.md b/README.md index eef78e6..ff3cb4f 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,14 @@ -# ACHTUNG +# Grive2 0.5.2-dev -Most of Google Drive APIs are currently locked. R.I.P grive2 and other opensource -Google Drive clients :) - -Details: - -Here https://developers.google.com/drive/api/v3/about-auth?hl=ru most APIs are marked as restricted - -And here https://support.google.com/cloud/answer/9110914 they say that - -**The following application types are examples of apps that are no longer allowed per the Permitted Application Types policy: -Apps that store or backup data other than email messages in Gmail.** - -So, go tell Google they're morons and quit using google drive NOW :) - -# Grive2 0.5.1-dev - -28 Sep 2016, Vitaliy Filippov +13 Nov 2019, Vitaliy Filippov http://yourcmc.ru/wiki/Grive2 This is the fork of original "Grive" (https://github.com/Grive/grive) Google Drive client with the support for the new Drive REST API and partial sync. -Grive can be considered still beta or pre-beta quality. It simply downloads all the files in your -Google Drive into the current directory. After you make some changes to the local files, run +Grive simply downloads all the files in your Google Drive into the current directory. +After you make some changes to the local files, run grive again and it will upload your changes back to your Google Drive. New files created locally or in Google Drive will be uploaded or downloaded respectively. Deleted files will also be "removed". Currently Grive will NOT destroy any of your files: it will only move the files to a @@ -32,12 +16,12 @@ directory named .trash or put them in the Google Drive trash. You can always rec There are a few things that Grive does not do at the moment: - continously wait for changes in file system or in Google Drive to occur and upload. - A sync is only performed when you run Grive (there are workarounds for almost + A sync is only performed when you run Grive (there are workarounds for almost continuous sync. See below). - symbolic links support. - support for Google documents. -These may be added in the future, possibly the next release. +These may be added in the future. Enjoy! @@ -177,17 +161,22 @@ Grive uses cmake to build. Basic install sequence is ## Version History -### Grive2 v0.5.1-dev +### Grive2 v0.5.2-dev -- support for .griveignore -- automatic sync solution based on inotify-tools and systemd +### Grive2 v0.5.1 + +- Support for .griveignore +- Automatic sync solution based on inotify-tools and systemd - no-remote-new and upload-only modes -- ignore regexp does not persist anymore (note that Grive will still track it to not +- Ignore regexp does not persist anymore (note that Grive will still track it to not accidentally delete remote files when changing ignore regexp) -- added options to limit upload and download speed -- faster upload of new and changed files. now Grive uploads files without first calculating +- Added options to limit upload and download speed +- Faster upload of new and changed files. Now Grive uploads files without first calculating md5 checksum when file is created locally or when its size changes. -- added -P/--progress-bar option to print ASCII progress bar for each processed file (pull request by @svartkanin) +- Added -P/--progress-bar option to print ASCII progress bar for each processed file (pull request by @svartkanin) +- Added command-line options to specify your own client_id and client_secret +- Now grive2 skips links, sockets, fifos and other unusual files +- Various small build fixes ### Grive2 v0.5 diff --git a/grive/src/main.cc b/grive/src/main.cc index 7f0bd33..31a2b07 100644 --- a/grive/src/main.cc +++ b/grive/src/main.cc @@ -46,8 +46,8 @@ #include #include -const std::string default_id = "22314510474.apps.googleusercontent.com" ; -const std::string default_secret = "bl4ufi89h-9MkFlypcI7R785" ; +const std::string default_id = "615557989097-i93d4d1ojpen0m0dso18ldr6orjkidgf.apps.googleusercontent.com" ; +const std::string default_secret = "xiM8Apu_WuRRdheNelJcNtOD" ; using namespace gr ; namespace po = boost::program_options; diff --git a/libgrive/src/protocol/OAuth2.cc b/libgrive/src/protocol/OAuth2.cc index 73ae088..db1858a 100644 --- a/libgrive/src/protocol/OAuth2.cc +++ b/libgrive/src/protocol/OAuth2.cc @@ -84,12 +84,7 @@ void OAuth2::Auth( const std::string& auth_code ) std::string OAuth2::MakeAuthURL() { return "https://accounts.google.com/o/oauth2/auth" - "?scope=" + - m_agent->Escape( "https://www.googleapis.com/auth/userinfo.email" ) + "+" + - m_agent->Escape( "https://www.googleapis.com/auth/userinfo.profile" ) + "+" + - m_agent->Escape( "https://docs.google.com/feeds/" ) + "+" + - m_agent->Escape( "https://docs.googleusercontent.com/" ) + "+" + - m_agent->Escape( "https://spreadsheets.google.com/feeds/" ) + + "?scope=" + m_agent->Escape( "https://www.googleapis.com/auth/drive" ) + "&redirect_uri=urn:ietf:wg:oauth:2.0:oob" "&response_type=code" "&client_id=" + m_client_id ; From 39299096cf140534ee522bb04f3d6f1446ed1b95 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Wed, 13 Nov 2019 01:06:03 +0300 Subject: [PATCH 08/14] Move to 0.5.2-dev --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b3f9a1..d2937a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8) include(GNUInstallDirs) # Grive version. remember to update it for every new release! -set( GRIVE_VERSION "0.5.1" ) +set( GRIVE_VERSION "0.5.2-dev" ) # common compile options add_definitions( -DVERSION="${GRIVE_VERSION}" ) From 79312b9c53bc64bd2bee1b929e4185ee061c75c7 Mon Sep 17 00:00:00 2001 From: AmonRaNet Date: Fri, 13 Dec 2019 11:16:32 +0100 Subject: [PATCH 09/14] Extends support application id and secret support - persistent id's in config - cmake supports id's during config - priority: default(cmake), config, cli --- CMakeLists.txt | 4 ++-- README.md | 8 ++++++++ grive/CMakeLists.txt | 11 +++++++++++ grive/src/main.cc | 37 ++++++++++++++++++++++--------------- libgrive/src/util/Config.cc | 4 ++++ 5 files changed, 47 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d2937a9..71dcb77 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,8 @@ cmake_minimum_required(VERSION 2.8) include(GNUInstallDirs) # Grive version. remember to update it for every new release! -set( GRIVE_VERSION "0.5.2-dev" ) +set( GRIVE_VERSION "0.5.2-dev" CACHE STRING "Grive version" ) +message(WARNING "Version to build: ${GRIVE_VERSION}") # common compile options add_definitions( -DVERSION="${GRIVE_VERSION}" ) @@ -12,4 +13,3 @@ add_definitions( -D_FILE_OFFSET_BITS=64 -std=c++0x ) add_subdirectory( systemd ) add_subdirectory( libgrive ) add_subdirectory( grive ) - \ No newline at end of file diff --git a/README.md b/README.md index ff3cb4f..d9a0da2 100644 --- a/README.md +++ b/README.md @@ -159,6 +159,14 @@ Grive uses cmake to build. Basic install sequence is make -j4 sudo make install +Alternativly you can define your own client_id and client_secret during build + + mkdir build + cd build + cmake .. "-DAPP_ID:STRING=" "-DAPP_SECRET:STRING=" + make -j4 + sudo make install + ## Version History ### Grive2 v0.5.2-dev diff --git a/grive/CMakeLists.txt b/grive/CMakeLists.txt index 0908380..ac5b781 100644 --- a/grive/CMakeLists.txt +++ b/grive/CMakeLists.txt @@ -20,6 +20,17 @@ target_link_libraries( grive_executable grive ) +set(DEFAULT_APP_ID "615557989097-i93d4d1ojpen0m0dso18ldr6orjkidgf.apps.googleusercontent.com") +set(DEFAULT_APP_SECRET "xiM8Apu_WuRRdheNelJcNtOD") +set(APP_ID ${DEFAULT_APP_ID} CACHE STRING "Application Id") +set(APP_SECRET ${DEFAULT_APP_SECRET} CACHE STRING "Application Secret") + +target_compile_definitions ( grive_executable + PRIVATE + -DAPP_ID="${APP_ID}" + -DAPP_SECRET="${APP_SECRET}" +) + set_target_properties( grive_executable PROPERTIES OUTPUT_NAME grive ) diff --git a/grive/src/main.cc b/grive/src/main.cc index 31a2b07..54d5560 100644 --- a/grive/src/main.cc +++ b/grive/src/main.cc @@ -46,8 +46,8 @@ #include #include -const std::string default_id = "615557989097-i93d4d1ojpen0m0dso18ldr6orjkidgf.apps.googleusercontent.com" ; -const std::string default_secret = "xiM8Apu_WuRRdheNelJcNtOD" ; +const std::string default_id = APP_ID ; +const std::string default_secret = APP_SECRET ; using namespace gr ; namespace po = boost::program_options; @@ -113,6 +113,7 @@ int Main( int argc, char **argv ) ( "auth,a", "Request authorization token" ) ( "id,i", po::value(), "Authentication ID") ( "secret,e", po::value(), "Authentication secret") + ( "print-url", "Only print url for request") ( "path,p", po::value(), "Path to working copy root") ( "dir,s", po::value(), "Single subdirectory to sync") ( "verbose,V", "Verbose mode. Enable more messages than normal.") @@ -174,23 +175,23 @@ int Main( int argc, char **argv ) http->SetProgressReporter( pb.get() ); } - std::string id = default_id; - std::string secret = default_secret; - - if( vm.count( "id" ) ) - { - id = vm["id"].as(); - } - - if( vm.count( "secret" ) ) - { - secret = vm["secret"].as(); - } - if ( vm.count( "auth" ) ) { + std::string id = vm.count( "id" ) > 0 + ? vm["id"].as() + : default_id ; + std::string secret = vm.count( "secret" ) > 0 + ? vm["secret"].as() + : default_secret ; + OAuth2 token( http.get(), id, secret ) ; + if ( vm.count("print-url") ) + { + std::cout << token.MakeAuthURL() << std::endl ; + return 0 ; + } + std::cout << "-----------------------\n" << "Please go to this URL and get an authentication code:\n\n" @@ -206,14 +207,20 @@ int Main( int argc, char **argv ) token.Auth( code ) ; // save to config + config.Set( "id", Val( id ) ) ; + config.Set( "secret", Val( secret ) ) ; config.Set( "refresh_token", Val( token.RefreshToken() ) ) ; config.Save() ; } std::string refresh_token ; + std::string id ; + std::string secret ; try { refresh_token = config.Get("refresh_token").Str() ; + id = config.Get("id").Str() ; + secret = config.Get("secret").Str() ; } catch ( Exception& e ) { diff --git a/libgrive/src/util/Config.cc b/libgrive/src/util/Config.cc index ba0c91e..c08972f 100644 --- a/libgrive/src/util/Config.cc +++ b/libgrive/src/util/Config.cc @@ -38,6 +38,10 @@ const std::string default_root_folder = "."; Config::Config( const po::variables_map& vm ) { + if ( vm.count( "id" ) > 0 ) + m_cmd.Add( "id", Val( vm["id"].as() ) ) ; + if ( vm.count( "secret" ) > 0 ) + m_cmd.Add( "secret", Val( vm["secret"].as() ) ) ; m_cmd.Add( "new-rev", Val(vm.count("new-rev") > 0) ) ; m_cmd.Add( "force", Val(vm.count("force") > 0 ) ) ; m_cmd.Add( "path", Val(vm.count("path") > 0 From de6404b246e8658f1559079467e451a2419a10c5 Mon Sep 17 00:00:00 2001 From: Frank Bicknell Date: Mon, 16 Dec 2019 13:27:43 -0500 Subject: [PATCH 10/14] Fix Fedora (and RHEL) suggested dependencies We need boost-devel to compile. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d9a0da2..b54b28d 100644 --- a/README.md +++ b/README.md @@ -135,7 +135,7 @@ these packages: Fedora: - sudo dnf install git cmake libgcrypt-devel gcc-c++ libstdc++ yajl-devel boost libcurl-devel expat-devel binutils zlib + sudo dnf install git cmake libgcrypt-devel gcc-c++ libstdc++ yajl-devel boost-devel libcurl-devel expat-devel binutils zlib FreeBSD: From 94182975db1941b409af466486749fc41f0108f2 Mon Sep 17 00:00:00 2001 From: AmonRaNet Date: Tue, 31 Dec 2019 20:13:26 +0100 Subject: [PATCH 11/14] Add instruction for replacing the OAuth2 client --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index d9a0da2..4581df0 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,31 @@ your folder. They need to be added explicitly to your Google Drive: go to the Google Drive website, right click on the file or folder and chose 'Add to My Drive'. +### Different OAuth2 client to workaround over quota issues + +The default OAuth2 client supplied with grive is sometimes over quota and grive +will then fail to sync. You can supply your own OAuth2 client credentials by +following these steps: + +1. Go to https://console.developers.google.com/apis/api/drive.googleapis.com +2. Chose a project (you might need to create one first) +3. Go to https://console.developers.google.com/apis/library/drive.googleapis.com and + "Enable" the Google Drive APIs +4. Create new Credentials on the folloing screen(s) +5. In the "Find out what credentials you need" dialog, choose: + - Which API are you using: "Google Drive API" + - Where will you be calling the API from: "Other UI (...CLI...)" + - What data will you be accessing: "User Data" +6. In the next steps create a client id (name doesn't matter) and + setup the consent screen (defaults are ok, no need for any URLs) +7. The needed "Client ID" and "Client Secret" are either in the shown download + or can later found by clicking on the created credential on + https://console.developers.google.com/apis/credentials/ +8. When you applying grive in an existing Google Drive folder, you must first delete + the old `.grive` configuration file. +9. Call `grive -a --id --secret ` and follow the steps + to authenticate the OAuth2 client to allow it to access your drive folder. + ## Installation For the detailed instructions, see http://yourcmc.ru/wiki/Grive2#Installation From a3cce716439536f85235c2d3eb2151f671a80c29 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Mon, 6 Jan 2020 20:32:44 +0300 Subject: [PATCH 12/14] Small corrections --- README.md | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 4581df0..43b78cd 100644 --- a/README.md +++ b/README.md @@ -106,17 +106,23 @@ your folder. They need to be added explicitly to your Google Drive: go to the Google Drive website, right click on the file or folder and chose 'Add to My Drive'. -### Different OAuth2 client to workaround over quota issues +### Different OAuth2 client to workaround over quota and google approval issues -The default OAuth2 client supplied with grive is sometimes over quota and grive -will then fail to sync. You can supply your own OAuth2 client credentials by -following these steps: +Google recently started to restrict access for unapproved applications: +https://developers.google.com/drive/api/v3/about-auth?hl=ru + +Grive2 is currently awaiting approval but it seems it will take forever. +Also even if they approve it the default Client ID supplied with grive may +exceed quota and grive will then fail to sync. + +You can supply your own OAuth2 client credentials to work around these problems +by following these steps: 1. Go to https://console.developers.google.com/apis/api/drive.googleapis.com -2. Chose a project (you might need to create one first) +2. Choose a project (you might need to create one first) 3. Go to https://console.developers.google.com/apis/library/drive.googleapis.com and "Enable" the Google Drive APIs -4. Create new Credentials on the folloing screen(s) +4. Go to https://console.cloud.google.com/apis/credentials and click "Create credentials > Help me choose" 5. In the "Find out what credentials you need" dialog, choose: - Which API are you using: "Google Drive API" - Where will you be calling the API from: "Other UI (...CLI...)" @@ -126,7 +132,7 @@ following these steps: 7. The needed "Client ID" and "Client Secret" are either in the shown download or can later found by clicking on the created credential on https://console.developers.google.com/apis/credentials/ -8. When you applying grive in an existing Google Drive folder, you must first delete +8. When you change client ID/secret in an existing Grive folder you must first delete the old `.grive` configuration file. 9. Call `grive -a --id --secret ` and follow the steps to authenticate the OAuth2 client to allow it to access your drive folder. From b4d6ac055f8f16ac735a70036243bc4ea2334039 Mon Sep 17 00:00:00 2001 From: Giuseppe Corbelli Date: Tue, 14 Jan 2020 11:50:20 +0100 Subject: [PATCH 13/14] [SymbolInfo.cc] Support compilation with binutils >= 2.33.1 on Debian. bfd_get_section_vma macro was removed. bfd_section_size changed signature. See inline comment for details. --- libgrive/src/bfd/SymbolInfo.cc | 35 ++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/libgrive/src/bfd/SymbolInfo.cc b/libgrive/src/bfd/SymbolInfo.cc index 5876cc0..cdb5d7c 100644 --- a/libgrive/src/bfd/SymbolInfo.cc +++ b/libgrive/src/bfd/SymbolInfo.cc @@ -49,9 +49,9 @@ SymbolInfo::SymbolInfo( ) m_impl->m_bfd = 0 ; m_impl->m_symbols = 0 ; m_impl->m_symbol_count = 0 ; - + bfd_init( ) ; - + // opening itself bfd *b = bfd_openr( "/proc/self/exe", 0 ) ; if ( b == NULL ) @@ -60,13 +60,13 @@ SymbolInfo::SymbolInfo( ) << bfd_errmsg( bfd_get_error() ) << std::endl ; return ; } - + if ( bfd_check_format( b, bfd_archive ) ) { bfd_close( b ) ; return ; } - + char **matching ; if ( !bfd_check_format_matches( b, bfd_object, &matching ) ) { @@ -78,7 +78,7 @@ SymbolInfo::SymbolInfo( ) std::cerr << bfd_get_filename( b ) << ": Matching formats: " ; for ( char **p = matching ; *p != 0 ; p++ ) std::cerr << " " << *p ; - + std::cerr << std::endl ; std::free( matching ) ; } @@ -107,7 +107,7 @@ struct SymbolInfo::BacktraceInfo const char *m_func_name ; unsigned int m_lineno ; unsigned int m_is_found ; - + static void Callback( bfd *abfd, asection *section, void* addr ) ; } ; @@ -117,17 +117,24 @@ void SymbolInfo::BacktraceInfo::Callback( bfd *abfd, asection *section, BacktraceInfo *info = (BacktraceInfo *)data ; if ((section->flags & SEC_ALLOC) == 0) return ; - - bfd_vma vma = bfd_get_section_vma(abfd, section); - + + // bfd_get_section_vma works up to 7b1cfbcf1a27951fb1b3a212995075dd6fdf985b, + // removed in 7c13bc8c91abf291f0206b6608b31955c5ea70d8 (binutils 2.33.1 or so) + // so it's substituted by its implementation to avoid checking for binutils + // version (which at least on Debian SID it's not that easy because the + // version.h is not included with the official package) + bfd_vma vma = section->vma; + unsigned long address = (unsigned long)(info->m_addr); if ( address < vma ) return; - - bfd_size_type size = bfd_section_size(abfd, section); + + // bfd_section_size changed between the two objects described above, + // same rationale applies + bfd_size_type size = section->size; if ( address > (vma + size)) return ; - + const SymbolInfo *pthis = info->m_pthis ; info->m_is_found = bfd_find_nearest_line( abfd, section, pthis->m_impl->m_symbols, @@ -149,7 +156,7 @@ void SymbolInfo::PrintTrace( void *addr, std::ostream& os, std::size_t idx ) { this, addr, 0, 0, 0, false } ; - + Dl_info sym ; bfd_map_over_sections( m_impl->m_bfd, &SymbolInfo::BacktraceInfo::Callback, @@ -165,7 +172,7 @@ if ( btinfo.m_is_found ) filename.erase( pos, std::strlen( SRC_DIR ) ) ; #endif os << "#" << idx << " " << addr << " " - << filename << ":" << btinfo.m_lineno + << filename << ":" << btinfo.m_lineno << " " << (btinfo.m_func_name != 0 ? Demangle(btinfo.m_func_name) : "" ) << std::endl ; From dc1946498d33f8ce87423fda827a655a2bd1a6f8 Mon Sep 17 00:00:00 2001 From: lmmamercy Date: Wed, 5 Feb 2020 14:30:34 +0000 Subject: [PATCH 14/14] fix ubuntu/debian suggested dependencies --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 43b78cd..c84fd6c 100644 --- a/README.md +++ b/README.md @@ -160,7 +160,7 @@ There are also some optional dependencies: On a Debian/Ubuntu/Linux Mint machine just run the following command to install all these packages: - sudo apt-get install git cmake build-essential libgcrypt11-dev libyajl-dev \ + sudo apt-get install git cmake build-essential libgcrypt20-dev libyajl-dev \ libboost-all-dev libcurl4-openssl-dev libexpat1-dev libcppunit-dev binutils-dev \ debhelper zlib1g-dev dpkg-dev pkg-config