]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
admon/build-doc: be compatible with py3 17640/head
authorKefu Chai <kchai@redhat.com>
Mon, 11 Sep 2017 13:53:57 +0000 (21:53 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 11 Sep 2017 15:05:26 +0000 (23:05 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
admin/build-doc

index e62c584019633f1065a598554744238eb39a5261..3796efe6cc1f5305b4cb10071afeb93ff25a19b1 100755 (executable)
@@ -57,7 +57,7 @@ cd build-doc
 [ -z "$vdir" ] && vdir="$TOPDIR/build-doc/virtualenv"
 
 if [ ! -e $vdir ]; then
-    virtualenv --system-site-packages $vdir -p python2
+    virtualenv --system-site-packages $vdir
 fi
 $vdir/bin/pip install --quiet -r $TOPDIR/admin/doc-requirements.txt
 
@@ -88,7 +88,12 @@ for bind in rados rbd cephfs rgw; do
         LDFLAGS="-L$vdir/lib -Wl,--no-as-needed" \
         $vdir/bin/pip install $TOPDIR/src/pybind/${bind}
     # rgwfile_version(), librgw_create(), rgw_mount()
-    nm $vdir/lib/python*/*-packages/${bind}.so | grep -E "U (lib)?${bind}" | \
+    # since py3.5, distutils adds postfix in between ${bind} and so
+    lib_fn=$vdir/lib/python*/*-packages/${bind}.*.so
+    if [ ! -e $lib_fn ]; then
+       lib_fn=$vdir/lib/python*/*-packages/${bind}.so
+    fi
+    nm $lib_fn | grep -E "U (lib)?${bind}" | \
         awk '{ print "void "$2"(void) {}" }' | \
         gcc -shared -o $vdir/lib/lib${bind}.so.1 -xc -
     if [ ${bind} != rados ]; then