mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-16 16:02:33 +03:00
Don't except if already installed on fdroid install
This commit is contained in:
parent
84bf3d758f
commit
5ac855af69
2 changed files with 12 additions and 10 deletions
|
@ -163,15 +163,16 @@ def read_app_args(args, options, allapps, allow_vercodes=False):
|
||||||
|
|
||||||
apk_regex = None
|
apk_regex = None
|
||||||
|
|
||||||
def apknameinfo(basename):
|
def apknameinfo(filename):
|
||||||
global apk_regex
|
global apk_regex
|
||||||
|
filename = os.path.basename(filename)
|
||||||
if apk_regex is None:
|
if apk_regex is None:
|
||||||
apk_regex = re.compile(r"^([a-zA-Z\.]+)_([0-9]+)\.apk$")
|
apk_regex = re.compile(r"^([a-zA-Z\.]+)_([0-9]+)\.apk$")
|
||||||
m = apk_regex.match(basename)
|
m = apk_regex.match(filename)
|
||||||
try:
|
try:
|
||||||
result = (m.group(1), m.group(2))
|
result = (m.group(1), m.group(2))
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
raise Exception("Invalid apk name: %s" % basename)
|
raise Exception("Invalid apk name: %s" % filename)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def getapkname(app, build):
|
def getapkname(app, build):
|
||||||
|
@ -1428,7 +1429,7 @@ def FDroidPopen(commands, cwd=None):
|
||||||
sys.stderr.write(line)
|
sys.stderr.write(line)
|
||||||
sys.stderr.flush()
|
sys.stderr.flush()
|
||||||
result.stderr += line
|
result.stderr += line
|
||||||
time.sleep(0.2)
|
time.sleep(0.1)
|
||||||
|
|
||||||
p.communicate()
|
p.communicate()
|
||||||
result.returncode = p.returncode
|
result.returncode = p.returncode
|
||||||
|
|
|
@ -65,8 +65,7 @@ def main():
|
||||||
# Get the signed apk with the highest vercode
|
# Get the signed apk with the highest vercode
|
||||||
for apkfile in sorted(glob.glob(os.path.join(output_dir, '*.apk'))):
|
for apkfile in sorted(glob.glob(os.path.join(output_dir, '*.apk'))):
|
||||||
|
|
||||||
apkfilename = os.path.basename(apkfile)
|
appid, vercode = common.apknameinfo(apkfile)
|
||||||
appid, vercode = common.apknameinfo(apkfilename)
|
|
||||||
if appid not in apks:
|
if appid not in apks:
|
||||||
continue
|
continue
|
||||||
if vercodes[appid] and vc not in vercodes[appid]:
|
if vercodes[appid] and vc not in vercodes[appid]:
|
||||||
|
@ -81,8 +80,7 @@ def main():
|
||||||
|
|
||||||
for apkfile in sorted(glob.glob(os.path.join(output_dir, '*.apk'))):
|
for apkfile in sorted(glob.glob(os.path.join(output_dir, '*.apk'))):
|
||||||
|
|
||||||
apkfilename = os.path.basename(apkfile)
|
appid, vercode = common.apknameinfo(apkfile)
|
||||||
appid, vercode = common.apknameinfo(apkfilename)
|
|
||||||
apks[appid] = apkfile
|
apks[appid] = apkfile
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
@ -103,6 +101,9 @@ def main():
|
||||||
if line.startswith("Failure"):
|
if line.startswith("Failure"):
|
||||||
fail = line[9:-1]
|
fail = line[9:-1]
|
||||||
if fail:
|
if fail:
|
||||||
|
if fail == "INSTALL_FAILED_ALREADY_EXISTS":
|
||||||
|
print "%s is already installed on %s." % (apk, dev)
|
||||||
|
else:
|
||||||
raise Exception("Failed to install %s on %s: %s" % (
|
raise Exception("Failed to install %s on %s: %s" % (
|
||||||
apk, dev, fail))
|
apk, dev, fail))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue