Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
broadcom
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Feed
broadcom
Commits
9d8c042d
Commit
9d8c042d
authored
2 years ago
by
Arne Jonsson
Browse files
Options
Downloads
Patches
Plain Diff
bcmkernel:bcm_git_ignore:For defined profiles, gather non-indexed filenames to be ignored
parent
047da119
No related branches found
No related tags found
1 merge request
!34
brcm63xx:bcm963xx:gitignore
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bcmkernel/scripts/bcm_git_ignore.sh
+44
-37
44 additions, 37 deletions
bcmkernel/scripts/bcm_git_ignore.sh
with
44 additions
and
37 deletions
bcmkernel/scripts/bcm_git_ignore.sh
+
44
−
37
View file @
9d8c042d
...
@@ -3,43 +3,55 @@
...
@@ -3,43 +3,55 @@
usage
()
usage
()
{
{
cat
<<
EOF
cat
<<
EOF
ex:
NAME
bcm_git_ignore.sh -c bcm_5.04L.02test4 -p "963158BGWV 963138BGWV 947622GW" -r bcmcreator_pre -i gitignore
bcm_git_ignore - creates a .gitignore in the directory bcm963xx
SYNOPSIS
bcm_git_ignore [OPTION]...
DESCRIPTION
Run this script to create a single bcm963xx/.gitignore for all the listed profiles.
ex:
./bcm_git_ignore.sh -c iopsys_5.04L.04 -p "96846GOV96856GWO_WL21D2GA 96858GWO_WL21D2GA 96888GWO_WL21D2GA" -r /home/user/bcm963xx-bsp
-c, --commitref
branch-name, tag-name, commit-hash, ...
-h, --help
display help theme, exit
-p, ---profiles
profiles used to generate .gitignore for
-r, --repo
path to the git repository to use
EOF
EOF
}
}
# Convert long opts to short opts
# Convert long opts to short opts
for
arg
in
"
$@
"
;
do
for
arg
in
"
$@
"
;
do
shift
shift
case
"
$arg
"
in
case
"
$arg
"
in
"--help"
)
set
--
"
$@
"
"-h"
;;
"--commit"
)
set
--
"
$@
"
"-c"
;;
"--repo"
)
set
--
"
$@
"
"-r"
;;
"--help"
)
set
--
"
$@
"
"-h"
;;
"--commit"
)
set
--
"
$@
"
"-c"
;;
"--profiles"
)
set
--
"
$@
"
"-p"
;;
"--profiles"
)
set
--
"
$@
"
"-p"
;;
"--repo"
)
set
--
"
$@
"
"-r"
;;
"--ignorefile"
)
set
--
"
$@
"
"-i"
;;
*
)
set
--
"
$@
"
"
$arg
"
*
)
set
--
"
$@
"
"
$arg
"
esac
esac
done
done
# parse short opts
# parse short opts
while
getopts
"hc:
r:
p:
i
:"
opt
;
do
while
getopts
"hc:p:
r
:"
opt
;
do
case
${
opt
}
in
case
${
opt
}
in
c
)
commit
=
$OPTARG
;;
h
)
h
)
usage
usage
exit
0
exit
0
;;
;;
c
)
commit
=
$OPTARG
;;
p
)
p
)
profiles
=
$OPTARG
profiles
=
$OPTARG
;;
;;
r
)
r
)
repo_name
=
$OPTARG
repo_name
=
$OPTARG
;;
;;
i
)
ignorefile
=
$OPTARG
;;
esac
esac
done
done
shift
$((
OPTIND
-
1
))
shift
$((
OPTIND
-
1
))
...
@@ -50,51 +62,46 @@ then
...
@@ -50,51 +62,46 @@ then
exit
1
exit
1
fi
fi
if
[
!
-f
"
$ignorefile
"
]
then
echo
"Need some top level ignore file -i xxxxx/.gitignore"
exit
1
fi
if
[
-z
"
$profiles
"
]
if
[
-z
"
$profiles
"
]
then
then
echo
"Need some broadcom SDK PROFILES to compile -p
\"
96
31
58
B
GW
V 963138BGWV
\"
"
echo
"Need some broadcom SDK PROFILES to compile -p
\"
96
8
58GW
O_WL21D2GA 96888GWO_WL21D2GA
\"
"
exit
1
exit
1
fi
fi
if
[
!
-d
"
$repo_name
"
]
if
[
-z
"
$repo_name
"
]
then
then
echo
"
Need some repo to work in
"
echo
"
The directory for the git repository needs to be specified. ex -r /home/user/bcm963xx-bsp
"
exit
1
exit
1
fi
fi
new_gitignore
=
$(
mktemp
)
new_gitignore
=
$(
mktemp
)
echo
"# this is an autognerated gitignore. from bcm_git_ignore.sh script"
>>
$new_gitignore
cat
<<
EOF
>
$new_gitignore
echo
"# Manually add files to ../.gitignore instead."
>>
$new_gitignore
# Files below are autogenerated using bcm_git_ignore.sh script.
echo
"# or to ../Makefile"
>>
$new_gitignore
# Profile(s) used:
$profiles
EOF
for
profile
in
$profiles
for
profile
in
$profiles
do
do
echo
"Compiling target
$profile
"
echo
"Compiling target
$profile
"
# checkout and make sure everything is clean.
# checkout and make sure everything is clean.
git
-C
$
{
repo_name
}
reset
--hard
git
-C
"
$repo_name
"
reset
--hard
-q
git
-C
$
{
repo_name
}
clean
-ffxd
git
-C
"
$repo_name
"
clean
-ffxd
git
-C
$
{
repo_name
}
checkout
$commit
git
-C
"
$repo_name
"
checkout
-q
$commit
git
-C
$
{
repo_name
}
reset
--hard
git
-C
"
$repo_name
"
reset
--hard
-q
git
-C
$
{
repo_name
}
clean
-ffxd
git
-C
"
$repo_name
"
clean
-ffxd
(
(
cd
$repo_name
/bcm963xx
cd
$repo_name
/bcm963xx
make
PROFILE
=
$profile
make
PROFILE
=
$profile
)
)
cp
$ignorefile
$
{
repo_name
}
/.gitignore
rm
-f
$repo_name
/bcm963xx
/.gitignore
git
-C
$
{
repo_name
}
/bcm963xx
status
-s
|
cut
-c4-
>>
$new_gitignore
git
-C
"
$repo_name
"
/bcm963xx
ls-files
--others
--exclude-standard
--directory
--no-empty-directory
>>
$new_gitignore
done
done
sort
$new_gitignore
|
uniq
>
$
{
repo_name
}
/bcm963xx/.gitignore
sort
$new_gitignore
|
uniq
>
$repo_name
/bcm963xx/.gitignore
rm
$new_gitignore
rm
$new_gitignore
echo
"done! new git
ignore in
$
{
repo_name
}
/bcm963xx/.gitignore"
echo
"done! new
.
gitignore in
$repo_name
/bcm963xx/.gitignore"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment