package init
This commit is contained in:
parent
82812861c1
commit
b83f20e26b
BIN
custom_build_tool-1.0.0.tar.gz
Normal file
BIN
custom_build_tool-1.0.0.tar.gz
Normal file
Binary file not shown.
@ -1,36 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Author: yhon
|
||||
# Copyright Huawei Technologies Co., Ltd. 2010-2018. All rights reserved.
|
||||
set -e
|
||||
######################
|
||||
# make config before rpmbuild
|
||||
# Globals:
|
||||
# Arguments:
|
||||
# Returns:
|
||||
######################
|
||||
function config_rpmbuild()
|
||||
{
|
||||
rpmbuild="/usr/bin/rpmbuild"
|
||||
mkdir -p /home/abuild
|
||||
cp -a /usr/bin/chmod /home/abuild/chmod
|
||||
chmod 4777 /home/abuild/chmod
|
||||
mv $rpmbuild "${rpmbuild}"-orig
|
||||
cat <<END > $rpmbuild
|
||||
#!/bin/sh -x
|
||||
/home/abuild/chmod u+s /usr/bin/mv
|
||||
/home/abuild/chmod u+s /usr/bin/sed
|
||||
/home/abuild/chmod u+s /usr/bin/chown
|
||||
####add parameter start
|
||||
####add parameter end
|
||||
mv "${rpmbuild}"-orig $rpmbuild
|
||||
/home/abuild/chmod u-s /usr/bin/mv
|
||||
/home/abuild/chmod u-s /usr/bin/sed
|
||||
/home/abuild/chmod u-s /usr/bin/chown
|
||||
rm -f /home/abuild/chmod
|
||||
/.build.command
|
||||
END
|
||||
|
||||
chmod 755 $rpmbuild
|
||||
}
|
||||
|
||||
config_rpmbuild
|
||||
@ -1,32 +0,0 @@
|
||||
This is a revocation certificate for the OpenPGP key:
|
||||
|
||||
pub rsa2048 2019-03-01 [SC] [expires: 2021-02-28]
|
||||
B8C12BF9E825AA384515207071A7E90FE2EC75BC
|
||||
uid EulerOS (EulerOS 2.0 SP8) <euleros@huawei.com>
|
||||
|
||||
A revocation certificate is a kind of "kill switch" to publicly
|
||||
declare that a key shall not anymore be used. It is not possible
|
||||
to retract such a revocation certificate once it has been published.
|
||||
|
||||
Use it to revoke this key in case of a compromise or loss of
|
||||
the secret key. However, if the secret key is still accessible,
|
||||
it is better to generate a new revocation certificate and give
|
||||
a reason for the revocation. For details see the description of
|
||||
of the gpg command "--generate-revocation" in the GnuPG manual.
|
||||
|
||||
To avoid an accidental use of this file, a colon has been inserted
|
||||
before the 5 dashes below. Remove this colon with a text editor
|
||||
before importing and publishing this revocation certificate.
|
||||
|
||||
:-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
Comment: This is a revocation certificate
|
||||
|
||||
iQE2BCABCAAgFiEEuMEr+eglqjhFFSBwcafpD+LsdbwFAlx4vLgCHQAACgkQcafp
|
||||
D+LsdbytFwf+NLRtLET4C+WWhr8301npZ5Rqj9vvrFZLtoWiAVjXR2LahAPHFuyl
|
||||
05SNyZPaHu/6YHzROg/1AB+omGwtqkKS/2SCFwlXEnfG2dOzg/eLGlX8B6rc1AI2
|
||||
hl/I0lkLsyqaeTXQCxgE1PulXpVBILECkGPCzzP1Q5c5xonsPzcj9Lohhvx/BaAM
|
||||
CKWbmr6ahrVF1INWJ6OiwrauT3rpeAqJ8eqPsUT5/WiyeFISHw5RRK7Rr7QbUeey
|
||||
4e0uD6Gd2UwnB6WEKTL46GvsV5c3pxOK9W0Ca7iBBy7LZzbjJQ7Cojzobk9hbsUL
|
||||
4wpySOWS98o8lnf8a1B3a0U/v3hXsBVSEw==
|
||||
=vjvI
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1 +0,0 @@
|
||||
sed -i 's/"rpmbuild"/"rpmbuild-gcov"/g' /.build.command
|
||||
@ -1,9 +0,0 @@
|
||||
if test -f /.build.command; then
|
||||
nocheck_exclude=`rpm --eval %{nocheck_exclude}`
|
||||
nocheck_exclude=`echo $nocheck_exclude | sed 's# #.spec|#g'`
|
||||
nocheck_exclude=`echo $nocheck_exclude | sed 's#$#.spec#g'`
|
||||
cat /.build.command | egrep "$nocheck_exclude" >/dev/null 2>&1
|
||||
if [ $? != 0 ]; then
|
||||
sed -i 's/)"/)" "--nocheck"/g' /.build.command
|
||||
fi
|
||||
fi
|
||||
@ -1 +0,0 @@
|
||||
sed -i 's/"rpmbuild"/"rpmbuild-san"/g' /.build.command
|
||||
@ -1,11 +0,0 @@
|
||||
if test -f /.build.command; then
|
||||
sed -i 's/--nosignature/--sign/g' /.build.command
|
||||
grep cups.spec /.build.command > /dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
sed -i 's/--sign/--nosignature/g' /.build.command
|
||||
sed -i 's/exec //g' /.build.command
|
||||
sed -i '$aexec "find" "/home/abuild/rpmbuild" "-name" "*.rpm" | "xargs" "-r" "rpmsign" "--addsign"' /.build.command
|
||||
fi
|
||||
chown -R abuild:abuild /home/abuild/.gnupg
|
||||
/home/abuild/chmod 700 /home/abuild/.gnupg
|
||||
fi
|
||||
@ -1,3 +0,0 @@
|
||||
if test -f /.build.command; then
|
||||
sed -i 's/)"/)" "--target=armv7l"/g' /.build.command
|
||||
fi
|
||||
@ -1,10 +0,0 @@
|
||||
if test -f /.build.command; then
|
||||
|
||||
rpm --eval "%{upload_build_include}" > /tmp/ub_include
|
||||
ub_include=$(cat /tmp/ub_include | awk '{for(i=1;i<NF;i++){printf($i);printf(".spec|")}printf($NF);printf(".spec")}')
|
||||
|
||||
cat /.build.command | egrep "$ub_include" &> /tmp/tmp.ub
|
||||
if [ "$?" == "0" ]; then
|
||||
sed -i 's/"rpmbuild"/"rpmbuild-ub"/g' /.build.command
|
||||
fi
|
||||
fi
|
||||
@ -1,29 +1,22 @@
|
||||
%define with_gcov %{?_with_gcov:1} %{?!_with_gcov:0}
|
||||
%define with_san %{?_with_san:1} %{?!_with_san:0}
|
||||
%define with_ub %{?_with_ub:1} %{?!_with_ub:0}
|
||||
%if !%{with_gcov}
|
||||
%define debug_package %{nil}
|
||||
%endif
|
||||
Name: custom_build_tool
|
||||
Summary: EulerOS custom build tool for obs
|
||||
License: GPL
|
||||
Summary: custom build tool for obs
|
||||
License: Mulan PSL v2
|
||||
Group: System/Management
|
||||
Version: 1.0
|
||||
Release: 17%{?dist}
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}
|
||||
Source0: %{name}-%{version}.tar.bz2
|
||||
Source1: needgcov-%{version}.tar.bz2
|
||||
Version: 1.0.0
|
||||
Release: 1
|
||||
BuildRoot: %{_tmppath}/%{name}
|
||||
Source0: https://gitee.com/openeuler/custom_build_tool/repository/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
||||
BuildRequires: util-linux coreutils
|
||||
BuildRequires: -custom_build_tool-nocheck
|
||||
BuildRequires: -obs-env
|
||||
BuildRequires: -gcc_secure
|
||||
BuildRequires: -custom_build_tool-sign
|
||||
BuildRequires: -bep-env
|
||||
BuildRequires: -custom_build_tool-gcov
|
||||
BuildRequires: -custom_build_tool-san
|
||||
BuildRequires: -custom_build_tool-uploadbuild
|
||||
|
||||
Requires: bash rpm-build rpm-sign sed util-linux coreutils gnupg2
|
||||
Requires: bash rpm-build sed util-linux coreutils
|
||||
%description
|
||||
provide other method to deal parameter passing for OBS build
|
||||
|
||||
@ -36,15 +29,6 @@ Summary: add nocheck to rpmbuild
|
||||
|
||||
%description nocheck
|
||||
|
||||
%package sign
|
||||
Group: Development/Libraries
|
||||
BuildArch: noarch
|
||||
Requires:bash rpm-build rpm-sign sed util-linux coreutils gnupg2
|
||||
Requires:custom_build_tool
|
||||
Summary: add sign to rpmbuild
|
||||
|
||||
%description sign
|
||||
|
||||
%package nodebug
|
||||
Group: Development/Libraries
|
||||
BuildArch: noarch
|
||||
@ -63,15 +47,6 @@ Summary: add target to rpmbuild
|
||||
|
||||
%description target
|
||||
|
||||
%package gcov
|
||||
Group:Development/Libraries
|
||||
Requires:util-linux rpm grep binutils gcc coreutils rpm-build
|
||||
Requires:custom_build_tool
|
||||
BuildRequires:util-linux coreutils
|
||||
Summary:Build with gcov
|
||||
|
||||
%description gcov
|
||||
|
||||
%package uploadbuild
|
||||
Group:Development/Libraries
|
||||
Requires:util-linux rpm grep binutils gcc coreutils rpm-build pbzip2
|
||||
@ -92,64 +67,19 @@ Summary:Build with san
|
||||
|
||||
%description san
|
||||
|
||||
|
||||
%package gcov-server
|
||||
Group:Development/Libraries
|
||||
Requires:util-linux rpm grep binutils gcc coreutils rpm-build
|
||||
BuildRequires:util-linux coreutils
|
||||
Summary:gcov file transfer server
|
||||
|
||||
%description gcov-server
|
||||
|
||||
|
||||
|
||||
%prep
|
||||
%setup -c -b 1
|
||||
%setup -c
|
||||
|
||||
%build
|
||||
%if %{with_gcov}
|
||||
mv ../needgcov-%{version} ./
|
||||
pushd needgcov-%{version}
|
||||
export CFLAGS="%{optflags}"
|
||||
make
|
||||
popd
|
||||
%endif
|
||||
|
||||
%if %{with_ub}
|
||||
mv ../needgcov-%{version} ./
|
||||
pushd needgcov-%{version}
|
||||
export CFLAGS="%{optflags}"
|
||||
make
|
||||
popd
|
||||
%endif
|
||||
|
||||
%install
|
||||
mkdir -p %{buildroot}/opt/
|
||||
mkdir -p %{buildroot}/opt/custom_build_tool
|
||||
mkdir -p %{buildroot}/home/abuild/.gnupg/
|
||||
mkdir -p %{buildroot}/root/.gnupg/
|
||||
install -m 700 %{name}-%{version}/*.sh %{buildroot}/opt/custom_build_tool/
|
||||
install -m 600 %{name}-%{version}/rpmbuild-nocheck %{buildroot}/opt/custom_build_tool/
|
||||
install -m 600 %{name}-%{version}/rpmbuild-sign %{buildroot}/opt/custom_build_tool/
|
||||
install -m 600 %{name}-%{version}/rpmbuild-target %{buildroot}/opt/custom_build_tool/
|
||||
cp -a %{name}-%{version}/gpg/* %{buildroot}/root/.gnupg/
|
||||
cp -a %{name}-%{version}/gpg/* %{buildroot}/home/abuild/.gnupg/
|
||||
%if %{with_gcov}
|
||||
install -m 600 %{name}-%{version}/rpmbuild-gcov %{buildroot}/opt/custom_build_tool/
|
||||
install -m 755 needgcov-%{version}/client-tool/client-tool-linux %{buildroot}/opt/custom_build_tool/
|
||||
install -m 644 needgcov-%{version}/client-tool/cmdlist %{buildroot}/opt/custom_build_tool/
|
||||
install -m 755 needgcov-%{version}/upload.sh %{buildroot}/opt/custom_build_tool/
|
||||
install -m 755 needgcov-%{version}/server-tool/server-tool-linux %{buildroot}/opt/custom_build_tool/
|
||||
install -m 644 needgcov-%{version}/server-tool/config.ini %{buildroot}/opt/custom_build_tool/
|
||||
%endif
|
||||
install -m 700 %{name}/*.sh %{buildroot}/opt/custom_build_tool/
|
||||
install -m 600 %{name}/rpmbuild-nocheck %{buildroot}/opt/custom_build_tool/
|
||||
install -m 600 %{name}/rpmbuild-target %{buildroot}/opt/custom_build_tool/
|
||||
%if %{with_san}
|
||||
install -m 600 %{name}-%{version}/rpmbuild-san %{buildroot}/opt/custom_build_tool/
|
||||
%endif
|
||||
%if %{with_ub}
|
||||
install -m 600 %{name}-%{version}/rpmbuild-ub %{buildroot}/opt/custom_build_tool/
|
||||
install -m 755 needgcov-%{version}/client-tool/client-tool-linux %{buildroot}/opt/custom_build_tool/
|
||||
install -m 644 needgcov-%{version}/client-tool/cmdlist %{buildroot}/opt/custom_build_tool/
|
||||
install -m 755 needgcov-%{version}/upload_build.sh %{buildroot}/opt/custom_build_tool/
|
||||
install -m 600 %{name}/rpmbuild-san %{buildroot}/opt/custom_build_tool/
|
||||
%endif
|
||||
|
||||
|
||||
@ -157,115 +87,12 @@ install -m 755 needgcov-%{version}/upload_build.sh %{buildroot}/opt/custom_build
|
||||
bash /opt/custom_build_tool/custom_build_tool.sh
|
||||
%post nocheck
|
||||
sed -i '/####add parameter start/r /opt/custom_build_tool/rpmbuild-nocheck' /usr/bin/rpmbuild
|
||||
%post sign
|
||||
sed -i '/####add parameter start/r /opt/custom_build_tool/rpmbuild-sign' /usr/bin/rpmbuild
|
||||
%post nodebug
|
||||
sed -i 's/strict=true/strict=false/' /usr/lib/rpm/find-debuginfo.sh
|
||||
%post target
|
||||
sed -i '/####add parameter start/r /opt/custom_build_tool/rpmbuild-target' /usr/bin/rpmbuild
|
||||
echo "abuild ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
||||
|
||||
%if %{with_gcov}
|
||||
%post gcov
|
||||
cp -a /usr/bin/mv /usr/bin/gmv
|
||||
chmod 4777 /usr/bin/gmv
|
||||
sed -i '/####add parameter start/r /opt/custom_build_tool/rpmbuild-gcov' /usr/bin/rpmbuild
|
||||
old_gcc=/usr/bin/gcc
|
||||
old_gplus=/usr/bin/g++
|
||||
old_rpmbuild=/usr/bin/rpmbuild
|
||||
old_cplus=/usr/bin/c++
|
||||
|
||||
cat <<END1 > ${old_rpmbuild}-gcov
|
||||
#!/bin/sh -x
|
||||
|
||||
${old_rpmbuild} "\$@"
|
||||
ret=\$?
|
||||
|
||||
if [ \$ret -eq 0 ]; then
|
||||
source /opt/custom_build_tool/upload.sh
|
||||
echo "Gcov version has been compiledddddddddddddddddddddddddddd"
|
||||
else
|
||||
if file /usr/bin/gcc | grep ELF; then
|
||||
exit \$ret
|
||||
else
|
||||
/usr/bin/gmv ${old_gcc}_gcov $old_gcc
|
||||
/usr/bin/gmv ${old_gplus}_gcov $old_gplus
|
||||
if [ -d /home/abuild/rpmbuild/BUILD ]; then
|
||||
rm -rf /home/abuild/rpmbuild/BUILD
|
||||
rm -rf /home/abuild/rpmbuild/BUILDROOT
|
||||
else
|
||||
rm -rf /root/rpmbuild/BUILD
|
||||
rm -rf /root/rpmbuild/BUILDROOT
|
||||
fi
|
||||
|
||||
${old_rpmbuild} "\$@"
|
||||
ret=\$?
|
||||
if [ \$ret -eq 0 ]; then
|
||||
source /opt/custom_build_tool/upload.sh
|
||||
else
|
||||
exit \$ret
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
END1
|
||||
chmod 755 ${old_rpmbuild}-gcov
|
||||
|
||||
# add gcc args
|
||||
mv $old_gcc $old_gcc"_gcov"
|
||||
cat <<END1 > $old_gcc
|
||||
#!/bin/sh -x
|
||||
|
||||
|
||||
echo "\$@" | grep conftest &>/tmp/tmp.tmp
|
||||
ret=\$?
|
||||
if [ \$ret -eq 0 ]; then
|
||||
${old_gcc}_gcov "\$@"
|
||||
else
|
||||
${old_gcc}_gcov %{?_with_gcov_args} "\$@"
|
||||
fi
|
||||
|
||||
|
||||
END1
|
||||
chmod 755 $old_gcc $old_gcc"_gcov"
|
||||
|
||||
# add gplus args
|
||||
if [ -f $old_gplus ]; then
|
||||
mv $old_gplus $old_gplus"_gcov"
|
||||
cat <<END1 > $old_gplus
|
||||
#!/bin/sh -x
|
||||
|
||||
|
||||
echo "\$@" | grep conftest &>/tmp/tmp.tmp
|
||||
ret=\$?
|
||||
if [ \$ret -eq 0 ]; then
|
||||
${old_gplus}_gcov "\$@"
|
||||
else
|
||||
${old_gplus}_gcov %{?_with_gcov_args} "\$@"
|
||||
fi
|
||||
|
||||
END1
|
||||
chmod 755 $old_gplus $old_gplus"_gcov"
|
||||
fi
|
||||
|
||||
# add cplus args
|
||||
if [ -f $old_cplus ]; then
|
||||
mv $old_cplus $old_cplus"_gcov"
|
||||
cat <<END1 > $old_cplus
|
||||
#!/bin/sh
|
||||
|
||||
echo "\$@" | grep conftest &>/tmp/tmp.tmp
|
||||
ret=\$?
|
||||
if [ \$ret -eq 0 ]; then
|
||||
${old_cplus}_gcov "\$@"
|
||||
else
|
||||
${old_cplus}_gcov %{?_with_gcov_args} "\$@"
|
||||
fi
|
||||
|
||||
END1
|
||||
chmod 755 $old_cplus $old_cplus"_gcov"
|
||||
fi
|
||||
%endif
|
||||
|
||||
%if %{with_ub}
|
||||
%post uploadbuild
|
||||
sed -i '/####add parameter start/r /opt/custom_build_tool/rpmbuild-ub' /usr/bin/rpmbuild
|
||||
@ -381,14 +208,8 @@ fi
|
||||
rm -rf /opt/custom_build_tool/custom_build_tool.sh
|
||||
%postun nocheck
|
||||
rm -rf /opt/custom_build_tool/rpmbuild-nocheck
|
||||
%postun sign
|
||||
rm -rf /opt/custom_build_tool/rpmbuild-sign
|
||||
%postun target
|
||||
rm -rf /opt/custom_build_tool/rpmbuild-target
|
||||
%if %{with_gcov}
|
||||
%postun gcov
|
||||
rm -rf /opt/custom_build_tool/rpmbuild-gcov
|
||||
%endif
|
||||
%if %{with_san}
|
||||
%postun san
|
||||
rm -rf /opt/custom_build_tool/rpmbuild-san
|
||||
@ -410,34 +231,9 @@ rm -rf /opt/custom_build_tool/rpmbuild-ub
|
||||
%dir /opt/custom_build_tool
|
||||
/opt/custom_build_tool/rpmbuild-nocheck
|
||||
|
||||
%files sign
|
||||
%defattr(-,root,root)
|
||||
%dir /opt
|
||||
%dir /opt/custom_build_tool
|
||||
/root/.gnupg/*
|
||||
/home/abuild/.gnupg/*
|
||||
/opt/custom_build_tool/rpmbuild-sign
|
||||
|
||||
%files nodebug
|
||||
%defattr(-,root,root)
|
||||
|
||||
%if %{with_gcov}
|
||||
%files gcov
|
||||
%defattr(-,root,root)
|
||||
%dir /opt
|
||||
%dir /opt/custom_build_tool
|
||||
/opt/custom_build_tool/rpmbuild-gcov
|
||||
/opt/custom_build_tool/upload.sh
|
||||
/opt/custom_build_tool/client-tool-linux
|
||||
/opt/custom_build_tool/cmdlist
|
||||
|
||||
%files gcov-server
|
||||
%defattr(-,root,root)
|
||||
%dir /opt/custom_build_tool
|
||||
/opt/custom_build_tool/server-tool-linux
|
||||
/opt/custom_build_tool/config.ini
|
||||
%endif
|
||||
|
||||
%if %{with_ub}
|
||||
%files uploadbuild
|
||||
%defattr(-,root,root)
|
||||
@ -465,96 +261,12 @@ rm -rf /opt/custom_build_tool/rpmbuild-ub
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT/*
|
||||
rm -rf %{_tmppath}/%{name}-%{version}
|
||||
rm -rf $RPM_BUILD_DIR/%{name}-%{version}
|
||||
rm -rf %{_tmppath}/%{name}
|
||||
rm -rf $RPM_BUILD_DIR/%{name}
|
||||
|
||||
%changelog
|
||||
* Wed Jun 12 2019 guoqinglan<guoqinglan@huawei.com> - 1.0-17
|
||||
- Type:enhancement
|
||||
* Fri Oct 16 2020 zhuchunyi <zhuchunyi@huawei.com> - 1.0.0-1
|
||||
- Type:new package
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC: add rpmbuild upload whitelist mechanism
|
||||
|
||||
* Mon Jun 03 2019 guoqinglan<guoqinglan@huawei.com> - 1.0-16
|
||||
- Type:enhancement
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC: cancel rpmbuild failed upload cation
|
||||
|
||||
* Wed May 29 2019 guoqinglan<guoqinglan@huawei.com> - 1.0-15
|
||||
- Type:enhancement
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC: modify upload package name
|
||||
|
||||
* Wed May 29 2019 guoqinglan<guoqinglan@huawei.com> - 1.0-14
|
||||
- Type:enhancement
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:add uploadbuild pkg
|
||||
|
||||
* Tue Apr 16 2019 wangqing<wangqing54@huawei.com> - 1.0-13
|
||||
- Type:enhancement
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:fix cups sign failed
|
||||
|
||||
* Thu Apr 11 2019 wangqing<wangqing54@huawei.com> - 1.0-12
|
||||
- Type:enhancement
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:Update key
|
||||
|
||||
* Mon Apr 01 2019 liuxueping<liuxueping1@huawei.com> - 1.0-11
|
||||
- Type:enhancement
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC: no buildrequires rpms about tool
|
||||
|
||||
* Thu Dec 06 2018 liuxueping<liuxueping1@huawei.com> - 1.0-10
|
||||
- Type:enhancement
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC: fix build failed in fedora29
|
||||
|
||||
* Thu Sep 20 2018 shanshishi<shanshishi@huawei.com> - 1.0-9
|
||||
- Type:enhancement
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC: fix duplicate and redundant code
|
||||
|
||||
* Tue Sep 7 2018 zhangpengfei<zhangpengfei14@huawei.com> - 1.0-8
|
||||
- Type:enhancement
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:update gcov kernel build
|
||||
|
||||
* Tue Aug 27 2018 zhangpengfei<zhangpengfei14@huawei.com> - 1.0-7
|
||||
- Type:enhancement
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:add gcov features
|
||||
|
||||
* Tue Aug 7 2018 zhangpengfei <zhangpengfei14@huawei.com> - 1.0.6
|
||||
- Type:develop
|
||||
- SUG:NA
|
||||
- DESC:add nodebug target from RTOS
|
||||
|
||||
* Thu Jun 14 2018 zhangpengfei <zhangpengfei14@huawei.com> - 1.0.5
|
||||
- Type:bugfix
|
||||
- SUG:NA
|
||||
- DESC:update the gpgkey to EulerOS SP5
|
||||
|
||||
* Thu Sep 14 2017 linyan <chentongbiao@huawei.com> - 1.0.4
|
||||
- Type:bugfix
|
||||
- SUG:NA
|
||||
- DESC:update the gpgkey to EulerOS SP3
|
||||
|
||||
* Wed Aug 2 2017 linyan <linyanly.lin@huawei.com> - 1.0.3
|
||||
- update releaes for obs build
|
||||
|
||||
* Fri Apr 28 2017 zwx326075 <zhangpengfei14@huawei.com> - 1.0.2
|
||||
- add rpmbuild --sign option build on obs worker
|
||||
|
||||
* Thu Apr 13 2017 zwx326075 <zhangpengfei14@huawei.com> - 1.0.1
|
||||
- init package, add rpmbuild --nocheck function
|
||||
- DESC: package init
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
version_control: NA
|
||||
src_repo: NA
|
||||
tag_prefix: NA
|
||||
seperator: NA
|
||||
version_control: gitee
|
||||
src_repo: openeuler/custom_build_tool
|
||||
tag_prefix: "^v"
|
||||
seperator: "."
|
||||
|
||||
@ -1,16 +0,0 @@
|
||||
SUBDIRS = client-tool server-tool
|
||||
|
||||
RECURSIVE_MAKE = @for subdir in $(SUBDIRS); do \
|
||||
echo "making in $$subdir"; \
|
||||
$(MAKE) -C $$subdir; \
|
||||
done
|
||||
|
||||
RECURSIVE_CLEAN = @for subdir in $(SUBDIRS); do \
|
||||
echo "making in $$subdir"; \
|
||||
$(MAKE) -C $$subdir clean; \
|
||||
done
|
||||
|
||||
all:
|
||||
$(RECURSIVE_MAKE)
|
||||
clean:
|
||||
$(RECURSIVE_CLEAN)
|
||||
@ -1,6 +0,0 @@
|
||||
client-tool-linux:multi_thread_client.o
|
||||
$(CC) -o client-tool-linux multi_thread_client.o -lpthread
|
||||
multi_thread_client.o:multi_thread_client.c common.h
|
||||
$(CC) ${CFLAGS} -c multi_thread_client.c
|
||||
clean:
|
||||
-rm client-tool-linux multi_thread_client.o
|
||||
@ -1 +0,0 @@
|
||||
132.10.3.129#6677#cmdecho["ifconfig"]
|
||||
@ -1,232 +0,0 @@
|
||||
/*
|
||||
说明:存放接口及常用结构
|
||||
*/
|
||||
#ifndef _COMMON_H
|
||||
#define _COMMON_H
|
||||
|
||||
// 确定编译环境
|
||||
#define IN_LINUX
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef IN_LINUX
|
||||
//#include <sys/io.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <pthread.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <sys/errno.h>
|
||||
#else
|
||||
#include <io.h>
|
||||
#include <direct.h>
|
||||
#include <windows.h>
|
||||
#include <basetsd.h>
|
||||
#include <winsock.h>
|
||||
|
||||
#pragma comment(lib,"wsock32.lib")
|
||||
|
||||
#endif
|
||||
|
||||
#define MAX_BUFFER_SIZE 1024
|
||||
#define MAX_CMDLINE_LENGTH 200
|
||||
#define MAX_THREAD_NUM 40
|
||||
#define LENGTH_OF_LISTEN_QUEUE 20
|
||||
#define MAX_IP_LENGTH 20
|
||||
#define MAX_CMDTYPE_LENGTH 20
|
||||
#define MAX_RSP_LENGTH 40
|
||||
#define MAX_RECONNECT_TIMERS 3
|
||||
#define BUFSIZE 65535
|
||||
|
||||
#define MAX_CONNECT_TIMEOUT 3600
|
||||
|
||||
#define CMDLIST "cmdlist"
|
||||
|
||||
//应答消息
|
||||
#define RSP_OK "0"
|
||||
#define RSP_FAILED "1"
|
||||
|
||||
#define RET_OK 0
|
||||
#define RET_FAILED 1
|
||||
|
||||
#define CMD_FALG_WAIT 0
|
||||
#define CMD_FALG_NOWAIT 1
|
||||
#define CMD_ECHO 2
|
||||
|
||||
|
||||
//支持的命令类型(命令类型的定义字符串不超过 MAX_CMDTYPE_LENGTH 定义的长度)
|
||||
#define COPYFILE "copyfile"
|
||||
#define CMD "cmd" //只负责下发命令,不管执行的情况
|
||||
#define CMDWAIT "cmdwait" //等待客户端命令执行完成
|
||||
#define SENDFILE "sendfile"
|
||||
#define FINDPROC "findproc"
|
||||
#define RSP "rsp" //应答消息
|
||||
#define CMDECHO "cmdecho" //显示执行结果,等待客户端命令执行完成
|
||||
|
||||
#ifdef IN_LINUX
|
||||
/*---------------------------------
|
||||
*说明: 发送数据给服务端
|
||||
*参数说明: socketID: 已经建立连接的socket句柄
|
||||
buffer : 需发送给服务端的数据
|
||||
*返回值: 0成功,否则失败
|
||||
-----------------------------------*/
|
||||
int SendDataToServer_linux(int socketID, char *data, int iLen);
|
||||
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 接收来自给服务端的数据
|
||||
*参数说明: socketID: 已经建立连接的socket句柄
|
||||
buffer : 为收到的数据,调用者必须手动释放该空间
|
||||
iBufLen : 发送数据的长度
|
||||
*返回值: 0成功,否则失败
|
||||
-----------------------------------*/
|
||||
int RecvDataFromServer_linux(int socketID, char *buffer, int iBufLen);
|
||||
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 连接服务端
|
||||
*参数说明:
|
||||
*返回值: 0成功,否则失败
|
||||
-----------------------------------*/
|
||||
int ConnectServer_linux(const char* pServerIP, int iServerPort, int iTimeout);
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 与客户端进行交互线程
|
||||
*参数说明:
|
||||
*返回值: 0成功,否则失败
|
||||
-----------------------------------*/
|
||||
void* Thread_linux(void* para);
|
||||
|
||||
#else
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 发送数据给服务端
|
||||
*参数说明: socketID: 已经建立连接的socket句柄
|
||||
buffer : 需发送给服务端的数据
|
||||
iBufLen : 发送数据的长度
|
||||
*返回值: 0成功,否则失败
|
||||
-----------------------------------*/
|
||||
int SendDataToServer_windows(int socketID, char *data, int iBufLen);
|
||||
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 接收来自给服务端的数据
|
||||
*参数说明: socketID: 已经建立连接的socket句柄
|
||||
buffer : 为收到的数据,调用者必须手动释放该空间
|
||||
*返回值: 0成功,否则失败
|
||||
-----------------------------------*/
|
||||
int RecvDataFromServer_windows(int socketID, char *buffer, int iBufLen);
|
||||
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 连接服务端
|
||||
*参数说明:
|
||||
*返回值:
|
||||
-----------------------------------*/
|
||||
SOCKET ConnectServer_windows(const char* pServerIP, int iServerPort, int iTimeout);
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 与客户端进行交互
|
||||
*参数说明:
|
||||
*返回值: 0成功,否则失败
|
||||
-----------------------------------*/
|
||||
|
||||
ULONG __stdcall Thread_windows(void *para);
|
||||
|
||||
#endif
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 从服务端拷贝文件
|
||||
*参数说明: socketID: 已经建立连接的socket句柄
|
||||
data : 需要拷贝的文件信息
|
||||
*返回值: 0成功,否则失败
|
||||
-----------------------------------*/
|
||||
int CopyFileFromServer(void* socketID, char *data);
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 发送文件给服务端
|
||||
*参数说明: socketID: 已经建立连接的socket句柄
|
||||
data : 需要发送的文件信息
|
||||
*返回值: 0成功,否则失败
|
||||
-----------------------------------*/
|
||||
int SendFileToServer(void* socketID, char *data);
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 查看服务端当前指定的程序是否正在运行
|
||||
*参数说明: socketID: 已经建立连接的socket句柄
|
||||
data : 需要发送的文件信息
|
||||
*返回值: 0成功,否则失败
|
||||
-----------------------------------*/
|
||||
int FindProcessFromServer(void* socketID, char *data);
|
||||
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 创建线程
|
||||
*参数说明:
|
||||
*返回值: 0成功,否则失败
|
||||
-----------------------------------*/
|
||||
int CreateSubThread(char *para);
|
||||
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 解析cmdlist上的命令
|
||||
*参数说明:
|
||||
*返回值: 0成功,否则失败
|
||||
-----------------------------------*/
|
||||
int ParseCmd(char *data, char *ip, int *port, char *cmd);
|
||||
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 与客户端进行交互
|
||||
*参数说明:
|
||||
*返回值: 0成功,否则失败
|
||||
-----------------------------------*/
|
||||
int TalkToServer(void* para, int iTimeout);
|
||||
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 发送系统命令到服务端
|
||||
*参数说明:
|
||||
*返回值: 0成功,否则失败
|
||||
-----------------------------------*/
|
||||
int SendCmdToServer(void* socketID, char* para, int isWaitFlag);
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 解析应答消息
|
||||
*参数说明:
|
||||
*返回值: 0成功,否则失败
|
||||
-----------------------------------*/
|
||||
int ParseRsp(char* strRsp);
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 发送应答消息给服务端
|
||||
*参数说明: socketID: 已经建立连接的socket句柄
|
||||
data : 发送数据
|
||||
*返回值: 0成功,否则失败
|
||||
-----------------------------------*/
|
||||
int SendRspToSever(void* socketID, char *result);
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 等待服务端的应答
|
||||
*参数说明: socketID: 已经建立连接的socket句柄
|
||||
*返回值: 0成功,否则失败
|
||||
-----------------------------------*/
|
||||
int WaitRspFromServer(void* socketID);
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 执行cmdlist中的命令
|
||||
*参数说明:
|
||||
*返回值: 0成功,否则失败
|
||||
-----------------------------------*/
|
||||
int RunCmdlist();
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 执行命令行参数
|
||||
*参数说明:
|
||||
*返回值: 0成功,否则失败
|
||||
-----------------------------------*/
|
||||
int RunCmd(int argc, char **argv);
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,6 +0,0 @@
|
||||
server-tool-linux:multi_thread_server.o
|
||||
$(CC) -o server-tool-linux multi_thread_server.o -lpthread
|
||||
multi_thread_server.o:multi_thread_server.c common.h
|
||||
$(CC) ${CFLAGS} -c multi_thread_server.c
|
||||
clean:
|
||||
-rm server-tool-linux multi_thread_server.o
|
||||
@ -1,258 +0,0 @@
|
||||
/*
|
||||
说明:存放接口及常用结构
|
||||
*/
|
||||
#ifndef _COMMON_H
|
||||
#define _COMMON_H
|
||||
|
||||
// 确定编译环境
|
||||
#define IN_LINUX
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef IN_LINUX
|
||||
//#include <sys/io.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <pthread.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <sys/errno.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#else
|
||||
#include <io.h>
|
||||
#include <direct.h>
|
||||
#include <windows.h>
|
||||
#include <winsock.h>
|
||||
#include <basetsd.h>
|
||||
#endif
|
||||
|
||||
#pragma comment(lib,"ws2_32.lib")
|
||||
|
||||
#define MAX_BUFFER_SIZE 1024
|
||||
#define MAX_CMDLINE_LENGTH 200
|
||||
#define MAX_THREAD_NUM 40
|
||||
#define LENGTH_OF_LISTEN_QUEUE 20
|
||||
#define MAX_IP_LENGTH 20
|
||||
#define MAX_CMDTYPE_LENGTH 20
|
||||
#define MAX_RSP_LENGTH 40
|
||||
#define BUFSIZE 65535
|
||||
|
||||
#define CONFIG "config.ini"
|
||||
|
||||
//工具的版本
|
||||
#define VERSION "1.1.1"
|
||||
|
||||
//应答消息
|
||||
#define RSP_OK "0"
|
||||
#define RSP_FAILED "1"
|
||||
|
||||
#define RET_OK 0
|
||||
#define RET_FAILED 1
|
||||
|
||||
|
||||
//支持的命令类型(命令类型的定义字符串不超过 MAX_CMDTYPE_LENGTH 定义的长度)
|
||||
#define COPYFILE "copyfile"
|
||||
#define CMD "cmd"
|
||||
#define CMDWAIT "cmdwait" //等待客户端命令执行完成
|
||||
#define SENDFILE "sendfile"
|
||||
#define FINDPROC "findproc"
|
||||
#define RSP "rsp" //应答消息
|
||||
#define CMDECHO "cmdecho"
|
||||
|
||||
|
||||
#define CMD_FALG_WAIT 0
|
||||
#define CMD_FALG_NOWAIT 1
|
||||
#define CMD_ECHO 2
|
||||
|
||||
|
||||
//服务器端口号,从配置文件中读取
|
||||
int g_port;
|
||||
|
||||
|
||||
#ifdef IN_LINUX
|
||||
/*---------------------------------
|
||||
*说明: 与客户端进行交互
|
||||
*参数说明:
|
||||
*返回值: 0成功,否则失败
|
||||
-----------------------------------*/
|
||||
void * TalkToClient_linux(void *data);
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 发送数据给客户端
|
||||
*参数说明: socketID: 已经建立连接的socket句柄
|
||||
buffer : 需发送给客户端的数据
|
||||
*返回值: 0成功,否则失败
|
||||
-----------------------------------*/
|
||||
int SendDataToClient_linux(int socketID, char *data, int iDataLen);
|
||||
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 接收来自给客户端的数据
|
||||
*参数说明: socketID: 已经建立连接的socket句柄
|
||||
buffer : 为收到的数据
|
||||
*返回值: 0 断开连接
|
||||
大于0 收到数据的长度
|
||||
-1 失败
|
||||
-----------------------------------*/
|
||||
int RecvDataFromClient_linux(int socketID, char *buffer, int iBufLen);
|
||||
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 在linux环境下查找指定进程是否存在
|
||||
*参数说明:
|
||||
*返回值: 0 存在,其他表示不存在
|
||||
-----------------------------------*/
|
||||
int FindProcess_linux(char *pProcessName);
|
||||
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 初始化服务连接及监听
|
||||
*参数说明:
|
||||
*返回值: 0成功,否则失败
|
||||
-----------------------------------*/
|
||||
int InitServer_linux();
|
||||
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 开始提供服务
|
||||
*参数说明:
|
||||
*返回值: 0成功,否则失败
|
||||
-----------------------------------*/
|
||||
int StartService_linux(int server_socket);
|
||||
|
||||
|
||||
#else
|
||||
/*---------------------------------
|
||||
*说明: 与客户端进行交互
|
||||
*参数说明:
|
||||
*返回值: 0成功,否则失败
|
||||
-----------------------------------*/
|
||||
ULONG __stdcall TalkToClient_windows(void* lpParameter);
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 发送数据给客户端
|
||||
*参数说明: socketID: 已经建立连接的socket句柄
|
||||
buffer : 需发送给客户端的数据
|
||||
*返回值: 0成功,否则失败
|
||||
-----------------------------------*/
|
||||
int SendDataToClient_windows(SOCKET socketID, char *data, int iDataLen);
|
||||
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 接收来自给客户端的数据
|
||||
*参数说明: socketID: 已经建立连接的socket句柄
|
||||
buffer : 为收到的数据,调用者必须手动释放该空间
|
||||
*返回值: 0 断开连接
|
||||
大于0 收到数据的长度
|
||||
-1 失败
|
||||
-----------------------------------*/
|
||||
int RecvDataFromClient_windows(SOCKET socketID, char *buffer, int iBufLen);
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 在windows环境下查找指定进程是否存在
|
||||
*参数说明:
|
||||
*返回值: 0 存在,其他表示不存在
|
||||
-----------------------------------*/
|
||||
int FindProcess_windows(char *pProcessName);
|
||||
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 初始化服务连接及监听
|
||||
*参数说明:
|
||||
*返回值: 0成功,否则失败
|
||||
-----------------------------------*/
|
||||
int InitServer_windows();
|
||||
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 开始提供服务
|
||||
*参数说明:
|
||||
*返回值: 0成功,否则失败
|
||||
-----------------------------------*/
|
||||
int StartService_windows(SOCKET server_socket);
|
||||
|
||||
#endif
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 执行拷贝文件到客户端
|
||||
*参数说明: socketID: 已经建立连接的socket句柄
|
||||
data : 需要拷贝的文件名(全路径)
|
||||
*返回值: 0成功,否则失败
|
||||
-----------------------------------*/
|
||||
int CopyFileToClient(void* socketID, char *pFile);
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 接收来自客户端的文件
|
||||
*参数说明: socketID: 已经建立连接的socket句柄
|
||||
file : 需要保存的文件名(全路径)
|
||||
*返回值: 0成功,否则失败
|
||||
-----------------------------------*/
|
||||
int RecvFileFromClient(void* socketID, char *pFile);
|
||||
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 执行系统命令
|
||||
*参数说明: socketID: 已经建立连接的socket句柄
|
||||
pCmd : 执行的命令
|
||||
*返回值: 0成功,否则失败
|
||||
-----------------------------------*/
|
||||
int RunSystemCmd(void* socketID, char *pCmd, int iWaitFlag);
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 解析客户端发送过来的命令
|
||||
*参数说明: socketID: 已经建立连接的socket句柄
|
||||
data : 客户端发送过来的命令
|
||||
*返回值: 0成功,否则失败
|
||||
-----------------------------------*/
|
||||
int ParseCmd(void* socketID, char *data);
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 发送应答消息给客户端
|
||||
*参数说明: socketID: 已经建立连接的socket句柄
|
||||
data : 发送数据
|
||||
*返回值: 0成功,否则失败
|
||||
-----------------------------------*/
|
||||
int SendRspToClient(void* socketID, char *result);
|
||||
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 等待客户端的应答
|
||||
*参数说明: socketID: 已经建立连接的socket句柄
|
||||
*返回值: 0成功,否则失败
|
||||
-----------------------------------*/
|
||||
int WaitRspFromClient(void* socketID);
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 解析应答消息
|
||||
*参数说明:
|
||||
*返回值: 0成功,否则失败
|
||||
-----------------------------------*/
|
||||
int ParseRsp(char* strRsp);
|
||||
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 查看指定的程序是否正在运行
|
||||
*参数说明: socketID: 已经建立连接的socket句柄
|
||||
data : 进程名
|
||||
*返回值: 0成功,否则失败
|
||||
-----------------------------------*/
|
||||
int FindProcess(void* socketID, char *data);
|
||||
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 初始化
|
||||
*参数说明:
|
||||
*返回值: 0成功,否则失败
|
||||
-----------------------------------*/
|
||||
int Init();
|
||||
|
||||
/*---------------------------------
|
||||
*说明: 运行
|
||||
*参数说明:
|
||||
*返回值: 0成功,否则失败
|
||||
-----------------------------------*/
|
||||
int Run();
|
||||
#endif
|
||||
@ -1 +0,0 @@
|
||||
port:6677
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,87 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Author: yhon
|
||||
# Copyright Huawei Technologies Co., Ltd. 2010-2018. All rights reserved.
|
||||
set -e
|
||||
|
||||
cpath=/opt/custom_build_tool
|
||||
build_dir=$(rpm --eval %{_builddir})
|
||||
#if find /home/abuild/rpmbuild/RPMS/ -name "*.rpm" |egrep 'i386$|i586.rpm$|i686.rpm$' &> /dev/null; then
|
||||
# echo "xdfgcov: Don't need i386 i586 i686"
|
||||
# exit 0
|
||||
#fi
|
||||
|
||||
ip="10.175.100.158"
|
||||
user="root"
|
||||
password="huawei"
|
||||
http_dir="/srv/www/htdocs/gcov"
|
||||
project=$(rpm --eval %{_project})
|
||||
repo=$(rpm --eval %{_repository})
|
||||
arch=$(rpm --eval %{_build_cpu})
|
||||
release_dir="${http_dir}/${project}/${repo}/${arch}"
|
||||
|
||||
cd "${build_dir}"
|
||||
if ! find ./ | grep 'gcno$' &> /dev/null; then
|
||||
echo "xdf: No gcno file!!!"
|
||||
exit 0
|
||||
fi
|
||||
module=$(find ./ | grep 'gcno$' | head -1 | awk -F '/' '{print $2}')
|
||||
|
||||
if [ -z "${module}" ]; then
|
||||
echo "xdf: has some problem"
|
||||
exit 1
|
||||
#exit 0
|
||||
fi
|
||||
tar_name=${module}
|
||||
if find /home/abuild/rpmbuild/RPMS/ | grep mirro ; then
|
||||
tar_name="${module}-mirror"
|
||||
mv "${module}" "${tar_name}"
|
||||
module="${module}-mirror"
|
||||
fi
|
||||
if find /home/abuild/rpmbuild/RPMS/ | grep openvswitch | grep kmod ; then
|
||||
tar_name="${module}-kmod"
|
||||
fi
|
||||
tar --exclude *.o --exclude *.so -czf "${tar_name}".tar.gz "${module}"
|
||||
|
||||
#chmod 777 /opt/custom_build_tool/client-tool-linux
|
||||
/opt/custom_build_tool/client-tool-linux "$ip"#4123#cmdwait["mkdir -p $release_dir"]
|
||||
/opt/custom_build_tool/client-tool-linux "$ip"#4123#sendfile["${module}.tar.gz,$release_dir/${module}.tar.gz"]
|
||||
|
||||
cd -
|
||||
exit 0
|
||||
|
||||
|
||||
|
||||
|
||||
echo "xdf: cp gcno and src to $release_dir"
|
||||
SSH_CMD="mkdir -p $release_dir"
|
||||
sh "$cpath"/sshcmd.sh -c "$SSH_CMD" -m "$ip" -u "$user" -p "$password"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Failed in sshcmd.sh on mkdir -p $release_dir"
|
||||
exit 1
|
||||
#exit 0
|
||||
fi
|
||||
|
||||
if find ./ | grep 'gcno$' &> /dev/null; then
|
||||
echo "xdf: No gcno file!!!"
|
||||
exit 0
|
||||
fi
|
||||
cd $build_dir
|
||||
MODULE=$(find ./ | grep 'gcno$' | head -1 | awk -F '/' '{print $2}')
|
||||
|
||||
if [ -z "${MODULE}" ]; then
|
||||
echo "xdf: has some problem"
|
||||
exit 1
|
||||
#exit 0
|
||||
fi
|
||||
tar --exclude *.o --exclude *.so -czf "${MODULE}".tar.gz "${MODULE}"
|
||||
cd -
|
||||
echo "xdf: $build_dir/$MODULE gcov done"
|
||||
sh "$cpath"/sshscp.sh -p "$password" -s "$build_dir/${MODULE}.tar.gz" -d "root@$ip:$release_dir" -r
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Failed in sshscp.sh $build_dir/$MODULE"
|
||||
exit 1
|
||||
#exit 0
|
||||
fi
|
||||
|
||||
echo "xdf:Gcov successful"
|
||||
exit 0
|
||||
@ -1,26 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Author: yhon
|
||||
# Copyright Huawei Technologies Co., Ltd. 2010-2018. All rights reserved.
|
||||
set -e
|
||||
|
||||
rpm_name=$1
|
||||
|
||||
cpath=/opt/custom_build_tool
|
||||
build_dir=$(rpm --eval %{_builddir})
|
||||
|
||||
ip="10.175.100.158"
|
||||
user="root"
|
||||
password="huawei"
|
||||
http_dir="/srv/www/htdocs/rpmbuild_middleware"
|
||||
project=$(rpm --eval %{_project})
|
||||
repo=$(rpm --eval %{_repository})
|
||||
arch=$(rpm --eval %{_build_cpu})
|
||||
release_dir="${http_dir}/${project}/${repo}/${arch}"
|
||||
release_dir="${http_dir}/${project}/${repo}/${arch}"
|
||||
|
||||
tar_name=$(grep "/rpmbuild/SOURCES" /.build.command | awk -F 'rpmbuild/SOURCES/' '{print $2}' |awk -F '\\.spec' '{print $1}')
|
||||
|
||||
tar -I pbzip2 -cf "${tar_name}".tar.bz2 "${build_dir}"
|
||||
|
||||
/opt/custom_build_tool/client-tool-linux "$ip"#4123#cmdwait["mkdir -p $release_dir"]
|
||||
/opt/custom_build_tool/client-tool-linux "$ip"#4123#sendfile["${tar_name}.tar.bz2,$release_dir/${tar_name}.tar.bz2"]
|
||||
Loading…
x
Reference in New Issue
Block a user