chiark / gitweb /
Merge branch 'licenses' into 'master'
authorDaniel Martí <mvdan@mvdan.cc>
Sun, 31 Jan 2016 13:26:26 +0000 (13:26 +0000)
committerDaniel Martí <mvdan@mvdan.cc>
Sun, 31 Jan 2016 13:26:26 +0000 (13:26 +0000)
wp-fdroid: Linkify more licenses

See merge request !90

buildserver/cookbooks/fdroidbuild-general/recipes/default.rb
docs/fdroid.texi
examples/makebuildserver.config.py
fdroidserver/build.py
fdroidserver/common.py
fdroidserver/gpgsign.py
fdroidserver/scanner.py
makebuildserver

index ce46c6b6da1d937e2a6fddf0b9373c3c9bfda2b1..e70de6fe0318faf523b6571e1958fd789657b906 100644 (file)
@@ -7,7 +7,7 @@ execute 'set_debian_mirror' do
 end
 
 execute "jessie_backports" do
-  command "echo 'deb http://http.debian.net/debian jessie-backports main' > /etc/apt/sources.list.d/backports.list"
+  command "echo 'deb #{debian_mirror} jessie-backports main' > /etc/apt/sources.list.d/backports.list"
   only_if "grep jessie /etc/apt/sources.list"
 end
 
index e57b4a12367e0616722663d30b1859a41ce10444..96545d73785774d5a6c3b50b8331d56bcf033b15 100644 (file)
@@ -117,7 +117,7 @@ VirtualBox (debian package virtualbox)
 @item
 Ruby (debian packages ruby and rubygems)
 @item
-Vagrant (unpackaged, tested on v1.4.3)
+Vagrant (debian package vagrant - 1.4.x or higher required)
 @item
 vagrant-cachier plugin (unpackaged): `vagrant plugin install vagrant-cachier`
 @item
index 1d4bd0d3cca3726fe2693468e2c2a20fd9c4a001..cc536844b5dfb7dec8beaae02755dded096f0420 100644 (file)
@@ -38,3 +38,9 @@
 
 # Set to True if your base box is 64 bit (e.g. testing32.box isn't)
 # arch64 = True
+
+# If this is running on an older machine or on a virtualized system,
+# it can run a lot slower. If the provisioning fails with a warning
+# about the timeout, extend the timeout here. (default: 600 seconds)
+#
+# boot_timeout = 1200
index 463e60573abe4afff1ee088eb82ea75200194de7..021e1041910ce4398a480cada6cbb3a5efc1ddbc 100644 (file)
@@ -178,16 +178,15 @@ def get_clean_vm(reset=False):
 
         p = subprocess.Popen(['vagrant', '--version'],
                              stdout=subprocess.PIPE)
-        vver = p.communicate()[0]
+        vver = p.communicate()[0].strip().split(' ')[1]
+        if vver.split('.')[0] != '1' or int(vver.split('.')[1]) < 4:
+            raise BuildException("Unsupported vagrant version {0}".format(vver))
+
         with open(os.path.join('builder', 'Vagrantfile'), 'w') as vf:
-            if vver.startswith('Vagrant version 1.2'):
-                vf.write('Vagrant.configure("2") do |config|\n')
-                vf.write('config.vm.box = "buildserver"\n')
-                vf.write('end\n')
-            else:
-                vf.write('Vagrant::Config.run do |config|\n')
-                vf.write('config.vm.box = "buildserver"\n')
-                vf.write('end\n')
+            vf.write('Vagrant.configure("2") do |config|\n')
+            vf.write('config.vm.box = "buildserver"\n')
+            vf.write('config.vm.synced_folder ".", "/vagrant", disabled: true\n')
+            vf.write('end\n')
 
         logging.info("Starting new build server")
         retcode, _ = vagrant(['up'], cwd='builder')
index 60d1a7c76f3ddacdb09beb2b603f889955c1fbdc..a20aa59b478822ced8a95353ea62bc29fe4e9d55 100644 (file)
@@ -1072,19 +1072,22 @@ def parse_androidmanifests(paths, app):
                     if matches:
                         vercode = matches.group(1)
         else:
-            xml = parse_xml(path)
-            if "package" in xml.attrib:
-                s = xml.attrib["package"].encode('utf-8')
-                if app_matches_packagename(app, s):
-                    package = s
-            if "{http://schemas.android.com/apk/res/android}versionName" in xml.attrib:
-                version = xml.attrib["{http://schemas.android.com/apk/res/android}versionName"].encode('utf-8')
-                base_dir = os.path.dirname(path)
-                version = retrieve_string_singleline(base_dir, version)
-            if "{http://schemas.android.com/apk/res/android}versionCode" in xml.attrib:
-                a = xml.attrib["{http://schemas.android.com/apk/res/android}versionCode"].encode('utf-8')
-                if string_is_integer(a):
-                    vercode = a
+            try:
+                xml = parse_xml(path)
+                if "package" in xml.attrib:
+                    s = xml.attrib["package"].encode('utf-8')
+                    if app_matches_packagename(app, s):
+                        package = s
+                if "{http://schemas.android.com/apk/res/android}versionName" in xml.attrib:
+                    version = xml.attrib["{http://schemas.android.com/apk/res/android}versionName"].encode('utf-8')
+                    base_dir = os.path.dirname(path)
+                    version = retrieve_string_singleline(base_dir, version)
+                if "{http://schemas.android.com/apk/res/android}versionCode" in xml.attrib:
+                    a = xml.attrib["{http://schemas.android.com/apk/res/android}versionCode"].encode('utf-8')
+                    if string_is_integer(a):
+                        vercode = a
+            except Exception:
+                logging.warning("Problem with xml at {0}".format(path))
 
         # Remember package name, may be defined separately from version+vercode
         if package is None:
index 15c4deeb4353cb1eae0d4e4a4d8edf03ff6e5406..07b0b155b65680172d79196780ed47d2eb4f1c9a 100644 (file)
@@ -63,6 +63,8 @@ def main():
                            '--detach-sig']
                 if 'gpghome' in config:
                     gpgargs.extend(['--homedir', config['gpghome']])
+                if 'gpgkey' in config:
+                    gpgargs.extend(['--local-user', config['gpgkey']])
                 gpgargs.append(os.path.join(output_dir, apkfilename))
                 p = FDroidPopen(gpgargs)
                 if p.returncode != 0:
index dde02977f47836df2148a7a90411869519385789..30aaddf8143a6073d4445394e4b494042cee61d5 100644 (file)
@@ -82,6 +82,7 @@ def scan_source(build_dir, root_dir, build):
         'oss.sonatype.org/content/repositories/snapshots',
         'oss.sonatype.org/content/repositories/releases',
         'oss.sonatype.org/content/groups/public',
+        'clojars.org/repo',  # Clojure free software libs
         ]
     ]
 
index 4e575a09b449054222da82e233170c37770f79da..aeb5ebbc60fad1fc59bd4c99f5a0e60c58dc8613 100755 (executable)
@@ -41,16 +41,21 @@ parser.add_option("-v", "--verbose", action="store_true", default=False,
                   help="Spew out even more information than normal")
 parser.add_option("-c", "--clean", action="store_true", default=False,
                   help="Build from scratch, rather than attempting to update the existing server")
-parser.add_option("--debian-mirror", default="http://http.debian.net/debian/",
-                  help="Use the specified Debian mirror in the box's /etc/apt/sources.list.")
 options, args = parser.parse_args()
 
 # set up default config
+cachedir = os.path.join(os.getenv('HOME'), '.cache', 'fdroidserver')
 config = {
     'arch64': False,
     'basebox': 'jessie32',
-    'baseboxurl': 'https://f-droid.org/jessie32.box',
-    'cachedir': os.path.join(os.getenv('HOME'), '.cache', 'fdroidserver'),
+    # TODO in py3, convert this to pathlib.Path(absolute_path_string).as_uri()
+    'baseboxurl': [
+        'file://' + os.path.join(cachedir, 'jessie32.box'),
+        'https://f-droid.org/jessie32.box',
+    ],
+    'debian_mirror': 'http://http.debian.net/debian/',
+    'boot_timeout': 600,
+    'cachedir': cachedir,
     'cpus': 1,
     'memory': 3584,
 }
@@ -349,11 +354,14 @@ Vagrant.configure("2") do |config|
     v.customize ["modifyvm", :id, "--cpus", "{3}"]
   end
 
+  config.vm.boot_timeout = {4}
+
   config.vm.provision :shell, :path => "fixpaths.sh"
 """.format(config['basebox'],
            baseboxurl,
            config['memory'],
-           config.get('cpus', 1))
+           config.get('cpus', 1),
+           config['boot_timeout'])
 if 'aptproxy' in config and config['aptproxy']:
     vagrantfile += """
   config.vm.provision :shell, :inline => 'sudo echo "Acquire::http {{ Proxy \\"{0}\\"; }};" > /etc/apt/apt.conf.d/02proxy && sudo apt-get update'
@@ -378,7 +386,7 @@ vagrantfile += """
     chef.add_recipe "kivy"
   end
 end
-""" % (options.debian_mirror)
+""" % (config['debian_mirror'])
 
 # Check against the existing Vagrantfile, and if they differ, we need to
 # create a new box: