aboutsummaryrefslogtreecommitdiff
path: root/libs/git
diff options
context:
space:
mode:
Diffstat (limited to 'libs/git')
-rwxr-xr-xlibs/git32
1 files changed, 16 insertions, 16 deletions
diff --git a/libs/git b/libs/git
index a750be32..decdfe01 100755
--- a/libs/git
+++ b/libs/git
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
#
@@ -202,19 +202,19 @@ git_describe() {
}
git_files() {
- local repository_path=$1
+ local repository_path="$1"
(
cd "$repository_path"
# Reproducible sorting.
- git ls-files | LC_ALL=C sort -z
+ git ls-files -z | env LC_ALL='C.UTF-8' sort -z
)
}
git_project_repository_path() {
local repository=$1
- echo "$root/$SOURCES/$repository"
+ printf '%s\n' "$root/$SOURCES/$repository"
}
git_project_check() {
@@ -231,23 +231,23 @@ git_project_patch_recursive() {
local branch="$3"
local path="${4:-.}"
- local repository_path="$(git_project_repository_path "${repository}")"
- local project_path="$(project_path "${project}")"
- local patches_path="${project_path}/${PATCHES}/${path}"
+ local repository_path="$(git_project_repository_path "$repository")"
+ local project_path="$(project_path "$project")"
+ local patches_path="$project_path/$PATCHES/$path"
- if ! [[ -d "${patches_path}" ]]; then
+ if ! [[ -d "$patches_path" ]]; then
return
fi
- if [[ "${path}" != "." ]]; then
- git_project_patch_recursive "${project}" "${repository}" "${branch}" "$(dirname "${path}")"
+ if [[ "$path" != "." ]]; then
+ git_project_patch_recursive "$project" "$repository" "$branch" "$(dirname "$path")"
fi
- for patch in "${patches_path}"/[!.]*.{patch,diff}; do
+ for patch in "$patches_path"/[!.]*.@(patch|diff); do
if [[ "${patch##*.}" == "patch" ]]; then
- git_patch "${repository_path}" "${branch}" "${patch}"
+ git_patch "$repository_path" "$branch" "$patch"
else
- diff_patch_file "${repository_path}" "${patch}"
+ diff_patch_file "$repository_path" "$patch"
fi
done
}
@@ -579,10 +579,10 @@ git_project_release() {
if ! [ -z "$release_branch" ]
then
- local archive_path="$root/$RELEASE/$SOURCES/$project/$release_branch.$TAR_XZ"
+ local archive_path="$root/$RELEASE/$SOURCES/$project/$release_branch.$ARCHIVE"
local sources_path="$root/$SOURCES/$repository"
- printf "Releasing sources archive for $project (with ${arguments:-no argument}) from "$repository" git\n"
+ printf '%s\n' "Releasing sources archive for $project (with ${arguments:-no argument}) from "$repository" git"
git_branch_checkout "$repository_path" "$release_branch"
git_submodule_update "$repository_path"
@@ -620,7 +620,7 @@ git_project_release_check() {
if ! [ -z "$release_branch" ]
then
- local archive_path="$root/$RELEASE/$SOURCES/$project/$release_branch.$TAR_XZ"
+ local archive_path="$root/$RELEASE/$SOURCES/$project/$release_branch.$ARCHIVE"
file_exists_check "$archive_path"