Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

Commit

Permalink
Append snapshot flag to updatefile
Browse files Browse the repository at this point in the history
Windows currently ignores the snapshot flag during an update since it is
doing a delayed update on the basis of an external update file.

fixes #418
  • Loading branch information
cr0 committed Mar 25, 2015
1 parent 87581dd commit 2fb8d04
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public class PluginOperation extends Operation {

private static final String API_DEFAULT_ENDPOINT_URL = "https://api.syncany.org/v3";
private static final String API_PLUGIN_LIST_REQUEST_FORMAT = "%s/plugins/list?appVersion=%s&snapshots=%s&pluginId=%s&os=%s&arch=%s";

private static final String PURGEFILE_FILENAME = "purgefile";
private static final String UPDATE_FILENAME = "updatefile";

Expand All @@ -113,7 +113,7 @@ public PluginOperation(Config config, PluginOperationOptions options) {

@Override
public PluginOperationResult execute() throws Exception {
result.setAction(options.getAction());
result.setAction(options.getAction());

switch (options.getAction()) {
case LIST:
Expand Down Expand Up @@ -170,7 +170,7 @@ private PluginOperationResult executeUpdate() throws Exception {
File updatefilePath = new File(UserConfig.getUserConfigDir(), UPDATE_FILENAME);

try (PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(updatefilePath, true)))) {
out.println(pluginId);
out.println(pluginId + (options.isSnapshots() ? " --snapshot" : ""));
delayedPlugins.add(pluginId);
}
catch (IOException e) {
Expand Down Expand Up @@ -561,7 +561,7 @@ private PluginOperationResult executeList() throws Exception {
boolean localVersionOutdated = localVersion.lessThan(remoteVersion);
boolean applicationVersionCompatible = applicationVersion.greaterThanOrEqualTo(remoteMinAppVersion);
boolean pluginIsOutdated = localVersionOutdated && applicationVersionCompatible;

extendedPluginInfo.setOutdated(pluginIsOutdated);
}

Expand Down Expand Up @@ -620,7 +620,7 @@ private String getRemoteListStr(String pluginId) throws Exception {

String apiEndpointUrl = (options.getApiEndpoint() != null) ? options.getApiEndpoint() : API_DEFAULT_ENDPOINT_URL;
URL pluginListUrl = new URL(String.format(API_PLUGIN_LIST_REQUEST_FORMAT, apiEndpointUrl, appVersion, snapshotsEnabled, pluginIdQueryStr, osStr, archStr));

logger.log(Level.INFO, "Querying " + pluginListUrl + " ...");
eventBus.post(new ConnectToHostExternalEvent(pluginListUrl.getHost()));

Expand Down

0 comments on commit 2fb8d04

Please sign in to comment.