-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
69 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/bash | ||
cd Linux/Foo/CMakeFiles | ||
declare -A cMakeBuildDir | ||
while IFS=',' read -r cmakeName buildDir; do | ||
cMakeBuildDir["$cmakeName"]="$buildDir" | ||
done < <(grep -m1 -R --include "build.make" -e ".*-complete:.*-build" * | | ||
sed -E -n 's/^(.*)\.dir.*-complete: ([^/]*?)\/src.*/\1,\2/p') | ||
|
||
cd .. | ||
declare -A cMakeNamesRepos | ||
for key in "${!cMakeBuildDir[@]}"; do | ||
sourceDir=$(find . -type f -name "${key}-source_dirinfo.txt" -exec sed -n 's/^source_dir=\(.*\)\/\(.*\)/\2/p' {} \;) | ||
cMakeNamesRepos["$key"]=$sourceDir | ||
done | ||
|
||
declare -A gitLibModules | ||
cd ../../.. | ||
while IFS=',' read -r longSHA sourceDir; do | ||
gitLibModules["$sourceDir"]="$longSHA" | ||
done < <(git ls-tree HEAD | | ||
sed -E -n 's/^(160000 commit|040000 tree) ([a-f0-9]+)[ \t]+([^ ]+)$/\2,\3/p') | ||
|
||
# Initialize the variables | ||
cMakeNames="" | ||
buildDirectoryNames="" | ||
repoNames="" | ||
shortSHAs="" | ||
|
||
# Define column widths | ||
name_width=20 | ||
build_dir_width=20 | ||
source_dir_width=20 | ||
|
||
# Print header | ||
printf "%-${name_width}s | %-${build_dir_width}s | %-${source_dir_width}s | %-${sha_width}s\n" "Name" "Build dir" "Source dir" "SHA" | ||
for key in "${!cMakeBuildDir[@]}"; do | ||
buildDir="${cMakeBuildDir[$key]}" | ||
sourceDir="${cMakeNamesRepos[$key]}" | ||
shortSHA="${gitLibModules[$sourceDir]:0:7}" | ||
cMakeNames+="${key}\n" | ||
buildDirectoryNames+="${buildDir}\n" | ||
repoNames+="${sourceDir}\n" | ||
shortSHAs+="${shortSHA}\n" | ||
printf "%-${name_width}s | %-${build_dir_width}s | %-${source_dir_width}s | %s\n" "${key}" "${buildDir}" "${sourceDir}" "${shortSHA}" | ||
done | ||
|
||
echo "TARGET_NAMES\n$cMakeNames" | ||
echo "TARGET_SHAS\n$shortSHAs" | ||
echo "TARGET_DIRECTORIES\n$buildDirectoryNames" | ||
echo "TARGET_REPO_NAMES\n$repoNames" |