chiark / gitweb /
New command: readmeta, like lint but without warnings
authorDaniel Martí <mvdan@mvdan.cc>
Sun, 2 Feb 2014 14:11:26 +0000 (15:11 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Sun, 2 Feb 2014 14:11:26 +0000 (15:11 +0100)
fdroid
fdroidserver/metadata.py
fdroidserver/readmeta.py [new file with mode: 0644]

diff --git a/fdroid b/fdroid
index 69cc41e795857ba24502b4ce8596b0d0d7b72eb2..30404542a7095a6c59e110ec553fa8b4df9e5c37 100755 (executable)
--- a/fdroid
+++ b/fdroid
@@ -29,6 +29,7 @@ commands = [
         "verify",
         "checkupdates",
         "import",
+        "readmeta",
         "rewritemeta",
         "lint",
         "scanner",
index b8e66c9d9373437feee6df307668f8c6e01c907e..ceac96e741ef161c0625110abe0d5d1769b499a8 100644 (file)
@@ -360,11 +360,13 @@ def parse_srclib(metafile, **kw):
 
 # Read all metadata. Returns a list of 'app' objects (which are dictionaries as
 # returned by the parse_metadata function.
-def read_metadata(xref=True, package=None):
+def read_metadata(xref=True, package=None, store=True):
     apps = []
+
     for basedir in ('metadata', 'tmp'):
         if not os.path.exists(basedir):
             os.makedirs(basedir)
+
     for metafile in sorted(glob.glob(os.path.join('metadata', '*.txt'))):
         if package is None or metafile == os.path.join('metadata', package + '.txt'):
             try:
diff --git a/fdroidserver/readmeta.py b/fdroidserver/readmeta.py
new file mode 100644 (file)
index 0000000..e966513
--- /dev/null
@@ -0,0 +1,31 @@
+#!/usr/bin/env python2
+# -*- coding: utf-8 -*-
+#
+# readmeta.py - part of the FDroid server tools
+# Copyright (C) 2014 Daniel Martí <mvdan@mvdan.cc>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+import os, metadata
+
+def main():
+
+    if not os.path.isdir('metadata'):
+        return
+
+    metadata.read_metadata(xref=False, store=False)
+
+if __name__ == "__main__":
+    main()
+