1 |
commit: 07d1cbdb022146ea547ae070727bf889788c3f52 |
2 |
Author: Julian Ospald <hasufell <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Oct 25 18:18:30 2015 +0000 |
4 |
Commit: Julian Ospald <hasufell <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Oct 25 18:18:30 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=07d1cbdb |
7 |
|
8 |
git-2.eclass: add missing '|| die' on pushd/popd |
9 |
|
10 |
Reviewed-By: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
eclass/git-2.eclass | 32 ++++++++++++++++---------------- |
13 |
1 file changed, 16 insertions(+), 16 deletions(-) |
14 |
|
15 |
diff --git a/eclass/git-2.eclass b/eclass/git-2.eclass |
16 |
index eae6ba1..3cb6079 100644 |
17 |
--- a/eclass/git-2.eclass |
18 |
+++ b/eclass/git-2.eclass |
19 |
@@ -180,7 +180,7 @@ git-2_submodules() { |
20 |
fi |
21 |
|
22 |
debug-print "${FUNCNAME}: working in \"${1}\"" |
23 |
- pushd "${EGIT_DIR}" > /dev/null |
24 |
+ pushd "${EGIT_DIR}" > /dev/null || die |
25 |
|
26 |
debug-print "${FUNCNAME}: git submodule init" |
27 |
git submodule init || die |
28 |
@@ -189,7 +189,7 @@ git-2_submodules() { |
29 |
debug-print "${FUNCNAME}: git submodule update" |
30 |
git submodule update || die |
31 |
|
32 |
- popd > /dev/null |
33 |
+ popd > /dev/null || die |
34 |
fi |
35 |
} |
36 |
|
37 |
@@ -204,7 +204,7 @@ git-2_branch() { |
38 |
local branchname src |
39 |
|
40 |
debug-print "${FUNCNAME}: working in \"${EGIT_SOURCEDIR}\"" |
41 |
- pushd "${EGIT_SOURCEDIR}" > /dev/null |
42 |
+ pushd "${EGIT_SOURCEDIR}" > /dev/null || die |
43 |
|
44 |
local branchname=branch-${EGIT_BRANCH} src=origin/${EGIT_BRANCH} |
45 |
if [[ ${EGIT_COMMIT} != ${EGIT_BRANCH} ]]; then |
46 |
@@ -215,7 +215,7 @@ git-2_branch() { |
47 |
git checkout -b ${branchname} ${src} \ |
48 |
|| die "${FUNCNAME}: changing the branch failed" |
49 |
|
50 |
- popd > /dev/null |
51 |
+ popd > /dev/null || die |
52 |
} |
53 |
|
54 |
# @FUNCTION: git-2_gc |
55 |
@@ -228,13 +228,13 @@ git-2_gc() { |
56 |
local args |
57 |
|
58 |
if [[ ${EGIT_REPACK} || ${EGIT_PRUNE} ]]; then |
59 |
- pushd "${EGIT_DIR}" > /dev/null |
60 |
+ pushd "${EGIT_DIR}" > /dev/null || die |
61 |
ebegin "Garbage collecting the repository" |
62 |
[[ ${EGIT_PRUNE} ]] && args='--prune' |
63 |
debug-print "${FUNCNAME}: git gc ${args}" |
64 |
git gc ${args} |
65 |
eend $? |
66 |
- popd > /dev/null |
67 |
+ popd > /dev/null || die |
68 |
fi |
69 |
} |
70 |
|
71 |
@@ -306,12 +306,12 @@ git-2_move_source() { |
72 |
debug-print-function ${FUNCNAME} "$@" |
73 |
|
74 |
debug-print "${FUNCNAME}: ${MOVE_COMMAND} \"${EGIT_DIR}\" \"${EGIT_SOURCEDIR}\"" |
75 |
- pushd "${EGIT_DIR}" > /dev/null |
76 |
+ pushd "${EGIT_DIR}" > /dev/null || die |
77 |
mkdir -p "${EGIT_SOURCEDIR}" \ |
78 |
|| die "${FUNCNAME}: failed to create ${EGIT_SOURCEDIR}" |
79 |
${MOVE_COMMAND} "${EGIT_SOURCEDIR}" \ |
80 |
|| die "${FUNCNAME}: sync to \"${EGIT_SOURCEDIR}\" failed" |
81 |
- popd > /dev/null |
82 |
+ popd > /dev/null || die |
83 |
} |
84 |
|
85 |
# @FUNCTION: git-2_initial_clone |
86 |
@@ -388,22 +388,22 @@ git-2_fetch() { |
87 |
|
88 |
if [[ ! -d ${EGIT_DIR} ]]; then |
89 |
git-2_initial_clone |
90 |
- pushd "${EGIT_DIR}" > /dev/null |
91 |
+ pushd "${EGIT_DIR}" > /dev/null || die |
92 |
cursha=$(git rev-parse ${UPSTREAM_BRANCH}) |
93 |
echo "GIT NEW clone -->" |
94 |
echo " repository: ${EGIT_REPO_URI_SELECTED}" |
95 |
echo " at the commit: ${cursha}" |
96 |
|
97 |
- popd > /dev/null |
98 |
+ popd > /dev/null || die |
99 |
elif [[ ${EVCS_OFFLINE} ]]; then |
100 |
- pushd "${EGIT_DIR}" > /dev/null |
101 |
+ pushd "${EGIT_DIR}" > /dev/null || die |
102 |
cursha=$(git rev-parse ${UPSTREAM_BRANCH}) |
103 |
echo "GIT offline update -->" |
104 |
echo " repository: $(git config remote.origin.url)" |
105 |
echo " at the commit: ${cursha}" |
106 |
- popd > /dev/null |
107 |
+ popd > /dev/null || die |
108 |
else |
109 |
- pushd "${EGIT_DIR}" > /dev/null |
110 |
+ pushd "${EGIT_DIR}" > /dev/null || die |
111 |
oldsha=$(git rev-parse ${UPSTREAM_BRANCH}) |
112 |
git-2_update_repo |
113 |
cursha=$(git rev-parse ${UPSTREAM_BRANCH}) |
114 |
@@ -421,7 +421,7 @@ git-2_fetch() { |
115 |
|
116 |
# print nice statistic of what was changed |
117 |
git --no-pager diff --stat ${oldsha}..${UPSTREAM_BRANCH} |
118 |
- popd > /dev/null |
119 |
+ popd > /dev/null || die |
120 |
fi |
121 |
# export the version the repository is at |
122 |
export EGIT_VERSION="${cursha}" |
123 |
@@ -454,7 +454,7 @@ git-2_bootstrap() { |
124 |
# combination with --keep-going it would lead in not-updating |
125 |
# pakcages that are up-to-date. |
126 |
if [[ ${EGIT_BOOTSTRAP} ]]; then |
127 |
- pushd "${EGIT_SOURCEDIR}" > /dev/null |
128 |
+ pushd "${EGIT_SOURCEDIR}" > /dev/null || die |
129 |
einfo "Starting bootstrap" |
130 |
|
131 |
if [[ -f ${EGIT_BOOTSTRAP} ]]; then |
132 |
@@ -478,7 +478,7 @@ git-2_bootstrap() { |
133 |
fi |
134 |
|
135 |
einfo "Bootstrap finished" |
136 |
- popd > /dev/null |
137 |
+ popd > /dev/null || die |
138 |
fi |
139 |
} |