aboutsummaryrefslogtreecommitdiff
path: root/projects/libreboot-sources
diff options
context:
space:
mode:
authorAndrew Robbins <contact@andrewrobbins.info>2017-06-22 11:44:19 -0400
committerAndrew Robbins <contact@andrewrobbins.info>2017-06-23 09:25:42 -0400
commit46c6ca3b9ee3e545a41b3b0f488885b20a1c65b5 (patch)
treeaa647a35566e714faa801f66a711ebb6f0da34f3 /projects/libreboot-sources
parent7c8e518c62c6bbe6cd2b465099c561d8d53d38e9 (diff)
downloadlibrebootfr-46c6ca3b9ee3e545a41b3b0f488885b20a1c65b5.tar.gz
librebootfr-46c6ca3b9ee3e545a41b3b0f488885b20a1c65b5.zip
Fixed printf calls & replaced 'echo' w/ printf.
All printf calls should now be properly formatted; prior, the format specifier string was erroneously used for both the format specifiers and the string to be printed. 'env' is now used to locate the printf binary so as to avoid potentially using a shell builtin. Lastly, all calls to 'echo' within the new build system have been replaced with printf for consistency/portability purposes.
Diffstat (limited to 'projects/libreboot-sources')
-rwxr-xr-xprojects/libreboot-sources/install/libreboot-sources22
-rwxr-xr-xprojects/libreboot-sources/libreboot-sources4
2 files changed, 13 insertions, 13 deletions
diff --git a/projects/libreboot-sources/install/libreboot-sources b/projects/libreboot-sources/install/libreboot-sources
index d2f19753..9d8536ef 100755
--- a/projects/libreboot-sources/install/libreboot-sources
+++ b/projects/libreboot-sources/install/libreboot-sources
@@ -21,15 +21,15 @@ SOURCES="sources"
TAR_XZ="tar.xz"
usage() {
- printf "$executable [action] [sources path] (extract path)\n" >&2
+ env printf '%s\n' "$executable [action] [sources path] (extract path)" >&2
- printf "\nActions:\n" >&2
- printf " extract - Extract build system sources\n" >&2
- printf " copy - Copy projects sources\n" >&2
- printf " prepare - Extract and copy sources\n" >&2
+ env printf '\n%s\n' 'Actions:' >&2
+ env printf '%s\n' ' extract - Extract build system sources' >&2
+ env printf '%s\n' ' copy - Copy projects sources' >&2
+ env printf '%s\n' ' prepare - Extract and copy sources' >&2
- printf "\n When no extract path is provided, sources are extracted in the current\n"
- printf " directory.\n"
+ env printf '\n%s\n' ' When no extract path is provided, sources are extracted in the current'
+ env printf '%s\n' ' directory.'
}
extract() {
@@ -49,14 +49,14 @@ extract() {
archive=$( find $sources_path -name "$BUILD_SYSTEM-sources.$TAR_XZ" || true )
if [ -z "$archive" ]
then
- printf "Finding $BUILD_SYSTEM sources archive failed!\n" >&2
+ env printf '%s\n' "Finding $BUILD_SYSTEM sources archive failed!" >&2
usage
exit 1
fi
tar -xf "$archive" -ps -C "$extract_path"
- printf "\nExtracted $BUILD_SYSTEM sources from $sources_path to $extract_path\n"
+ env printf '\n%s\n' "Extracted $BUILD_SYSTEM sources from $sources_path to $extract_path"
}
copy() {
@@ -83,7 +83,7 @@ copy() {
cp "$file" "$build_system_sources_path"
done
- printf "\nCopied $BUILD_SYSTEM sources from $sources_path to $extract_path\n"
+ env printf '\n%s\n' "Copied $BUILD_SYSTEM sources from $sources_path to $extract_path"
}
requirements() {
@@ -96,7 +96,7 @@ requirements() {
if [ -z "$requirement_path" ]
then
- printf "Missing requirement: $requirement\n" >&2
+ env printf '%s\n' "Missing requirement: $requirement" >&2
exit 1
fi
done
diff --git a/projects/libreboot-sources/libreboot-sources b/projects/libreboot-sources/libreboot-sources
index a7fa5435..259cb10a 100755
--- a/projects/libreboot-sources/libreboot-sources
+++ b/projects/libreboot-sources/libreboot-sources
@@ -38,8 +38,8 @@ release() {
project_release_install "$project" "$TOOLS" "$@"
- echo "$VERSION" > "$sources_path/$DOTVERSION"
- echo "$SOURCE_DATE_EPOCH" > "$sources_path/$DOTEPOCH"
+ env printf '%s\n' "$VERSION" > "$sources_path/$DOTVERSION"
+ env printf '%s\n' "$SOURCE_DATE_EPOCH" > "$sources_path/$DOTEPOCH"
if git_check "$sources_path"
then