Menu

Why is refind-mkdefault a Python script?

No Name
2017-11-20
2017-11-20
  • No Name

    No Name - 2017-11-20

    Unlike refind-install, refind-mkdefault is not a shell script, but a Python 3 script. What is the reason for that? Are there plans to rewrite it? This causes troubles on systems that don't ship with Python 3 by default (for example latest stable Slackware version 14.2).

     
  • Roderick W. Smith

    The reason is that I began learning Python since beginning the rEFInd project and I wanted to use it as an exercise. Also, Python's features for managing strings and lists are superior to those available in Bash -- although to be sure, the things that refind-mkdefault does could be done in Bash; it's just a little cleaner in Python.

    As Python 3 has been around for quite a while (it was released in 2008), anything that doesn't ship with it is hopelessly out of date. Many OSes are in the process of retiring the older Python 2.x, in fact. (FWIW, I find the incompatibilities between the different versions of Python to be one of the language's many frustrations.) I'm not a Slackware user, but a quick Google suggests that Python 3 is available for it, even if it's not installed by default; see here, for instance. It's possible for Python 2.x and 3 to coexist on a single system, so there's little reason to not install both.

    I have no plans to rewrite python-mkdefault in Bash, and I probably would not accept such a submission, as it would simply be replicated code that would require extra effort to maintain.

     
  • No Name

    No Name - 2017-11-20

    Fair enough. Python 3 also made it into Slackware -current and it will be available in the next stable release.

     

Log in to post a comment.