Skip to content

Commit

Permalink
Replace pushd/popd in distribution-macros
Browse files Browse the repository at this point in the history
pushd/popd is a bash feature which may not be supported by other shells,
e.g. dash. Replace them with subshell & cd to make the scripts work
across the shells.

Change-Id: Ic7f3eef60746385ceb22eae796162b5a2a0f0bb7
Signed-off-by: Sangwook Ha <[email protected]>
  • Loading branch information
sangwookha-vz committed Sep 23, 2024
1 parent 65b2ba4 commit 9669247
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions jjb/integration/distribution/distribution-macros.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,14 @@
# No failure in this macro should affect the job result.
set +e
rm -f "$WORKSPACE/bug_9191.log"
pushd "$WORKSPACE/distribution/$KARAF_ARTIFACT/target/assembly/system/org/opendaylight"
for folder in `ls`; do
find "$folder" -name \*features.xml | xargs fgrep -n '<bundle>' > bug_9191.0.log
fgrep org.opendaylight bug_9191.0.log | fgrep -v "org.opendaylight.$folder" >> "$WORKSPACE/bug_9191.log"
rm bug_9191.0.log
done
popd
(
cd "$WORKSPACE/distribution/$KARAF_ARTIFACT/target/assembly/system/org/opendaylight" || exit 0
for folder in `ls`; do
find "$folder" -name \*features.xml | xargs fgrep -n '<bundle>' > bug_9191.0.log
fgrep org.opendaylight bug_9191.0.log | fgrep -v "org.opendaylight.$folder" >> "$WORKSPACE/bug_9191.log"
rm bug_9191.0.log
done
)
- builder:
name: distribution-check-warn-9192
Expand All @@ -221,9 +222,10 @@
- shell: |
# No failure in this macro should affect the job result.
set +e
pushd "$WORKSPACE/distribution/$KARAF_ARTIFACT/target/assembly/system/org/opendaylight"
find . -name \*features.xml | xargs fgrep -n '<bundle>' > "$WORKSPACE/bug_9192.0.log"
popd
(
cd "$WORKSPACE/distribution/$KARAF_ARTIFACT/target/assembly/system/org/opendaylight" || exit 0
find . -name \*features.xml | xargs fgrep -n '<bundle>' > "$WORKSPACE/bug_9192.0.log"
)
fgrep org.opendaylight bug_9192.0.log > "$WORKSPACE/bug_9192.1.log"
sort -s -t '<' -k 2 "$WORKSPACE/bug_9192.1.log" > "$WORKSPACE/bug_9192.2.log"
sort -u -s -t '<' -k 2 "$WORKSPACE/bug_9192.1.log" > "$WORKSPACE/bug_9192.3.log"
Expand Down

0 comments on commit 9669247

Please sign in to comment.