[6.0] 4ca376fab Switch to python3 in all our scripts shebangs

Dridi Boukelmoune dridi at varni.sh
Wed Dec 11 11:49:02 UTC 2019


On Wed, Dec 11, 2019 at 11:37 AM Dridi Boukelmoune
<dridi.boukelmoune at gmail.com> wrote:
>
>
> commit 4ca376fab22e126b4e0a89d1773c379d1af23d0e
> Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
> Date:   Tue Mar 12 10:30:35 2019 +0100
>
>     Switch to python3 in all our scripts shebangs

This is a back-port of a commit from when trunk switched to python3
only. Since python2 is going EOL soon, and 6.0 LTS will outlive it, I
skipped the pull request step since:

- patch applied without a conflict
- it fixes all shebangs in 6.0
- our scripts are already py3-ready

I sent another email to this list to inform you that RHEL 8 bans the
unversioned /usr/bin/python version so in addition to saying goodbye
to py2 on all active branches this is also a necessary step to enable
el8 support in the future. For this reason I'm cross-posting on both
dev and commit mailing lists.

I'll leave it to Reza (CC'd) to include this in the changelog. Our 6.x
packaging already requires python3 anyway, it's just that if python2
is present in the build root it will no longer be used implicitly (or at all).

Dridi

> diff --git a/bin/varnishtest/huffman_gen.py b/bin/varnishtest/huffman_gen.py
> index ab6b30e87..dd4f8e1e8 100755
> --- a/bin/varnishtest/huffman_gen.py
> +++ b/bin/varnishtest/huffman_gen.py
> @@ -1,4 +1,4 @@
> -#!/usr/bin/env python
> +#!/usr/bin/env python3
>
>  import re
>  import sys
> diff --git a/bin/varnishtest/witness.py b/bin/varnishtest/witness.py
> index a4f0fffa6..af4a56e55 100644
> --- a/bin/varnishtest/witness.py
> +++ b/bin/varnishtest/witness.py
> @@ -1,4 +1,4 @@
> -#!/usr/bin/env python
> +#!/usr/bin/env python3
>  #
>  # This script is in the public domain
>  #
> diff --git a/doc/sphinx/vtc-syntax.py b/doc/sphinx/vtc-syntax.py
> index ba7bd6bd7..6d4946d32 100644
> --- a/doc/sphinx/vtc-syntax.py
> +++ b/doc/sphinx/vtc-syntax.py
> @@ -1,4 +1,4 @@
> -#!/usr/bin/env python
> +#!/usr/bin/env python3
>  #
>  # Copyright (c) 2006-2016 Varnish Software AS
>  # All rights reserved.
> diff --git a/include/generate.py b/include/generate.py
> index e7d547593..c1ea3bcbb 100755
> --- a/include/generate.py
> +++ b/include/generate.py
> @@ -1,4 +1,4 @@
> -#!/usr/bin/env python
> +#!/usr/bin/env python3
>  #
>  # Copyright (c) 2006 Verdens Gang AS
>  # Copyright (c) 2006-2015 Varnish Software AS
> diff --git a/include/tbl/style.py b/include/tbl/style.py
> index a88c475a3..0e7f657fb 100644
> --- a/include/tbl/style.py
> +++ b/include/tbl/style.py
> @@ -1,4 +1,4 @@
> -#!/usr/bin/env python
> +#!/usr/bin/env python3
>  #
>  # Very basic style-checker for include/tbl files.
>
> diff --git a/lib/libvarnishapi/generate.py b/lib/libvarnishapi/generate.py
> index d1357c985..ea4ebd02a 100755
> --- a/lib/libvarnishapi/generate.py
> +++ b/lib/libvarnishapi/generate.py
> @@ -1,4 +1,4 @@
> -#!/usr/bin/env python
> +#!/usr/bin/env python3
>  #-
>  # Copyright (c) 2006 Verdens Gang AS
>  # Copyright (c) 2006-2015 Varnish Software AS
> diff --git a/lib/libvcc/generate.py b/lib/libvcc/generate.py
> index 31edaa4a7..919e1569a 100755
> --- a/lib/libvcc/generate.py
> +++ b/lib/libvcc/generate.py
> @@ -1,4 +1,4 @@
> -#!/usr/bin/env python
> +#!/usr/bin/env python3
>  #
>  # Copyright (c) 2006 Verdens Gang AS
>  # Copyright (c) 2006-2015 Varnish Software AS
> diff --git a/lib/libvcc/vmodtool.py b/lib/libvcc/vmodtool.py
> index e92cf521e..14f93b11d 100755
> --- a/lib/libvcc/vmodtool.py
> +++ b/lib/libvcc/vmodtool.py
> @@ -1,4 +1,4 @@
> -#!/usr/bin/env python
> +#!/usr/bin/env python3
>  #
>  # Copyright (c) 2010-2016 Varnish Software
>  # All rights reserved.
> diff --git a/lib/libvcc/vsctool.py b/lib/libvcc/vsctool.py
> index f1e0d02ab..e65b0072f 100644
> --- a/lib/libvcc/vsctool.py
> +++ b/lib/libvcc/vsctool.py
> @@ -1,4 +1,4 @@
> -#!/usr/bin/env python
> +#!/usr/bin/env python3
>  # -*- encoding: utf-8 -*-
>  #
>  # Copyright (c) 2017 Varnish Software AS
> diff --git a/tools/gcov_digest.py b/tools/gcov_digest.py
> index 188fb499d..3fbfdf946 100644
> --- a/tools/gcov_digest.py
> +++ b/tools/gcov_digest.py
> @@ -1,4 +1,4 @@
> -#!/usr/bin/env python
> +#!/usr/bin/env python3
>  #
>  # Copyright (c) 2017 Varnish Software AS
>  # All rights reserved.
> diff --git a/tools/include_wash.py b/tools/include_wash.py
> index 973d5d6ad..94c11ba2c 100644
> --- a/tools/include_wash.py
> +++ b/tools/include_wash.py
> @@ -1,4 +1,4 @@
> -#!/usr/bin/env python
> +#!/usr/bin/env python3
>
>  from __future__ import print_function
>
> _______________________________________________
> varnish-commit mailing list
> varnish-commit at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit


More information about the varnish-dev mailing list