[pacman-dev] [PATCH 1/2] meson: separate out wrapped from non-wrapped scripts
makepkg-template is a perl script and doesn't get wrapped by our shell wrapper. It (wrongly) reads from the host machine rather than the build root, but this is working as implemented. --- wohoo first bug that affects one buildsys and not the other! scripts/meson.build | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/scripts/meson.build b/scripts/meson.build index 535eccba..50b0c34f 100644 --- a/scripts/meson.build +++ b/scripts/meson.build @@ -1,5 +1,4 @@ -scripts = [ - 'makepkg-template.pl.in', +wrapped_scripts = [ 'makepkg.sh.in', 'pacman-db-upgrade.sh.in', 'pacman-key.sh.in', @@ -7,6 +6,10 @@ scripts = [ 'repo-add.sh.in' ] +scripts = [ + 'makepkg-template.pl.in', +] + library_files = [ 'library/human_to_size.sh', 'library/size_to_human.sh', @@ -26,6 +29,19 @@ m4_edit = generator( foreach script : scripts script_shortname = script.split('.')[0] + custom_target( + script, + input : m4_edit.process(script), + command : [ SCRIPT_EDITOR, '@INPUT@', '@OUTPUT@', '0755'], + output : script_shortname, + depend_files : library_files, + install : true, + install_dir : get_option('bindir')) +endforeach + +foreach script : wrapped_scripts + script_shortname = script.split('.')[0] + # Build the script, but don't install it. We want to keep it as a "private" # artifact that we reference from a wrapper script in order to bootstrap it # the build directory. -- 2.19.1
This was only ever used by paccache, and paccache has since been moved to pacman-contrib. --- scripts/Makefile.am | 3 +-- scripts/library/README | 4 ---- scripts/library/size_to_human.sh | 22 ---------------------- scripts/meson.build | 1 - scripts/po/POTFILES.in | 1 - 5 files changed, 1 insertion(+), 30 deletions(-) delete mode 100644 scripts/library/size_to_human.sh diff --git a/scripts/Makefile.am b/scripts/Makefile.am index c6b6220e..26c2e10d 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -35,8 +35,7 @@ EXTRA_DIST = \ $(LIBMAKEPKG_DIST) LIBRARY = \ - library/human_to_size.sh \ - library/size_to_human.sh + library/human_to_size.sh libmakepkgdir = $(datarootdir)/makepkg diff --git a/scripts/library/README b/scripts/library/README index 2b3a97bc..b99b0bc8 100644 --- a/scripts/library/README +++ b/scripts/library/README @@ -8,7 +8,3 @@ successful, the converted byte value is written to stdout and the function returns 0. If an error occurs, nothing in written and the function returns 1. Results may be inaccurate when using a broken implementation of awk, such as mawk or busybox awk. - -size_to_human.sh: -The reverse of human_to_size, this function takes an integer byte size and -prints its in human readable format, with SI prefixes (e.g. MiB, TiB). diff --git a/scripts/library/size_to_human.sh b/scripts/library/size_to_human.sh deleted file mode 100644 index 1d13eeb4..00000000 --- a/scripts/library/size_to_human.sh +++ /dev/null @@ -1,22 +0,0 @@ -size_to_human() { - awk -v size="$1" ' - BEGIN { - suffix[1] = "B" - suffix[2] = "KiB" - suffix[3] = "MiB" - suffix[4] = "GiB" - suffix[5] = "TiB" - suffix[6] = "PiB" - suffix[7] = "EiB" - count = 1 - - while (size > 1024) { - size /= 1024 - count++ - } - - sizestr = sprintf("%.2f", size) - sub(/\.?0+$/, "", sizestr) - printf("%s %s", sizestr, suffix[count]) - }' -} diff --git a/scripts/meson.build b/scripts/meson.build index 50b0c34f..aece7a22 100644 --- a/scripts/meson.build +++ b/scripts/meson.build @@ -12,7 +12,6 @@ scripts = [ library_files = [ 'library/human_to_size.sh', - 'library/size_to_human.sh', ] SCRIPT_EDITOR = find_program(configure_file( diff --git a/scripts/po/POTFILES.in b/scripts/po/POTFILES.in index 37afc3b2..25eb9d3f 100644 --- a/scripts/po/POTFILES.in +++ b/scripts/po/POTFILES.in @@ -67,4 +67,3 @@ scripts/libmakepkg/util/pkgbuild.sh.in scripts/libmakepkg/util/source.sh.in scripts/libmakepkg/util/util.sh.in scripts/library/human_to_size.sh -scripts/library/size_to_human.sh -- 2.19.1
participants (1)
-
Dave Reisner