diff options
author | Andrew Robbins <contact@andrewrobbins.info> | 2017-05-31 02:21:11 -0400 |
---|---|---|
committer | Andrew Robbins <contact@andrewrobbins.info> | 2017-05-31 06:24:24 -0400 |
commit | 1ea8d09af262ddeed87acf5916cec42d9a002da1 (patch) | |
tree | 195dc287813bdf9ee8240092a56f19bbad68dd1e /libs/common | |
parent | 10aa44585ed4dd1495f47229daa2db4831694c9c (diff) | |
download | librebootfr-1ea8d09af262ddeed87acf5916cec42d9a002da1.tar.gz librebootfr-1ea8d09af262ddeed87acf5916cec42d9a002da1.zip |
Patching now works. bucts can be patched & built.
Modified the function git_project_patch_recursive (in libs/git) to
enable patching with diff files, which uses the new function
diff_patch_file located in libs/common. A generic action script for
bucts is in projects/bucts/. Install/revision/target files are in
projects/bucts/configs/. bucts' merge into the new build system should
be nearly, if not already, complete.
Diffstat (limited to 'libs/common')
-rwxr-xr-x | libs/common | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libs/common b/libs/common index a64a7b9b..8f1379ee 100755 --- a/libs/common +++ b/libs/common @@ -63,6 +63,23 @@ arguments_list() { done } +diff_patch_file() { + local repository_path="$1" + local patch_file_path="$2" + + local filename_in_diff="$(sed -rne 's/^-{3} {1}(.*)$/\1/p' <"${patch_file_path}")" + + local source_file_path + + if ! ( grep -E '^-{3}.*/' <"${patch_file_path}" >/dev/null 2>&1 ); then + source_file_path="${repository_path}/${filename_in_diff##\ }" + else + source_file_path="${repository_path}/${filename_in_diff##*/}" + fi + + patch "${source_file_path}" "${patch_file_path}" +} + path_wildcard_expand() { local path=$@ |