10
10
# With -t prints the vcs type that was detected to stdout and exits 0
11
11
# on success.
12
12
#
13
- # Exits with errorcode 1 if we're not in an bzr, svn, svk or git checkout
13
+ # Exits with errorcode 1 if we're not in a git work tree
14
14
#
15
15
# Written By: Derek Atkins <[email protected] >
16
16
# Updated By: Geert Janssens <[email protected] >
@@ -33,9 +33,9 @@ if [ "$BUILDING_FROM_VCS" = "0" -o \
33
33
" $BUILDING_FROM_VCS " = " no" -o \
34
34
" $BUILDING_FROM_VCS " = " false" ]; then
35
35
# Something outside of the Gnucash build system knows that we
36
- # are NOT building from svn, svk or git checkout .
36
+ # are NOT building from a git work tree .
37
37
# We should believe it (needed by packagers that maintain the
38
- # packaging code in svn, svk or git too)
38
+ # packaging code in git too)
39
39
echo " Environment variable BUILDING_FROM_VCS=$BUILDING_FROM_VCS " >&2
40
40
exit 1
41
41
fi
72
72
real_srcdir=" $srcdir "
73
73
fi
74
74
75
- # Test if this code is an SVN Checkout
76
- # If this is an svn checkout we assume you have svnversion!
77
- if test -d " ${real_srcdir} " /.svn
78
- then
79
- # If we're only interested in the vcs type, then we're done here
80
- if [ " $request " = " type" ]
81
- then
82
- echo " svn"
83
- exit 0
84
- fi
85
-
86
- if [ " $request " = " date" ]
87
- then
88
- echo $( svn info " $real_srcdir }" | awk ' /Last Changed Date/ { print $4 }' )
89
- exit 0
90
- fi
91
-
92
- # svnversion without options returns the most recent revision in the repo
93
- # at the time of the last svn update/checkout even if that revision
94
- # didn't hold any changes in the current path. Not very useful as a
95
- # reference. Better is to ask for the last changed revision with -c.
96
- # BUT: -c option for some reason always considers svn working copy
97
- # as having mixed sources. We're only interested in the last part so
98
- # we strip the beginning revision if it's there.
99
- # As a result if your WC really has mixed sources, that will not be
100
- # visible in the version number...
101
- svn_mixed_version=$( svnversion -c " $real_srcdir " )
102
- echo ${svn_mixed_version#*: }
103
- exit $?
104
- fi
105
-
106
- # If we get here then this is NOT an svn checkout.
107
- # Maybe it's git?
75
+ # Test if this code is in a git worktree
108
76
real_gitdir=" ${real_srcdir} " /.git
109
77
if test -d " ${real_gitdir} " || test -e " ${real_gitdir} "
110
78
then
@@ -145,73 +113,6 @@ then
145
113
else
146
114
exit 1
147
115
fi
148
- fi
149
-
150
- if test -d " ${real_srcdir} " /.bzr ;
151
- then
152
- # If we're only interested in the vcs type, then we're done here
153
- if [ " $request " = " type" ]
154
- then
155
- echo " bzr"
156
- exit 0
157
- fi
158
-
159
- if [ " $request " = " date" ]
160
- then
161
- # FIXME Don't know how to extract the commit's date from a bzr commit...
162
- echo $( date +%Y-%m-%d)
163
- exit 0
164
- fi
165
-
166
- bzrhead=` (cd " ${real_srcdir} " ; bzr version-info --custom --template=' {revno}\n' )`
167
- if test $? = 0 ; then
168
- echo " $bzrhead " ;
169
- exit 0
170
- else
171
- exit 1
172
- fi
173
- fi
174
-
175
- if test $OSTYPE -a $OSTYPE = " msys" ;
176
- then
177
- svk_name=" svk.bat"
178
- svk_cmd=" cmd \/c svk"
179
116
else
180
- svk_name=" svk"
181
- svk_cmd=" svk"
182
- fi
183
-
184
- # Maybe it's SVK? First, check if we've got 'svk' in the path. If not,
185
- # then exit with an error code of 1..
186
- which $svk_name > /dev/null 2>&1
187
- if test $? ! = 0 ; then exit 1 ; fi
188
-
189
- # Okay, we have 'svk'. Now see if $real_srcdir is an svk checkout
190
- # Note that the 'echo n' is to protect against having svk installed
191
- # without having configured the depotmap.
192
- svkinfo=` echo n | $svk_cmd info " $real_srcdir " 2>&1 `
193
- if test $? ! = 0 ; then exit 1 ; fi
194
-
195
- # If we got here, then $real_srcdir is an svk checkout.
196
- # If we're only interested in the vcs type, then we're done here
197
- if [ " $request " = " type" ]
198
- then
199
- echo " svk"
200
- exit 0
201
- fi
202
-
203
- if [ " $request " = " date" ]
204
- then
205
- # FIXME Don't know how to extract the commit's date from an svk commit...
206
- echo $( date +%Y-%m-%d)
207
- exit 0
117
+ exit 1
208
118
fi
209
-
210
-
211
- # Parse out the revision info, print it out, and then output 0. Just combine
212
- # all the revision numbers into a single string by combining them
213
- # with periods.
214
- svkinfo=` $svk_cmd info " $real_srcdir " | grep Rev | head -5 | sed -e ' s/^.* \([0-9:]*\)$/\1/' `
215
- echo $svkinfo | sed -e ' s/ /./g'
216
-
217
- exit 0
0 commit comments