Commit 64456b54 authored by echel0n's avatar echel0n

Fixed path issue with cleanup function for startup

parent 7ce76270
......@@ -218,7 +218,7 @@ release:sentry:develop:
deploy:pypi:
stage: release_deploy
image: python:3.8-alpine3.9
image: python:3.8-alpine3.12
script:
- apk add --no-cache py-pip gcc libffi-dev python3-dev musl-dev openssl-dev
- pip install -U twine
......
......@@ -44,9 +44,9 @@ with open(checksum_file, "rb") as fp:
file, checksum = line.decode().strip().split(' = ')
full_filename = main_dir.joinpath(file)
if full_filename != checksum_file:
if not os.path.exists(full_filename) or md5(full_filename) != checksum:
print('SiCKRAGE file {} integrity check failed'.format(full_filename))
if not full_filename.exists() or md5(full_filename) != checksum:
print('SiCKRAGE file {} checksum invalid'.format(full_filename))
failed = True
if not failed:
print('SiCKRAGE file integrity check passed')
print('SiCKRAGE file checksums are all valid')
......@@ -24,6 +24,7 @@ import argparse
import atexit
import gettext
import os
import pathlib
import site
import subprocess
import sys
......@@ -212,14 +213,14 @@ def file_cleanup(remove=False):
with open(CHECKSUM_FILE, "rb") as fp:
for line in fp.readlines():
file, checksum = line.strip().split(b' = ')
full_filename = os.path.join(MAIN_DIR, file.decode())
file, checksum = line.decode().strip().split(' = ')
full_filename = pathlib.Path(MAIN_DIR).joinpath(file)
valid_files.append(full_filename)
for root, dirs, files in os.walk(PROG_DIR):
for file in files:
full_filename = os.path.join(root, file)
if full_filename != CHECKSUM_FILE and full_filename not in valid_files and PROG_DIR in full_filename:
full_filename = pathlib.Path(root).joinpath(file)
if full_filename != pathlib.Path(CHECKSUM_FILE) and full_filename not in valid_files and PROG_DIR in str(full_filename):
try:
if remove:
os.remove(full_filename)
......@@ -331,7 +332,7 @@ def main():
check_requirements()
# cleanup unwanted files
# file_cleanup(remove=not args.no_clean)
file_cleanup(remove=not args.no_clean)
try:
from sickrage.core import Core
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment