mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-09-05 04:27:55 +00:00
e30437cc4b
Both builders ship a mklocalrepo.sh beside the packages they publish, and each wrote it its own way: builddebs.pl opened, printed and closed the file by hand and then chmod'ed it, while buildrpms.pl used File::Slurper and a separate chmod. Writing the text and setting the executable bit are one operation -- a copy published without 0775 is published broken -- but nothing tied them together, so each caller had to remember the second step. Add BuildUtils::write_script, which writes the file and sets the mode, and use it from both builders. The mode is now asserted in build_utils.t instead of being left to the callers to repeat. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>