예제 #1
0
        public static bool SystemEligibleForRootfsUpdate()
        {
            bool eligibleForUpdate = false;

            try
            {
                Match match = Regex.Match(ScriptVersion, @"v(\d+.\d+.\d+)[\-\.](\d+)(.*)");
                if (match.Success)
                {
                    string version  = match.Groups[1].Value;
                    string revision = match.Groups[2].Value;

                    if (!Shared.IsVersionGreaterOrEqual(version, hakchi.CurrentHakchiScriptVersion) ||
                        !(int.Parse(revision) >= int.Parse(hakchi.CurrentHakchiScriptRevision)))
                    {
                        eligibleForUpdate = true;
                    }
                }
            }
            catch
            {
                eligibleForUpdate = true;
            }
            return(eligibleForUpdate);
        }
예제 #2
0
        public static bool SystemRequiresReflash()
        {
            bool requiresReflash = false;

            try
            {
                string kernelVersion = KernelVersion.Substring(0, KernelVersion.LastIndexOf('.'));
                if (!Shared.IsVersionGreaterOrEqual(kernelVersion, hakchi.MinimumHakchiKernelVersion) ||
                    !Shared.IsVersionGreaterOrEqual(BootVersion, hakchi.MinimumHakchiBootVersion))
                {
                    requiresReflash = true;
                }
            }
            catch
            {
                requiresReflash = true;
            }
            return(requiresReflash);
        }
예제 #3
0
        public static bool SystemEligibleForRootfsUpdate()
        {
            bool eligibleForUpdate = false;

            try
            {
                string scriptVersion = ScriptVersion.Substring(ScriptVersion.IndexOf('v') + 1);
                scriptVersion = scriptVersion.Substring(0, scriptVersion.LastIndexOf('('));

                var scriptElems = scriptVersion.Split(new char[] { '-' });
                if (!Shared.IsVersionGreaterOrEqual(scriptElems[0], hakchi.CurrentHakchiScriptVersion) ||
                    !(int.Parse(scriptElems[1]) >= int.Parse(hakchi.CurrentHakchiScriptRevision)))
                {
                    eligibleForUpdate = true;
                }
            }
            catch
            {
                eligibleForUpdate = true;
            }
            return(eligibleForUpdate);
        }