Merge branch 'master' of git://gitorious.org/f-droid/fdroidclient

This commit is contained in:
David Black 2013-04-16 20:34:07 +01:00
commit 2fb2b1bf03
2 changed files with 13 additions and 4 deletions

View File

@ -32,6 +32,7 @@ import java.net.URL;
import java.security.cert.Certificate; import java.security.cert.Certificate;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.jar.JarEntry; import java.util.jar.JarEntry;
import java.util.jar.JarFile; import java.util.jar.JarFile;
@ -76,6 +77,8 @@ public class RepoXMLHandler extends DefaultHandler {
// The date format used in the repo XML file. // The date format used in the repo XML file.
private SimpleDateFormat mXMLDateFormat = new SimpleDateFormat("yyyy-MM-dd"); private SimpleDateFormat mXMLDateFormat = new SimpleDateFormat("yyyy-MM-dd");
private static final SimpleDateFormat logDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
private int totalAppCount; private int totalAppCount;
public RepoXMLHandler(DB.Repo repo, List<DB.App> apps, ProgressListener listener) { public RepoXMLHandler(DB.Repo repo, List<DB.App> apps, ProgressListener listener) {
@ -332,7 +335,8 @@ public class RepoXMLHandler extends DefaultHandler {
// This is a signed repo - we download the jar file, // This is a signed repo - we download the jar file,
// check the signature, and extract the index... // check the signature, and extract the index...
Log.d("FDroid", "Getting signed index from " + repo.address); Log.d("FDroid", "Getting signed index from " + repo.address + " at " +
logDateFormat.format(new Date(System.currentTimeMillis())));
String address = repo.address + "/index.jar"; String address = repo.address + "/index.jar";
PackageManager pm = ctx.getPackageManager(); PackageManager pm = ctx.getPackageManager();
try { try {

View File

@ -147,6 +147,7 @@ public class UpdateService extends IntentService implements ProgressListener {
List<DB.App> apps = new ArrayList<DB.App>(); List<DB.App> apps = new ArrayList<DB.App>();
List<Integer> keeprepos = new ArrayList<Integer>(); List<Integer> keeprepos = new ArrayList<Integer>();
boolean success = true; boolean success = true;
boolean changes = false;
for (DB.Repo repo : repos) { for (DB.Repo repo : repos) {
if (repo.inuse) { if (repo.inuse) {
@ -156,7 +157,11 @@ public class UpdateService extends IntentService implements ProgressListener {
String err = RepoXMLHandler.doUpdate(getBaseContext(), String err = RepoXMLHandler.doUpdate(getBaseContext(),
repo, apps, newetag, keeprepos, this); repo, apps, newetag, keeprepos, this);
if (err == null) { if (err == null) {
repo.lastetag = newetag.toString(); String nt = newetag.toString();
if(!nt.equals(repo.lastetag)) {
repo.lastetag = newetag.toString();
changes = true;
}
} else { } else {
success = false; success = false;
err = "Update failed for " + repo.address + " - " + err; err = "Update failed for " + repo.address + " - " + err;
@ -169,7 +174,7 @@ public class UpdateService extends IntentService implements ProgressListener {
} }
} }
if (success) { if (changes && success) {
sendStatus(STATUS_INFO, getString(R.string.status_checking_compatibility)); sendStatus(STATUS_INFO, getString(R.string.status_checking_compatibility));
List<DB.App> acceptedapps = new ArrayList<DB.App>(); List<DB.App> acceptedapps = new ArrayList<DB.App>();
List<DB.App> prevapps = ((FDroidApp) getApplication()).getApps(); List<DB.App> prevapps = ((FDroidApp) getApplication()).getApps();
@ -239,7 +244,7 @@ public class UpdateService extends IntentService implements ProgressListener {
} }
if (success && notify) { if (success && changes && notify) {
Log.d("FDroid", "Updates before:" + prevUpdates + ", after: " Log.d("FDroid", "Updates before:" + prevUpdates + ", after: "
+ newUpdates); + newUpdates);
if (newUpdates > prevUpdates) { if (newUpdates > prevUpdates) {