[gtkmm-documentation] tools/meson_aux: Use short options for some commands
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm-documentation] tools/meson_aux: Use short options for some commands
- Date: Tue, 20 Aug 2019 10:08:13 +0000 (UTC)
commit e930a635a62c0b9eca19ba14be106df75067c589
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date: Tue Aug 20 11:11:05 2019 +0200
tools/meson_aux: Use short options for some commands
Posix does not support long options for the cp, rm and mkdir commands.
See mm-common!1
tools/meson_aux/compile-schemas.sh | 11 ++++++-----
tools/meson_aux/copy-to-subdir.sh | 14 ++++++++------
tools/meson_aux/extra-dist-cmd.sh | 8 +++++---
tools/meson_aux/tutorial-custom-cmd.sh | 17 +++++++++--------
4 files changed, 28 insertions(+), 22 deletions(-)
---
diff --git a/tools/meson_aux/compile-schemas.sh b/tools/meson_aux/compile-schemas.sh
index c4b6f43..a007681 100755
--- a/tools/meson_aux/compile-schemas.sh
+++ b/tools/meson_aux/compile-schemas.sh
@@ -4,12 +4,13 @@
# compile-schemas.sh <relative_dir_name> <source_dir> <build_dir> <output_file>
-# relative_dir_name: where the .gschema.xml file is located, relative to source_dir
-# source_dir: where the meson.build file is located.
-# build_dir: the corresponding location in the build tree.
-# output_file: contains the path relative to the directory where this script starts executing.
+# <relative_dir_name> Where the .gschema.xml file is located, relative to source_dir.
+# <source_dir> Where the meson.build file is located.
+# <build_dir> The corresponding location in the build tree.
+# <output_file> Contains the path relative to the directory where this script starts executing.
-( cd "$3"; mkdir --parents "$1" )
+# -p == --parents (Posix does not support long options.)
+mkdir -p "$3/$1"
glib-compile-schemas --strict --targetdir="$3/$1" "$2/$1"
cp "$3/$1/gschemas.compiled" "$4"
diff --git a/tools/meson_aux/copy-to-subdir.sh b/tools/meson_aux/copy-to-subdir.sh
index c5b934b..9d7cc6c 100755
--- a/tools/meson_aux/copy-to-subdir.sh
+++ b/tools/meson_aux/copy-to-subdir.sh
@@ -4,16 +4,18 @@
# copy-to-subdir.sh <input_file_path> <relative_subdir> <output_file_name> <stamp_file_path>
-# input_file_path: input file, possibly including path.
-# relative_subdir: to where the file shall be copied, relative to the input file's directory.
-# output_file_name: output file, without path.
-# stamp_file_path: stamp file, possibly including path.
+# <input_file_path> Input file, possibly including path.
+# <relative_subdir> To where the file shall be copied, relative to the input file's directory.
+# <output_file_name> Output file, without path.
+# <stamp_file_path> Stamp file, possibly including path.
# Paths can be either absolute paths, or paths relative to the directory which
# is current when this script is called.
input_dir_path="$(dirname "$1")"
-( cd "$input_dir_path"; mkdir --parents "$2" )
-cp --preserve "$1" "$input_dir_path/$2/$3"
+# -p == --parents (Posix does not support long options.)
+mkdir -p "$input_dir_path/$2"
+# -p == --preserve
+cp -p "$1" "$input_dir_path/$2/$3"
touch "$4"
diff --git a/tools/meson_aux/extra-dist-cmd.sh b/tools/meson_aux/extra-dist-cmd.sh
index 1c820e8..aa970c2 100755
--- a/tools/meson_aux/extra-dist-cmd.sh
+++ b/tools/meson_aux/extra-dist-cmd.sh
@@ -4,7 +4,7 @@
# extra-dist-cmd.sh <root_source_dir> <root_build_dir> <relative_dist_dir>
-# relative_dist_dir is the distribution directory path relative to root_build_dir.
+# <relative_dist_dir> is the distribution directory path relative to root_build_dir.
# Meson does not preserve timestamps on distributed files. Neither does this script.
# Make a ChangeLog file for distribution.
@@ -17,7 +17,8 @@ dist_docs_tutorial="$3/docs/tutorial"
# English index.docbook and html files.
cp "docs/tutorial/index.docbook" "$dist_docs_tutorial/C/"
-cp --recursive "docs/tutorial/html/" "$dist_docs_tutorial/"
+# -R == --recursive (Posix does not support long options.)
+cp -R "docs/tutorial/html/" "$dist_docs_tutorial/"
# Read the distributed LINGUAS file, containing a list of available translations.
linguas="$dist_docs_tutorial/LINGUAS"
@@ -46,5 +47,6 @@ fi
# Remove all .gitignore files and an empty $3/build directory.
find "$3" -name ".gitignore" -exec rm '{}' \;
if [ -d "$3/build" ]; then
- rmdir --ignore-fail-on-non-empty "$3/build"
+ # Ignore the error, if not empty.
+ rmdir "$3/build" 2>/dev/null || true
fi
diff --git a/tools/meson_aux/tutorial-custom-cmd.sh b/tools/meson_aux/tutorial-custom-cmd.sh
index 411b306..1cc3371 100755
--- a/tools/meson_aux/tutorial-custom-cmd.sh
+++ b/tools/meson_aux/tutorial-custom-cmd.sh
@@ -30,7 +30,8 @@ html)
--stringparam use.id.as.filename 1'
xslt_stylesheet='http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl'
- ( cd "$3"; rm --force --recursive "$2"; mkdir --parents "$2" )
+ # -fR == --force --recursive; -p == --parents (Posix does not support long options.)
+ ( cd "$3"; rm -fR "$2"; mkdir -p "$2" )
# Don't use grep instead of sed. grep returns a non-zero exit status if no line
# is selected, which is the normal case.
set -o pipefail # Return the exit status of xsltproc, if sed succeeds.
@@ -64,13 +65,13 @@ docbook2pdf)
xml_file="$output_dir/$output_basename.xml"
# We need to produce a full examples XML with all of the XIncludes done.
- xmllint --xinclude --postvalid --output "$xml_file" "$2"
+ xmllint --xinclude --postvalid --output "$xml_file" "$2"
- # We also need to copy the figures from the source directory, so they
- # can be found from the XML file.
- cp --preserve --recursive "$3" "$output_dir/$(basename "$3")"
+ # We also need to copy the figures from the source directory, so they
+ # can be found from the XML file.
+ # -R -p == --recursive --preserve
+ cp -R -p "$3" "$output_dir/$(basename "$3")"
- docbook2pdf --output "$output_dir" "$xml_file"
- ;;
+ docbook2pdf --output "$output_dir" "$xml_file"
+ ;;
esac
-
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]