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
fe09a542
Kaydet (Commit)
fe09a542
authored
Mar 06, 2011
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge build identification to default branch.
üst
f874debb
13039c87
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
71 additions
and
6 deletions
+71
-6
pythonrun.h
Include/pythonrun.h
+2
-0
platform.py
Lib/platform.py
+3
-1
test_platform.py
Lib/test/test_platform.py
+5
-1
Makefile.pre.in
Makefile.pre.in
+9
-1
getbuildinfo.c
Modules/getbuildinfo.c
+34
-3
sysmodule.c
Python/sysmodule.c
+3
-0
configure
configure
+0
-0
configure.in
configure.in
+15
-0
No files found.
Include/pythonrun.h
Dosyayı görüntüle @
fe09a542
...
@@ -182,6 +182,8 @@ PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
...
@@ -182,6 +182,8 @@ PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
PyAPI_FUNC
(
const
char
*
)
_Py_svnversion
(
void
);
PyAPI_FUNC
(
const
char
*
)
_Py_svnversion
(
void
);
PyAPI_FUNC
(
const
char
*
)
Py_SubversionRevision
(
void
);
PyAPI_FUNC
(
const
char
*
)
Py_SubversionRevision
(
void
);
PyAPI_FUNC
(
const
char
*
)
Py_SubversionShortBranch
(
void
);
PyAPI_FUNC
(
const
char
*
)
Py_SubversionShortBranch
(
void
);
PyAPI_FUNC
(
const
char
*
)
_Py_hgidentifier
(
void
);
PyAPI_FUNC
(
const
char
*
)
_Py_hgversion
(
void
);
#endif
#endif
/* Internal -- various one-time initializations */
/* Internal -- various one-time initializations */
...
...
Lib/platform.py
Dosyayı görüntüle @
fe09a542
...
@@ -1311,7 +1311,9 @@ def _sys_version(sys_version=None):
...
@@ -1311,7 +1311,9 @@ def _sys_version(sys_version=None):
name
=
'CPython'
name
=
'CPython'
builddate
=
builddate
+
' '
+
buildtime
builddate
=
builddate
+
' '
+
buildtime
if
hasattr
(
sys
,
'subversion'
):
if
hasattr
(
sys
,
'_mercurial'
):
_
,
branch
,
revision
=
sys
.
_mercurial
elif
hasattr
(
sys
,
'subversion'
):
# sys.subversion was added in Python 2.5
# sys.subversion was added in Python 2.5
_
,
branch
,
revision
=
sys
.
subversion
_
,
branch
,
revision
=
sys
.
subversion
else
:
else
:
...
...
Lib/test/test_platform.py
Dosyayı görüntüle @
fe09a542
...
@@ -57,11 +57,13 @@ class PlatformTest(unittest.TestCase):
...
@@ -57,11 +57,13 @@ class PlatformTest(unittest.TestCase):
def
setUp
(
self
):
def
setUp
(
self
):
self
.
save_version
=
sys
.
version
self
.
save_version
=
sys
.
version
self
.
save_subversion
=
sys
.
subversion
self
.
save_subversion
=
sys
.
subversion
self
.
save_mercurial
=
sys
.
_mercurial
self
.
save_platform
=
sys
.
platform
self
.
save_platform
=
sys
.
platform
def
tearDown
(
self
):
def
tearDown
(
self
):
sys
.
version
=
self
.
save_version
sys
.
version
=
self
.
save_version
sys
.
subversion
=
self
.
save_subversion
sys
.
subversion
=
self
.
save_subversion
sys
.
_mercurial
=
self
.
save_mercurial
sys
.
platform
=
self
.
save_platform
sys
.
platform
=
self
.
save_platform
def
test_sys_version
(
self
):
def
test_sys_version
(
self
):
...
@@ -109,10 +111,12 @@ class PlatformTest(unittest.TestCase):
...
@@ -109,10 +111,12 @@ class PlatformTest(unittest.TestCase):
sys_versions
.
items
():
sys_versions
.
items
():
sys
.
version
=
version_tag
sys
.
version
=
version_tag
if
subversion
is
None
:
if
subversion
is
None
:
if
hasattr
(
sys
,
"_mercurial"
):
del
sys
.
_mercurial
if
hasattr
(
sys
,
"subversion"
):
if
hasattr
(
sys
,
"subversion"
):
del
sys
.
subversion
del
sys
.
subversion
else
:
else
:
sys
.
subversion
=
subversion
sys
.
_mercurial
=
subversion
if
sys_platform
is
not
None
:
if
sys_platform
is
not
None
:
sys
.
platform
=
sys_platform
sys
.
platform
=
sys_platform
self
.
assertEqual
(
platform
.
python_implementation
(),
info
[
0
])
self
.
assertEqual
(
platform
.
python_implementation
(),
info
[
0
])
...
...
Makefile.pre.in
Dosyayı görüntüle @
fe09a542
...
@@ -37,6 +37,9 @@ RANLIB= @RANLIB@
...
@@ -37,6 +37,9 @@ RANLIB= @RANLIB@
SVNVERSION
=
@SVNVERSION@
SVNVERSION
=
@SVNVERSION@
SOABI
=
@SOABI@
SOABI
=
@SOABI@
LDVERSION
=
@LDVERSION@
LDVERSION
=
@LDVERSION@
HGVERSION
=
@HGVERSION@
HGTAG
=
@HGTAG@
HGBRANCH
=
@HGBRANCH@
GNULD
=
@GNULD@
GNULD
=
@GNULD@
...
@@ -552,7 +555,12 @@ Modules/getbuildinfo.o: $(PARSER_OBJS) \
...
@@ -552,7 +555,12 @@ Modules/getbuildinfo.o: $(PARSER_OBJS) \
$(SIGNAL_OBJS)
\
$(SIGNAL_OBJS)
\
$(MODOBJS)
\
$(MODOBJS)
\
$(srcdir)/Modules/getbuildinfo.c
$(srcdir)/Modules/getbuildinfo.c
$(CC)
-c
$(PY_CORE_CFLAGS)
-DSVNVERSION
=
"
\"
`
LC_ALL
=
C
$(SVNVERSION)
`
\"
"
-o
$@
$(srcdir)
/Modules/getbuildinfo.c
$(CC)
-c
$(PY_CORE_CFLAGS)
\
-DSVNVERSION
=
"
\"
`
LC_ALL
=
C
$(SVNVERSION)
`
\"
"
\
-DHGVERSION
=
"
\"
`
LC_ALL
=
C
$(HGVERSION)
`
\"
"
\
-DHGTAG
=
"
\"
`
LC_ALL
=
C
$(HGTAG)
`
\"
"
\
-DHGBRANCH
=
"
\"
`
LC_ALL
=
C
$(HGBRANCH)
`
\"
"
\
-o
$@
$(srcdir)
/Modules/getbuildinfo.c
Modules/getpath.o
:
$(srcdir)/Modules/getpath.c Makefile
Modules/getpath.o
:
$(srcdir)/Modules/getpath.c Makefile
$(CC)
-c
$(PY_CORE_CFLAGS)
-DPYTHONPATH
=
'"
$(PYTHONPATH)
"'
\
$(CC)
-c
$(PY_CORE_CFLAGS)
-DPYTHONPATH
=
'"
$(PYTHONPATH)
"'
\
...
...
Modules/getbuildinfo.c
Dosyayı görüntüle @
fe09a542
...
@@ -28,15 +28,28 @@
...
@@ -28,15 +28,28 @@
#define SVNVERSION "$WCRANGE$$WCMODS?M:$"
#define SVNVERSION "$WCRANGE$$WCMODS?M:$"
#endif
#endif
/* XXX Only unix build process has been tested */
#ifndef HGVERSION
#define HGVERSION ""
#endif
#ifndef HGTAG
#define HGTAG ""
#endif
#ifndef HGBRANCH
#define HGBRANCH ""
#endif
const
char
*
const
char
*
Py_GetBuildInfo
(
void
)
Py_GetBuildInfo
(
void
)
{
{
static
char
buildinfo
[
50
];
static
char
buildinfo
[
50
];
const
char
*
revision
=
Py_SubversionRevi
sion
();
const
char
*
revision
=
_Py_hgver
sion
();
const
char
*
sep
=
*
revision
?
":"
:
""
;
const
char
*
sep
=
*
revision
?
":"
:
""
;
const
char
*
branch
=
Py_SubversionShortBranch
();
const
char
*
hgid
=
_Py_hgidentifier
();
if
(
!
(
*
hgid
))
hgid
=
"default"
;
PyOS_snprintf
(
buildinfo
,
sizeof
(
buildinfo
),
PyOS_snprintf
(
buildinfo
,
sizeof
(
buildinfo
),
"%s%s%s, %.20s, %.9s"
,
branch
,
sep
,
revision
,
"%s%s%s, %.20s, %.9s"
,
hgid
,
sep
,
revision
,
DATE
,
TIME
);
DATE
,
TIME
);
return
buildinfo
;
return
buildinfo
;
}
}
...
@@ -50,3 +63,21 @@ _Py_svnversion(void)
...
@@ -50,3 +63,21 @@ _Py_svnversion(void)
return
svnversion
;
/* it was interpolated, or passed on command line */
return
svnversion
;
/* it was interpolated, or passed on command line */
return
"Unversioned directory"
;
return
"Unversioned directory"
;
}
}
const
char
*
_Py_hgversion
(
void
)
{
return
HGVERSION
;
}
const
char
*
_Py_hgidentifier
(
void
)
{
const
char
*
hgtag
,
*
hgid
;
hgtag
=
HGTAG
;
if
((
*
hgtag
)
&&
strcmp
(
hgtag
,
"tip"
)
!=
0
)
hgid
=
hgtag
;
else
hgid
=
HGBRANCH
;
return
hgid
;
}
Python/sysmodule.c
Dosyayı görüntüle @
fe09a542
...
@@ -1599,6 +1599,9 @@ _PySys_Init(void)
...
@@ -1599,6 +1599,9 @@ _PySys_Init(void)
SET_SYS_FROM_STRING
(
"subversion"
,
SET_SYS_FROM_STRING
(
"subversion"
,
Py_BuildValue
(
"(sss)"
,
"CPython"
,
branch
,
Py_BuildValue
(
"(sss)"
,
"CPython"
,
branch
,
svn_revision
));
svn_revision
));
SET_SYS_FROM_STRING
(
"_mercurial"
,
Py_BuildValue
(
"(szz)"
,
"CPython"
,
_Py_hgidentifier
(),
_Py_hgversion
()));
SET_SYS_FROM_STRING
(
"dont_write_bytecode"
,
SET_SYS_FROM_STRING
(
"dont_write_bytecode"
,
PyBool_FromLong
(
Py_DontWriteBytecodeFlag
));
PyBool_FromLong
(
Py_DontWriteBytecodeFlag
));
SET_SYS_FROM_STRING
(
"api_version"
,
SET_SYS_FROM_STRING
(
"api_version"
,
...
...
configure
Dosyayı görüntüle @
fe09a542
This source diff could not be displayed because it is too large. You can
view the blob
instead.
configure.in
Dosyayı görüntüle @
fe09a542
...
@@ -810,6 +810,21 @@ else
...
@@ -810,6 +810,21 @@ else
SVNVERSION="echo Unversioned directory"
SVNVERSION="echo Unversioned directory"
fi
fi
AC_SUBST(HGVERSION)
AC_SUBST(HGTAG)
AC_SUBST(HGBRANCH)
AC_CHECK_PROG(HAS_HG, hg, found, not-found)
if test $HAS_HG = found
then
HGVERSION="hg id -i \$(srcdir)"
HGTAG="hg id -t \$(srcdir)"
HGBRANCH="hg id -b \$(srcdir)"
else
HGVERSION=""
HGTAG=""
HGBRANCH=""
fi
case $MACHDEP in
case $MACHDEP in
bsdos*|hp*|HP*)
bsdos*|hp*|HP*)
# install -d does not work on BSDI or HP-UX
# install -d does not work on BSDI or HP-UX
...
...
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