Skip to content

Taskfile: Add "tidy" for simple find-replace cleanup of package.yml - #10671

Open
davidjharder wants to merge 1 commit into
mainfrom
firnd-replace-task
Open

davidjharder wants to merge 1 commit into
mainfrom
firnd-replace-task

Conversation

@davidjharder

@davidjharder davidjharder commented Sep 12, 2026

Copy link
Copy Markdown
Member

Summary

  • This new task runs simple find and replace on package.ymls looking for a couple groups of old-style packaging idioms:
  • The various directory variables are surrounded by curly braces: $pkgfiles -> ${pkgfiles}
  • Variations of install -Dm00644 -> %install_file
  • Variations of install -dm00755 -> %install_dir
  • Variations of install -Dm00755 -> %install_exe FIXME_EXE_or_BIN. Becuase a simple find and replace can't be trusted with fixing the install commands for executables, drop in a FIXME that will remind the packager to pick the correct macro and edit accordingly

Test Plan

  • Tidy a few package.yml files

Checklist

  • Package was built and tested against unstable
  • This change could gainfully be listed in the weekly sync notes once merged
  • I agree to license this contribution and all my previous contributions under the licensing terms in LICENSE.md and have the power and authority to grant those licenses.

@davidjharder

Copy link
Copy Markdown
Member Author

I have called this command "tidy" but if anyone has better ideas, open to them

Comment thread Taskfile.yml
Comment on lines +204 to +207
- sed -i 's/install -Dm00644/%install_file/g' package.yml # install files
- sed -i 's/install -Dm 00644/%install_file/g' package.yml
- sed -i 's/install -D -m 00644/%install_file/g' package.yml
- sed -i 's/install -D -m644/%install_file/g' package.yml

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if all of these could be simplified to just install -D.+644, or install -D*644

@EbonJaeger

Copy link
Copy Markdown
Member

I'm a little hesitant about the macro swaps, because I've encountered a few times where the install command was being used with the wrong permissions or flags for a file or directory, and I'd be afraid of the wrong type being matched and the packager not noticing, since that kind of information isn't recorded in the pspec file.

@davidjharder

Copy link
Copy Markdown
Member Author

IMO it's a fine trade-off for automating the donkey work of swapping in the macros. Doing it automatically shouldn't add any packaging errors that weren't there already.

I'll investigate if the search targets can use some wildcards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

2 participants