chiark / gitweb /
More os.path.join() use cases
authorDaniel Martí <mvdan@mvdan.cc>
Fri, 24 May 2013 21:43:49 +0000 (23:43 +0200)
committerDaniel Martí <mvdan@mvdan.cc>
Fri, 24 May 2013 21:43:49 +0000 (23:43 +0200)
fdroidserver/checkupdates.py
fdroidserver/common.py

index 0a8553274c877a2bb54cab94cbabf72b3bff83a8..713ad6bd0553eb9621450a94eb043c2deb0be893 100644 (file)
@@ -73,7 +73,7 @@ def check_tags(app, sdk_path):
             vcs.gotorevision(tag)
 
             # Only process tags where the manifest exists...
-            if os.path.exists(build_dir + '/AndroidManifest.xml'):
+            if os.path.exists(os.path.join(build_dir, 'AndroidManifest.xml')):
                 version, vercode, package = common.parse_androidmanifest(build_dir)
                 if package and package == app['id'] and version and vercode:
                     if int(vercode) > int(hcode):
index afa74220b2a11113bcb850ab298d5e47a7393180..ec9d7a9851866bcb1a0f6e39ea3d0f429364fdf2 100644 (file)
@@ -257,7 +257,7 @@ class vcs_gitsvn(vcs):
 
     def gettags(self):
         self.checkrepo()
-        return os.listdir(self.local+'/.git/svn/refs/remotes/tags')
+        return os.listdir(os.path.join(self.local, '/.git/svn/refs/remotes/tags'))
 
 class vcs_svn(vcs):
 
@@ -850,7 +850,7 @@ def parse_androidmanifest(app_dir):
     version = None
     vercode = None
     package = None
-    for line in file(app_dir + '/AndroidManifest.xml'):
+    for line in file(os.path.join(app_dir, 'AndroidManifest.xml')):
         if not package:
             matches = psearch(line)
             if matches:
@@ -865,14 +865,15 @@ def parse_androidmanifest(app_dir):
                 vercode = matches.group(1)
     if version:
         return (version, vercode, package)
-    for xmlfile in glob.glob(app_dir + '/res/values/strings*transl*.xml'):
+    for xmlfile in glob.glob(os.path.join(
+            app_dir, 'res', 'values', 'strings*transl*.xml')):
         for line in file(xmlfile):
             if not version:
                 matches = vnsearch_xml(line)
                 if matches:
                     version = matches.group(2)
     if not version:
-        for line in file(app_dir + '/res/values/strings.xml'):
+        for line in file(os.path.join(app_dir, 'res/values/strings.xml')):
             if not version:
                 matches = vnsearch_xml(line)
                 if matches:
@@ -1088,7 +1089,7 @@ def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, sdk_path,
                 print 'Force-removing old build.xml'
                 os.remove(buildxml)
         for d in update_dirs:
-            cwd = root_dir + '/' + d
+            cwd = os.path.join(root_dir, d)
             if verbose:
                 print "Update of '%s': exec '%s' in '%s'"%\
                     (d," ".join(parms),cwd)