1
0
mirror of https://github.com/CMiksche/gitea-auto-update synced 2025-12-10 16:07:23 +01:00

Merge pull request #23 from maloo1/patch-1

Changes for SELinux, closes #23
This commit is contained in:
Christoph Daniel Miksche
2021-06-15 21:03:56 +02:00
committed by GitHub
2 changed files with 7 additions and 3 deletions

View File

@@ -16,4 +16,5 @@ def build_from_source(tag, gt_file, source_dir):
os.system("git pull") os.system("git pull")
os.system("git checkout " + tag) os.system("git checkout " + tag)
os.system('TAGS="bindata sqlite sqlite_unlock_notify" make generate build') os.system('TAGS="bindata sqlite sqlite_unlock_notify" make generate build')
os.system("mv gitea " + gt_file) os.system("cp gitea " + gt_file)
os.system("rm -f gitea")

View File

@@ -74,10 +74,13 @@ class Download:
# extracting download file # extracting download file
cmd = "xz -d " + self.tmp_xz cmd = "xz -d " + self.tmp_xz
os.system(cmd) os.system(cmd)
# moving temp file to gtfile location # copying temp file to gtfile location. Copying preserves SELinux permissions
cmd = 'mv ' + self.tmp_dir + 'gitea-' + self.github_version \ cmd = 'cp ' + self.tmp_dir + 'gitea-' + self.github_version \
+ '-' + self.gt_system + ' ' + self.gt_file + '-' + self.gt_system + ' ' + self.gt_file
os.system(cmd) os.system(cmd)
# cleaning up tmp file
cmd = 'rm -f ' + self.tmp_dir + 'gitea-' + self.github_version + '-' + self.gt_system
os.system(cmd)
cmd = 'chmod +x ' + self.gt_file cmd = 'chmod +x ' + self.gt_file
os.system(cmd) os.system(cmd)