From 1ba9f79888e06457f97867499c8d1f5279de8f9e Mon Sep 17 00:00:00 2001 From: Henrik Tunedal Date: Sun, 6 Feb 2011 05:13:44 +0100 Subject: [PATCH 1/4] Explicitly specify output encoding in marketcheck. FileWriter uses "the default character encoding", which seems like asking to live in interesting times. The program assumes UTF-8 when it reads the file, so it should obviously do the same when it writes it back. --- marketcheck/test.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/marketcheck/test.java b/marketcheck/test.java index 2a34a67d..1afa631c 100644 --- a/marketcheck/test.java +++ b/marketcheck/test.java @@ -101,10 +101,13 @@ class test { if (changed) { System.out.println("..updating"); - File of = new File(filespec); - BufferedWriter wi = new BufferedWriter(new FileWriter(of)); + FileOutputStream fo = new FileOutputStream(filespec); + OutputStreamWriter osr = new OutputStreamWriter(fo, "UTF-8"); + BufferedWriter wi = new BufferedWriter(osr); wi.write(output.toString()); wi.close(); + osr.close(); + fo.close(); } } From 0ad478ae01dfa29968ba9c19e276ce27d4047a79 Mon Sep 17 00:00:00 2001 From: Henrik Tunedal Date: Thu, 17 Feb 2011 20:40:15 +0100 Subject: [PATCH 2/4] Fix typo --- metadata/net.fercanet.LNM.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata/net.fercanet.LNM.txt b/metadata/net.fercanet.LNM.txt index a1d9a566..fc66eb1e 100644 --- a/metadata/net.fercanet.LNM.txt +++ b/metadata/net.fercanet.LNM.txt @@ -4,7 +4,7 @@ Web Site:http://learnmusicnotes.sourceforge.net/ Source Code:http://learnmusicnotes.sourceforge.net/ Issue Tracker:http://sourceforge.net/tracker/?group_id=371992 Donate: -Summary:Musi sight reading training game +Summary:Music sight reading training game Description: A simple game to assist with music sight reading training. . From a26c3ca5079af0afc19405b2e8df6077e14694bb Mon Sep 17 00:00:00 2001 From: Henrik Tunedal Date: Thu, 17 Feb 2011 21:16:26 +0100 Subject: [PATCH 3/4] Make metadata.py a proper module (renamed to common.py) --- .gitignore | 1 + build.py | 7 ++++--- metadata.py => common.py | 4 +++- update.py | 5 +++-- 4 files changed, 11 insertions(+), 6 deletions(-) mode change 100644 => 100755 build.py rename metadata.py => common.py (98%) mode change 100644 => 100755 update.py diff --git a/.gitignore b/.gitignore index eeabf9ea..e35a4b72 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ repo/ built/ build_*/ *~ +*.pyc diff --git a/build.py b/build.py old mode 100644 new mode 100755 index 248bb7f9..3f816d1a --- a/build.py +++ b/build.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python2 # -*- coding: utf-8 -*- # # build.py - part of the FDroid server tools @@ -19,7 +20,6 @@ import sys import os import shutil -import glob import subprocess import re import zipfile @@ -29,10 +29,11 @@ import shlex from xml.dom.minidom import Document from optparse import OptionParser +import common + #Read configuration... execfile('config.py') -execfile('metadata.py') # Parse command line... parser = OptionParser() @@ -45,7 +46,7 @@ parser.add_option("-c", "--clean", action="store_true", default=False, (options, args) = parser.parse_args() # Get all apps... -apps = read_metadata() +apps = common.read_metadata() #Clear and/or create the 'built' directory, depending on mode: built_dir = 'built' diff --git a/metadata.py b/common.py similarity index 98% rename from metadata.py rename to common.py index d6b6d22a..835d5c0d 100644 --- a/metadata.py +++ b/common.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# metadata.py - part of the FDroid server tools +# common.py - part of the FDroid server tools # Copyright (C) 2010, Ciaran Gultnieks, ciaran@ciarang.com # # This program is free software: you can redistribute it and/or modify @@ -16,6 +16,8 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +import glob, os, sys + def read_metadata(verbose=False): apps = [] diff --git a/update.py b/update.py old mode 100644 new mode 100755 index b12f147a..fa8c1d15 --- a/update.py +++ b/update.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python2 # -*- coding: utf-8 -*- # # update.py - part of the FDroid server tools @@ -34,7 +35,7 @@ repo_icon = None repo_url = None execfile('config.py') -execfile('metadata.py') +import common # Parse command line... parser = OptionParser() @@ -66,7 +67,7 @@ if (repo_url is None or repo_name is None or sys.exit(1) # Get all apps... -apps = read_metadata(verbose=options.verbose) +apps = common.read_metadata(verbose=options.verbose) # Copy apks and source tarballs for stuff we've built from source that # is flagged to be included in the repo... From c7676f29762d4ab828ef2b7ba9d5987407318420 Mon Sep 17 00:00:00 2001 From: Henrik Tunedal Date: Thu, 17 Feb 2011 22:19:36 +0100 Subject: [PATCH 4/4] Change search path for getsig The path to getsig is now relative to that of the script itself; the path to the APK files remains relative to the current working directory. --- update.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/update.py b/update.py index fa8c1d15..2aa09c0d 100755 --- a/update.py +++ b/update.py @@ -151,8 +151,10 @@ for apkfile in glob.glob(os.path.join('repo','*.apk')): f.close() # Get the signature (or md5 of, to be precise)... - p = subprocess.Popen(['java', 'getsig', os.path.join('..', apkfile)] - , cwd='getsig', stdout=subprocess.PIPE) + p = subprocess.Popen(['java', 'getsig', + os.path.join(os.getcwd(), apkfile)], + cwd=os.path.join(sys.path[0], 'getsig'), + stdout=subprocess.PIPE) output = p.communicate()[0] if options.verbose: print output