mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
@@ -103,5 +103,18 @@ namespace Jackett.Common.Utils
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool IsNonWindowsDotNetCoreVariant(JackettVariant variant)
|
||||||
|
{
|
||||||
|
if (variant == JackettVariant.CoreMacOs || variant == JackettVariant.CoreLinuxAmdx64
|
||||||
|
|| variant == JackettVariant.CoreLinuxArm32 || variant == JackettVariant.CoreLinuxArm64)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -174,6 +174,34 @@ namespace Jackett.Updater
|
|||||||
// On unix we kill the PIDs after the update so e.g. systemd can automatically restart the process
|
// On unix we kill the PIDs after the update so e.g. systemd can automatically restart the process
|
||||||
KillPids(pids);
|
KillPids(pids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Variants variants = new Variants();
|
||||||
|
if (variants.IsNonWindowsDotNetCoreVariant(variant))
|
||||||
|
{
|
||||||
|
// On Linux you can't modify an executable while it is executing
|
||||||
|
// https://github.com/Jackett/Jackett/issues/5022
|
||||||
|
// https://stackoverflow.com/questions/16764946/what-generates-the-text-file-busy-message-in-unix#comment32135232_16764967
|
||||||
|
// Delete the ./jackett executable
|
||||||
|
try
|
||||||
|
{
|
||||||
|
logger.Info("Attempting to remove the jackett executable from: " + options.Path);
|
||||||
|
string executable = options.Path.TrimEnd('/') + "/jackett";
|
||||||
|
if (File.Exists(executable))
|
||||||
|
{
|
||||||
|
File.Delete(executable);
|
||||||
|
logger.Info("Deleted " + executable);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
logger.Info("jackett executable not found in: " + executable);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
logger.Error(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
logger.Info("Finding files in: " + updateLocation);
|
logger.Info("Finding files in: " + updateLocation);
|
||||||
var files = Directory.GetFiles(updateLocation, "*.*", SearchOption.AllDirectories);
|
var files = Directory.GetFiles(updateLocation, "*.*", SearchOption.AllDirectories);
|
||||||
foreach (var file in files)
|
foreach (var file in files)
|
||||||
@@ -402,8 +430,8 @@ namespace Jackett.Updater
|
|||||||
|
|
||||||
private string GetJackettConsolePath(string directoryPath)
|
private string GetJackettConsolePath(string directoryPath)
|
||||||
{
|
{
|
||||||
if (variant == Variants.JackettVariant.CoreMacOs || variant == Variants.JackettVariant.CoreLinuxAmdx64
|
Variants variants = new Variants();
|
||||||
|| variant == Variants.JackettVariant.CoreLinuxArm32 || variant == Variants.JackettVariant.CoreLinuxArm64)
|
if (variants.IsNonWindowsDotNetCoreVariant(variant))
|
||||||
{
|
{
|
||||||
return Path.Combine(directoryPath, "jackett");
|
return Path.Combine(directoryPath, "jackett");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user