Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: fix file mode of shell scripts (644 -> 755) #5206

Merged
merged 1 commit into from
Jun 17, 2022

Conversation

kmk3
Copy link
Collaborator

@kmk3 kmk3 commented Jun 16, 2022

Some shell scripts are not executable, so fix their file modes:

$ git grep -Elz '^#!/bin/(ba)?sh' | xargs -0 -I '{}' \
  chmod +x '{}'

Files changed:

  • src/fgit/fgit-uninstall.sh
  • src/tools/extract_errnos.sh

Note: I have manually checked that the files above are indeed intended
to be executable directly and not just sourced, as a script of the
latter kind could also contain a shebang (for example, to help ensure
proper syntax highlighting).

Misc: The affected files were added on commit e46dd3e ("git-install",
2017-02-04) and on commit 081d1fb ("Add seccomp errno filter support",
2015-09-23) / PR #66, respectively.

Cc: @netblue30 @wader

Some shell scripts are not executable, so fix their file modes:

    $ git grep -Elz '^#!/bin/(ba)?sh' | xargs -0 -I '{}' \
      chmod +x '{}'

Files changed:

* src/fgit/fgit-uninstall.sh
* src/tools/extract_errnos.sh

Note: I have manually checked that the files above are indeed intended
to be executable directly and not just sourced, as a script of the
latter kind could also contain a shebang (for example, to help ensure
proper syntax highlighting).

Misc: The affected files were added on commit e46dd3e ("git-install",
2017-02-04) and on commit 081d1fb ("Add seccomp errno filter support",
2015-09-23) / PR netblue30#66, respectively.
@kmk3 kmk3 changed the title Fix file mode of shell scripts (644 -> 755) build: fix file mode of shell scripts (644 -> 755) Jun 16, 2022
@wader
Copy link
Contributor

wader commented Jun 17, 2022

LGTM, note that extract_errnos.sh is mostly a dev-time thing and not that useful for a end user i guess

@netblue30 netblue30 merged commit bdb193a into netblue30:master Jun 17, 2022
@netblue30
Copy link
Owner

I have to do some cleanup there, we disconnected src/fgit from the interface a long time ago, The files in src/tools are for development only.

@kmk3 kmk3 deleted the fix-file-mode-sh branch June 17, 2022 18:02
@kmk3
Copy link
Collaborator Author

kmk3 commented Jun 18, 2022

@wader commented on Jun 17:

LGTM, note that extract_errnos.sh is mostly a dev-time thing and not that
useful for a end user i guess

@netblue30 commented on Jun 17:

The files in src/tools are for development only.

I don't understand why you mention this.

The file mode changes were made because regardless of the target audience, the
point of having #!/bin/foo in a file is so that it can be executed as ./bar
(rather than using $SHELL bar), which requires execute permissions. This is
also the case for the other shell scripts in src/tools.

Misc: I mostly created a PR (instead of committing directly) as a reminder to
maybe create a CI check for this later.

@kmk3
Copy link
Collaborator Author

kmk3 commented Jun 18, 2022

@netblue30 commented on Jun 17:

I have to do some cleanup there, we disconnected src/fgit from the interface
a long time ago

For reference: commit 756fed6 ("remving src/fgit", 2022-06-17).

I was going to commit a removal of the leftover --enable-git-install /
--git-uninstall flags from the fgit files after this PR, but that's even
better. The commit message showed that all indeed appeared to be removed (and
that's still the case with 756fed6), so I'll paste it here for future
reference:


build: remove remnants of --git-install / --git-uninstall

This amends commit 23d10c8 ("deprecated --git-install and
--git-uninstall", 2018-04-04).

Relevant options and variables:

  • --disable-git-install
  • --enable-git-install
  • --git-install
  • --git-uninstall
  • HAVE_GIT_INSTALL
  • enable_git_install

With this commit, it looks like all traces of the above are fully removed:

$ git grep -F -e GIT_INSTALL -e git-install \
  -e git-uninstall -e git_install
README: - compile/install scripts for --git-install/--git-uninstall commands
RELNOTES:  * modif: --git-install and --git-uninstall removed
src/fgit/fgit-install.sh:echo "           $(dirname "$0")/fgit-uninstall.sh"

kmk3 added a commit to kmk3/firejail that referenced this pull request Jul 12, 2022
The following leverages the fact that when using a normal merge (as
opposed to "rebase and merge" or "squash and merge") on GitHub, the pull
request number is put in the commit message title and the title of the
PR is added to the commit message body.

Commands used to find and print the items for the RELNOTES:

    $ git log --grep='^build:' --merges --reverse --pretty='%s %b' 0.9.70.. |
      sed -E -n 's/Merge pull request (#[0-9]+) from [^ ]+ (.*)/  * \2 (\1)/p'
      * build: deduplicate configure-time vars into new config files (netblue30#5140)
      * build: fix file mode of shell scripts (644 -> 755) (netblue30#5206)
      * build: reduce autoconf input files from 32 to 2 (netblue30#5219)

Commands used to generate the message below:

    $ git log --grep='^build:' --merges --reverse --pretty='%s %b' 0.9.70.. |
      sed -E -n 's/Merge pull request (#[0-9]+).*/\1/p' | sort | tr '\n' ' ' |
      sed -E 's/^(.*) /Relates to \1./'
    Relates to netblue30#5140 netblue30#5206 netblue30#5219.

Relates to netblue30#5140 netblue30#5206 netblue30#5219.
kmk3 added a commit that referenced this pull request Jul 12, 2022
The following leverages the fact that when using a normal merge (as
opposed to "rebase and merge" or "squash and merge") on GitHub, the pull
request number is put in the commit message title and the title of the
PR is added to the commit message body.

Commands used to find and print the items for the RELNOTES:

    $ git log --grep='^build:' --merges --reverse --pretty='%s %b' 0.9.70.. |
      sed -E -n 's/Merge pull request (#[0-9]+) from [^ ]+ (.*)/  * \2 (\1)/p'
      * build: deduplicate configure-time vars into new config files (#5140)
      * build: fix file mode of shell scripts (644 -> 755) (#5206)
      * build: reduce autoconf input files from 32 to 2 (#5219)

Commands used to generate the message below:

    $ git log --grep='^build:' --merges --reverse --pretty='%s %b' 0.9.70.. |
      sed -E -n 's/Merge pull request (#[0-9]+).*/\1/p' | sort | tr '\n' ' ' |
      sed -E 's/^(.*) /Relates to \1./'
    Relates to #5140 #5206 #5219.

Relates to #5140 #5206 #5219.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done (on RELNOTES)
Development

Successfully merging this pull request may close these issues.

3 participants