Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
5182c18b
Kaydet (Commit)
5182c18b
authored
May 04, 2012
tarafından
Vinay Sajip
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Closes #14093: Added Mercurial version information to Windows builds.
üst
f19c1910
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
1 deletion
+66
-1
make_buildinfo.c
PCbuild/make_buildinfo.c
+66
-1
No files found.
PCbuild/make_buildinfo.c
Dosyayı görüntüle @
5182c18b
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
#include <sys/types.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdio.h>
#include <io.h>
#define CMD_SIZE 500
#define CMD_SIZE 500
...
@@ -61,6 +62,51 @@ int make_buildinfo2(const char *tmppath)
...
@@ -61,6 +62,51 @@ int make_buildinfo2(const char *tmppath)
return
1
;
return
1
;
}
}
const
char
DELIMS
[]
=
{
"
\n
"
};
int
get_mercurial_info
(
char
*
hgbranch
,
char
*
hgtag
,
char
*
hgrev
,
int
size
)
{
int
result
=
0
;
char
filename
[
CMD_SIZE
];
char
cmdline
[
CMD_SIZE
];
strcpy_s
(
filename
,
CMD_SIZE
,
"tmpXXXXXX"
);
if
(
_mktemp_s
(
filename
,
CMD_SIZE
)
==
0
)
{
int
rc
;
strcpy_s
(
cmdline
,
CMD_SIZE
,
"hg id -bit > "
);
strcat_s
(
cmdline
,
CMD_SIZE
,
filename
);
rc
=
system
(
cmdline
);
if
(
rc
==
0
)
{
FILE
*
fp
;
if
(
fopen_s
(
&
fp
,
filename
,
"r"
)
==
0
)
{
char
*
cp
=
fgets
(
cmdline
,
CMD_SIZE
,
fp
);
if
(
cp
)
{
char
*
context
=
NULL
;
char
*
tp
=
strtok_s
(
cp
,
DELIMS
,
&
context
);
if
(
tp
)
{
strcpy_s
(
hgrev
,
size
,
tp
);
tp
=
strtok_s
(
NULL
,
DELIMS
,
&
context
);
if
(
tp
)
{
strcpy_s
(
hgbranch
,
size
,
tp
);
tp
=
strtok_s
(
NULL
,
DELIMS
,
&
context
);
if
(
tp
)
{
strcpy_s
(
hgtag
,
size
,
tp
);
result
=
1
;
}
}
}
}
fclose
(
fp
);
}
}
_unlink
(
filename
);
}
return
result
;
}
int
main
(
int
argc
,
char
*
argv
[])
int
main
(
int
argc
,
char
*
argv
[])
{
{
char
command
[
CMD_SIZE
]
=
"cl.exe -c -D_WIN32 -DUSE_DL_EXPORT -D_WINDOWS -DWIN32 -D_WINDLL "
;
char
command
[
CMD_SIZE
]
=
"cl.exe -c -D_WIN32 -DUSE_DL_EXPORT -D_WINDOWS -DWIN32 -D_WINDLL "
;
...
@@ -109,8 +155,27 @@ int main(int argc, char*argv[])
...
@@ -109,8 +155,27 @@ int main(int argc, char*argv[])
strcat_s
(
command
,
CMD_SIZE
,
"
\"
"
);
strcat_s
(
command
,
CMD_SIZE
,
"
\"
"
);
strcat_s
(
command
,
CMD_SIZE
,
tmppath
);
strcat_s
(
command
,
CMD_SIZE
,
tmppath
);
strcat_s
(
command
,
CMD_SIZE
,
"getbuildinfo2.c
\"
-DSUBWCREV "
);
strcat_s
(
command
,
CMD_SIZE
,
"getbuildinfo2.c
\"
-DSUBWCREV "
);
}
else
}
else
{
char
hgtag
[
CMD_SIZE
];
char
hgbranch
[
CMD_SIZE
];
char
hgrev
[
CMD_SIZE
];
if
(
get_mercurial_info
(
hgbranch
,
hgtag
,
hgrev
,
CMD_SIZE
))
{
strcat_s
(
command
,
CMD_SIZE
,
"-DHGBRANCH=
\\\"
"
);
strcat_s
(
command
,
CMD_SIZE
,
hgbranch
);
strcat_s
(
command
,
CMD_SIZE
,
"
\\\"
"
);
strcat_s
(
command
,
CMD_SIZE
,
" -DHGTAG=
\\\"
"
);
strcat_s
(
command
,
CMD_SIZE
,
hgtag
);
strcat_s
(
command
,
CMD_SIZE
,
"
\\\"
"
);
strcat_s
(
command
,
CMD_SIZE
,
" -DHGVERSION=
\\\"
"
);
strcat_s
(
command
,
CMD_SIZE
,
hgrev
);
strcat_s
(
command
,
CMD_SIZE
,
"
\\\"
"
);
}
strcat_s
(
command
,
CMD_SIZE
,
"..
\\
Modules
\\
getbuildinfo.c"
);
strcat_s
(
command
,
CMD_SIZE
,
"..
\\
Modules
\\
getbuildinfo.c"
);
}
strcat_s
(
command
,
CMD_SIZE
,
" -Fo
\"
"
);
strcat_s
(
command
,
CMD_SIZE
,
" -Fo
\"
"
);
strcat_s
(
command
,
CMD_SIZE
,
tmppath
);
strcat_s
(
command
,
CMD_SIZE
,
tmppath
);
strcat_s
(
command
,
CMD_SIZE
,
"getbuildinfo.o
\"
-I..
\\
Include -I..
\\
PC"
);
strcat_s
(
command
,
CMD_SIZE
,
"getbuildinfo.o
\"
-I..
\\
Include -I..
\\
PC"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment