Skip to content

Commit dd468e1

Browse files
fixed regression where it would not actually clean the files fixed the sed by adding \s to replace Red Hat and Red Hat and commiting all the ansible files now that they are cleaned properly.
1 parent f85da27 commit dd468e1

8 files changed

+18
-7
lines changed

ansible/ansible-role-rocky-cjis

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit a9b3fb56de8d596140eb5de8b271144be6576bab

ansible/ansible-role-rocky-cui

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 6d72ac31f54bf93d72bfc8db0d1a30daf007bcc3

ansible/ansible-role-rocky-hipaa

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 9ac4dc8f46f6b7d1b07f84e0a90bcf728d92d9a0

ansible/ansible-role-rocky-ospp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit aed3a65443125d8cc10a75bc928170fe3fa0bf21

ansible/ansible-role-rocky-pci-dss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 1f3527d450a14d8dee7d5cb460965b99cfe24606

ansible/ansible-role-rocky-rht-ccp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 877ef3e219201b015f2be5e058fdd555249176cb

ansible/ansible-role-rocky-stig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit bd8729b813bcbaef433d14338bda6e3942a2b3c8

tools/RepoName

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ download_repo()
4040
# Create directory and git repos.
4141
url=$1
4242
repository_name=$2;
43+
declare -a Debrand=("s/rhel8/rocky8/g" "s/redhat/rocky/g" "s/CentOS/Rocky/g" "s/RedHat/Rocky/g" "s/Red\sHat/Rocky/g" "s/red\shat/rocky/g");
4344
echo "$url $repository_name"
4445
git clone $url/$repository_name;
4546
declare -a Files=(`find $dir/ansible/ -type f -not -path '*/\.*'`)
@@ -63,9 +64,9 @@ one_repo()
6364
then
6465
show_help
6566
fi
67+
echo "Passed in -r this will download the specified repository $repo"
6668
download_repo "$url" "$repo"
6769
check_repo
68-
exit;
6970
}
7071
# Get all repositories from provided source.
7172
all_repos()
@@ -74,33 +75,37 @@ all_repos()
7475
show_help;
7576
exit;
7677
fi
77-
echo "This Sectrion is not completed yet."
78+
echo "Passed in -a this will download and clean all repos with rhel8 in the name."
7879
repos=(`curl -sL $url | grep 'href' | grep 'rhel8' | grep item | sed 's/.*\/RedHatOfficial\///g' | sed 's/".*//g'| tr '\n' ' '`);
7980
for r in ${repos[@]}; do
8081
echo "Downloading and rebranding $r"
8182
download_repo "$url" "$r"
8283
done;
8384
check_repo
84-
exit;
8585
}
8686

8787
# Verify repositories are cleaned.
8888
check_repo()
8989
{
9090
if [[ -d "$dir/ansible/" ]]; then
91+
cd $dir/ansible
9192
#Check if branding stil exists.
92-
redhat=(`grep -rci 'redhat' $dir/ansible/ | grep -v .git | cut -d: -f2-`)
93-
centos=(`grep -rci 'centos' $dir/ansible/ | grep -v .git | cut -d: -f2-`)
94-
rhel8=(`grep -rci 'rhel8' $dir/ansible/ | grep -v .git | cut -d: -f2-`)
93+
redhat=(`grep -rci 'redhat' | grep -v .git | cut -d: -f2-`)
94+
centos=(`grep -rci 'centos' | grep -v .git | cut -d: -f2-`)
95+
rhel8=(`grep -rci 'rhel8' | grep -v .git | cut -d: -f2-`)
96+
red_hat=(`grep -rci 'red hat' | grep -v .git | cut -d: -f2-`)
9597
declare -i sumredhat
9698
declare -i sumcentos
9799
declare -i sumrhel8
98100
IFS=+ sumredhat="${redhat[*]}"
101+
IFS=+ sumred_hat="${red_hat[*]}"
99102
IFS=+ sumcentos="${centos[*]}"
100103
IFS=+ sumrhel8="${rhel8[*]}"
101104
# Run through the list of copyrighted names and grep out any names still remaining.
102105
if [[ $sumredhat -gt 0 ]]; then
103106
echo "Mentions of RedHat still found: $sumredhat\n";
107+
elif [[ $sumred_hat -gt 0 ]]; then
108+
echo "Mentions of Red Hat still found: $sumred_hat\n";
104109
elif [[ $sumcentos -gt 0 ]]; then
105110
echo "Mentions of CentOS still found found: $sumcentos\n";
106111
elif [[ $sumrhel8 -gt 0 ]]; then
@@ -138,7 +143,6 @@ while getopts ":u:r:ahv" FLAG; do
138143
done
139144
# Uncomment for debugging Verify Arguements
140145
#echo "$url $repository_name $help"
141-
declare -a Debrand=("s/rhel8/rocky8/g" "s/redhat/rocky/g" "s/CentOS/Rocky/g" "s/RedHat/Rocky/g");
142146
# If URL not provided echo usage.
143147
if [[ $# -eq 0 ]]; then
144148
show_help

0 commit comments

Comments
 (0)