dpkg/build.sh

556 lines
13 KiB
Bash
Raw Normal View History

2022-09-28 09:40:51 +00:00
oem=$1 #厂商
2022-09-28 09:55:52 +00:00
password="hg123123" #电脑密码
2022-09-28 09:40:51 +00:00
cpu=$(arch) #cpu架构
2022-07-04 01:48:13 +00:00
sys=$(cat /etc/issue)
2022-09-28 09:40:51 +00:00
sys=${sys%% *} #操作系统
dpkgpath="" #打包路径
dpkgarch="" #打包时的版本
libname="" #动态库名字
libpath="" #打包时库路径
time2=$(date "+%g%j") #版本控制
ismount=-1 #是否挂载服务器成功 0成功 非0失败
FIND_FILE="/home/samba/dpkg" #服务器存放打包路径 不可修改
2022-07-04 08:31:52 +00:00
dpkgtype="app"
2022-08-04 08:20:59 +00:00
ver3=10
2023-01-14 07:46:27 +00:00
sanelibname=""
2023-03-07 07:10:56 +00:00
syspath="" #系统库路径
dpkgtype="" #哪种打包方式 uos 还是kylin
#web so 只走kylin的打包方式
2022-08-09 09:22:55 +00:00
2022-09-28 09:55:52 +00:00
if [ $2 ];
then
2023-03-07 07:10:56 +00:00
dpkgtype=$2 #可以手动设置操作系统来进行打包
echo "$dpkgtype"
else
if [ "$sys" == "UnionTech" ];
then
dpkgtype=uos
else
dpkgtype=kylin
fi
fi
if [ $3 ];
then
password=$3
2022-09-28 09:55:52 +00:00
fi
2022-07-04 01:48:13 +00:00
2022-09-29 02:04:42 +00:00
echo "$password"
sleep 1
2023-01-13 07:36:32 +00:00
if [ "$oem" != "hg" ] \
&& [ "$oem" != "lsc" ] \
&& [ "$oem" != "hw" ] \
&& [ "$oem" != "hgweb" ] \
&& [ "$oem" != "lscweb" ] \
&& [ "$oem" != "hgso" ] \
&& [ "$oem" != "lscso" ] \
&& [ "$oem" != "hwso" ] \
&& [ "$oem" != "lscsm" ]\
2023-03-07 07:10:56 +00:00
&& [ "$oem" != "ctsso" ]\
2023-03-14 03:33:01 +00:00
&& [ "$oem" != "cts" ]\
2023-04-15 03:15:39 +00:00
&& [ "$oem" != "zg" ]\
&& [ "$oem" != "zgso" ]\
2023-04-15 03:17:30 +00:00
&& [ "$oem" != "zgweb" ]\
2023-07-21 03:42:36 +00:00
&& [ "$oem" != "dl" ]\
2023-04-15 03:17:30 +00:00
&& [ "$oem" != "zj" ]\
&& [ "$oem" != "zjso" ]\
&& [ "$oem" != "zjweb" ];
2022-07-04 01:48:13 +00:00
then
2023-01-13 07:36:32 +00:00
echo "参数错误:$oem !!!"
2023-01-14 09:19:18 +00:00
echo "参数:华高:hg || hgweb ||hgso 立思层:lsc || lscweb ||lscso 汉王:hw || hwweb || hwso 沧田:cts"
2022-07-04 01:48:13 +00:00
exit 1
fi
2023-01-13 09:55:21 +00:00
2023-01-14 08:44:56 +00:00
if [ "${oem:0-2:2}" == "so" ] || [ "${oem:0-2:2}" == "sm" ];
2023-01-14 07:46:27 +00:00
then
2023-03-07 07:10:56 +00:00
dpkgtype=kylin
2023-01-14 07:46:27 +00:00
sanelibname="${oem%${oem:0-2:2}*}"
echo $sanelibname
2023-01-14 08:44:56 +00:00
elif [ "${oem:0-3:3}" == "web" ];
2023-01-14 08:35:55 +00:00
then
2023-03-07 07:10:56 +00:00
dpkgtype=kylin
2023-01-14 08:35:55 +00:00
sanelibname="${oem%${oem:0-3:3}*}"
echo $sanelibname
2023-01-14 07:46:27 +00:00
else
sanelibname=$oem
echo $sanelibname
fi
function appbuild()
{
pwd
echo "-----------------------------start-----------------------------"
#GIT CODE
2023-03-28 02:02:07 +00:00
rm ../release/$syspath/$cpu/*
2023-01-14 07:46:27 +00:00
git -C ../release clean -df
git -C ../release checkout .
git -C ../release pull
git -C ../sdk clean -df
git -C ../sdk checkout .
git -C ../sdk pull
2023-06-20 05:46:44 +00:00
#git -C ../code_device clean -df
#git -C ../code_device checkout .
#git -C ../code_device pull
2023-01-14 07:46:27 +00:00
2023-03-07 07:27:27 +00:00
git -C ../code_app clean -df
git -C ../code_app checkout .
git -C ../code_app pull
2023-01-14 07:46:27 +00:00
2023-03-07 07:27:27 +00:00
git -C ../code_lang checkout .
git -C ../code_lang pull
2023-02-01 04:07:20 +00:00
echo "-----------------------------start code_lang build-----------------------------"
./../code_lang/build.sh
2023-01-14 07:46:27 +00:00
echo "-----------------------------start code_device build-----------------------------"
2023-01-14 08:35:55 +00:00
2023-03-07 07:10:56 +00:00
./../code_device/build.sh $sanelibname $dpkgtype
2023-01-14 08:35:55 +00:00
2023-01-14 07:46:27 +00:00
echo "-----------------------------over code_device build-----------------------------"
if [ $? -ne 0 ];then
echo "code_device-------->编译失败"
exit 1
fi
echo "-----------------------------start code_app build-----------------------------"
if [ ${oem:0-2:2} == "sm" ];
then
./../code_app/build.sh ${oem%${oem:0-2:2}*}
else
2023-03-07 07:10:56 +00:00
./../code_app/build.sh $oem
2023-02-01 04:07:20 +00:00
echo ""
2023-01-14 07:46:27 +00:00
fi
echo "-----------------------------over code_app build-----------------------------"
if [ $? -ne 0 ];then
echo "code_app-------->编译失败"
exit 1
fi
}
2022-09-28 09:40:51 +00:00
function getismount()
{
2022-09-29 02:04:42 +00:00
if [ ! -d "/home/samba" ];then
2023-01-13 07:36:32 +00:00
echo $password|sudo -S mkdir -p "/home/samba"
2023-01-04 10:32:20 +00:00
echo $password|sudo -S mount -t cifs //192.168.10.5/huagao /home/samba/ -o username=huagao,password=hg123123
2022-09-29 02:04:42 +00:00
fi
2022-09-28 09:40:51 +00:00
mountpoint -q /home/samba
ismount=$?
if [ $ismount != 0 ];then
echo "$(date):mount is fail!!! and reboot mount"
2023-01-13 07:36:32 +00:00
echo $password|sudo -S mount -t cifs //192.168.10.5/huagao /home/samba/ -o username=huagao,password=hg123123
2022-09-29 02:04:42 +00:00
if [ ! $? ];then
echo "$(date):mount is fail!!!"
exit 1
fi
ismount=$?
2022-09-28 09:40:51 +00:00
else
echo "$(date):mount is succeed"
fi
}
2023-01-14 07:46:27 +00:00
2023-01-13 07:36:32 +00:00
if [ "$cpu" == "x86_64" ];
then
2022-07-04 01:48:13 +00:00
dpkgarch="amd64"
libpath="x86_64-linux-gnu"
2023-01-13 07:36:32 +00:00
elif [ "$cpu" == "aarch64" ];
then
2022-07-04 01:48:13 +00:00
dpkgarch="arm64"
libpath="aarch64-linux-gnu"
2023-01-13 07:36:32 +00:00
elif [ "$cpu" == "mips64" ];
then
2022-07-04 01:48:13 +00:00
dpkgarch="mips64el"
2022-08-09 09:29:09 +00:00
libpath="mips64el-linux-gnu"
2023-01-13 07:36:32 +00:00
elif [ "$cpu" == "loongarch64" ];
then
2022-10-14 08:30:34 +00:00
dpkgarch="loongarch64"
libpath="loongarch64-linux-gnu"
2022-07-04 01:48:13 +00:00
else
echo "没有已知架构"
exit 1
fi
2023-03-07 07:10:56 +00:00
if [ "$syspath" == "uos" ] || [ "$sys" == "UnionTech" ];
then
syspath="uos"
elif [ "$syspath" == "kylin" ] && [ "$sys" == "UnionTech" ];
then
syspath="uos"
elif [ "$syspath" == "" ] && [ "$sys" == "UnionTech" ];
2023-01-13 07:36:32 +00:00
then
2023-03-07 07:10:56 +00:00
syspath="uos"
elif [ "$syspath" == "kylin" ] || [ "$sys" == "Kylin" ];
then
syspath="kylin"
elif [ "$syspath" == "uos" ] && [ "$sys" == "Kylin" ];
then
syspath="kylin"
elif [ "$syspath" == "" ] && [ "$sys" == "Kylin" ];
then
syspath="kylin"
else
syspath="kylin"
fi
echo $syspath
2023-01-13 07:36:32 +00:00
2023-03-07 07:10:56 +00:00
if [ $dpkgtype == "uos" ];
then
2023-01-13 07:36:32 +00:00
if [ "$oem" == "hw" ];
then
dpkgpath="com.hanvonchina.hanvonscan"
elif [ "$oem" == "lsc" ];
then
dpkgpath="com.lanxumchina.lanxumscan"
elif [ "$oem" == "hg" ];
then
dpkgpath="com.huagaochina.huagoscan"
elif [ "$oem" == "cts" ];
then
dpkgpath="com.cumtennchina.cumtennscan"
2023-02-03 06:36:15 +00:00
elif [ "$oem" == "zj" ];
then
2023-03-16 10:59:27 +00:00
dpkgpath="com.microtekchina.microtekscan-ex"
2023-03-14 03:14:51 +00:00
elif [ "$oem" == "zg" ];
then
2023-03-17 09:57:17 +00:00
dpkgpath="com.unischina.uniscan"
2023-07-21 03:42:36 +00:00
elif [ "$oem" == "dl" ];
then
dpkgpath="com.delichina.deliscan"
2022-07-04 01:48:13 +00:00
fi
2022-09-28 07:15:38 +00:00
else
2023-01-13 09:55:21 +00:00
if [ "$oem" == "hw" ] ;
then
dpkgpath="scanner-driver-hanvon"
elif [ "$oem" == "lsc" ];
then
dpkgpath="scanner-driver-lanxum"
elif [ "$oem" == "hg" ];
then
dpkgpath="scanner-driver-huagao"
elif [ "$oem" == "cts" ];
then
dpkgpath="scanner-driver-cumtenn"
2023-02-03 07:16:26 +00:00
elif [ "$oem" == "zj" ];
2023-02-03 06:36:15 +00:00
then
2023-03-16 10:59:27 +00:00
dpkgpath="scanner-driver-microtek-ex"
2023-03-14 03:14:51 +00:00
elif [ "$oem" == "zg" ];
then
dpkgpath="scanner-driver-unis"
2023-07-21 03:42:36 +00:00
elif [ "$oem" == "dl" ];
then
dpkgpath="scanner-driver-deli"
2023-01-13 09:55:21 +00:00
elif [ "$oem" == "hgweb" ];
then
dpkgpath="huagaowebscan"
elif [ "$oem" == "lscweb" ];
then
dpkgpath="lanxumwebscan"
elif [ "$oem" == "hwweb" ];
then
dpkgpath="hanvonwebscan"
elif [ "$oem" == "ctsweb" ];
then
dpkgpath="cumtennwebscan"
2023-04-15 03:15:39 +00:00
elif [ "$oem" == "zjweb" ];
then
dpkgpath="Microtekwebscan"
2023-01-13 09:55:21 +00:00
elif [ "$oem" == "hgso" ];
then
dpkgpath="huagaoscansdk"
elif [ "$oem" == "lscso" ];
then
dpkgpath="lanxumscansdk"
elif [ "$oem" == "hwso" ];
then
dpkgpath="hanvonscansdk"
elif [ "$oem" == "ctsso" ];
then
dpkgpath="cumtennscansdk"
2023-04-15 03:15:39 +00:00
elif [ "$oem" == "zjso" ];
then
dpkgpath="Microtekscansdk"
2023-01-13 09:55:21 +00:00
elif [ "$oem" == "lscsm" ];
then
dpkgpath="lanxumscan"
fi
2023-03-07 07:10:56 +00:00
fi
2022-08-05 02:57:49 +00:00
2023-01-13 07:36:32 +00:00
if [ "$oem" == "lsc" ] \
|| [ "$oem" == "lscweb" ] \
|| [ "$oem" == "lscso" ] \
|| [ "$oem" == "lscsm" ];
then
ver3=14
elif [ "$oem" == "hw" ] \
|| [ "$oem" == "hwweb" ] \
|| [ "$oem" == "hwso" ];
then
ver3=16
elif [ "$oem" == "cts" ] \
|| [ "$oem" == "ctsweb" ] \
|| [ "$oem" == "ctsso" ];
then
ver3=18
2023-04-15 05:06:21 +00:00
elif [ "$oem" == "zj" ]\
|| [ "$oem" == "zjweb" ]\
|| [ "$oem" == "zjsso" ];
2023-02-03 06:36:15 +00:00
then
ver3=20
2023-03-14 03:14:51 +00:00
elif [ "$oem" == "zg" ];
then
ver3=22
2023-07-21 03:42:36 +00:00
elif [ "$oem" == "dl" ];
then
ver3=24
2022-08-05 02:57:49 +00:00
fi
2023-01-13 07:36:32 +00:00
2022-08-04 09:24:58 +00:00
ver3=$[$ver3 * 10]
2023-01-13 07:36:32 +00:00
if [ "$cpu" == "x86_64" ];
then
2022-11-24 09:58:42 +00:00
ver3=$[$ver3 + 5]
2023-01-13 07:36:32 +00:00
elif [ "$cpu" == "aarch64" ];
then
2022-08-04 09:24:58 +00:00
ver3=$[$ver3 + 2]
2023-01-13 07:36:32 +00:00
elif [ "$cpu" == "mips64" ];
then
2022-08-04 09:24:58 +00:00
ver3=$[$ver3 + 3]
2023-01-13 07:36:32 +00:00
elif [ "$cpu" == "loongarch64" ];
then
2022-10-14 08:30:34 +00:00
ver3=$[$ver3 + 4]
2022-08-04 09:24:58 +00:00
fi
2022-07-04 01:48:13 +00:00
2022-08-04 09:24:58 +00:00
ver3=$[$ver3 * 100]
2023-03-21 10:11:24 +00:00
if [ "$dpkgtype" == "uos" ];
2023-01-13 07:36:32 +00:00
then
2022-08-04 09:24:58 +00:00
ver3=$[$ver3 + 20]
2023-03-21 10:11:24 +00:00
elif [ "$dpkgtype" == "kylin" ];
2023-01-13 07:36:32 +00:00
then
2022-08-04 09:24:58 +00:00
ver3=$[$ver3 + 21]
else
# unknown OS, set as linux
ver3=$[$ver3 + 10]
fi
2023-02-01 04:07:20 +00:00
2023-01-14 07:46:27 +00:00
appbuild ########开始进行编译目前只能git 后期可以选择保存本地进行替换
2023-01-13 07:36:32 +00:00
#从 brand.h当中获取版本号
2022-09-29 07:06:02 +00:00
mainverstr=$(cat ../sdk/include/huagao/brand.h |grep VERSION_MAIN)
mainverstr=${mainverstr: -2}
mainverstr=$(echo $mainverstr)
minver=$(cat ../sdk/include/huagao/brand.h |grep VERSION_SUB)
minver=${minver: -2}
minver=$(echo $minver)
2023-01-14 07:46:27 +00:00
ver="$mainverstr.$minver.$ver3.$time2"
2022-08-09 09:22:55 +00:00
echo $minver
echo "3rd version replacing pattern: "${ver3}
echo $dpkgpath
echo $ver
2022-07-04 01:48:13 +00:00
Version="Version: $ver"
Architecture="Architecture: $dpkgarch"
packagename="package: $dpkgpath"
2022-09-28 07:15:38 +00:00
2022-07-04 01:48:13 +00:00
echo $Architecture $Version
2023-01-14 07:46:27 +00:00
############## 路径以sane根目录为基准
2023-01-13 09:55:21 +00:00
cd ..
##############
2022-07-04 01:48:13 +00:00
2023-02-06 07:44:55 +00:00
2023-02-06 07:17:46 +00:00
##############lsc不替换
if [ "$oem" != "lscsm" ];
then
2023-02-06 07:44:55 +00:00
##############进行copy语言包
cp -rf release/lang release/$syspath/$cpu
2023-03-07 07:10:56 +00:00
sed -i "1s/.*/$packagename/g" dpkg/$dpkgtype/$oem/DEBIAN/control
sed -i "2s/.*/$Version/g" dpkg/$dpkgtype/$oem/DEBIAN/control
2023-02-06 07:17:46 +00:00
fi
2023-03-07 07:10:56 +00:00
sed -i "3s/.*/$Architecture/g" dpkg/$dpkgtype/$oem/DEBIAN/control
rm dpkg/$dpkgtype/$oem/etc/udev/rules.d/*
2022-09-30 03:37:08 +00:00
2023-03-07 07:10:56 +00:00
cp dpkg/60-sane.rules dpkg/$dpkgtype/$oem/etc/udev/rules.d/60-"$oem"sane.rules
2022-09-30 03:01:17 +00:00
2023-04-15 06:03:58 +00:00
if [ "${oem:0-2:2}" != "so" ] && [ "${oem:0-3:3}" != "web" ];
2023-01-13 09:55:21 +00:00
then
2023-04-15 05:06:21 +00:00
#创建sane的文件目录 //必须保证这一步成功
2023-04-17 01:15:58 +00:00
2023-04-15 05:06:21 +00:00
rm -rf dpkg/$dpkgtype/$oem/usr/lib/*
2023-01-13 09:55:21 +00:00
if [ $? -ne 0 ];then
2023-04-15 05:06:21 +00:00
echo "del sane file fail"
2023-01-13 09:55:21 +00:00
exit 1
fi
2023-01-13 07:36:32 +00:00
2023-04-15 05:06:21 +00:00
if [ ! -d dpkg/$dpkgtype/$oem/usr/lib/$libpath ];
2023-01-13 09:55:21 +00:00
then
2023-04-15 05:06:21 +00:00
mkdir -p dpkg/$dpkgtype/$oem/usr/lib/$libpath/sane
2023-01-13 09:55:21 +00:00
if [ $? -ne 0 ];then
2023-04-15 05:06:21 +00:00
echo "mkdir sane file fail !!! --->mkdir path dpkg/$dpkgtype/$oem/usr/lib/$libpath/sane"
2023-01-13 09:55:21 +00:00
exit 1
fi
2022-10-12 09:02:49 +00:00
2023-04-15 05:06:21 +00:00
cp release/$syspath/$cpu/libsane-"$sanelibname"sane.so dpkg/$dpkgtype/$oem/usr/lib/$libpath/sane/libsane-"$sanelibname"sane.so.1
2023-01-13 09:55:21 +00:00
if [ $? -ne 0 ];then
2023-01-14 07:46:27 +00:00
echo "copy libsane file fail sane name is :libsane-"$sanelibname"sane.so!!!"
2023-01-13 09:55:21 +00:00
exit 1
2022-10-12 09:02:49 +00:00
fi
2023-04-15 05:06:21 +00:00
#kylin sp1有其他路径无法区分sp1 还是sp版本 ,所以全部进行拷贝即可 kylin mips 特殊处理
if [ "$cpu" == "mips64" ];
then
mkdir -p dpkg/$dpkgtype/$oem/usr/lib/"mips64el-linux-gnuabi64"/sane
if [ $? -ne 0 ];then
echo "mips64el mkdir sane file fail !!!"
exit 1
fi
cp release/$syspath/$cpu/libsane-"$sanelibname"sane.so dpkg/$dpkgtype/$oem/usr/lib/"mips64el-linux-gnuabi64"/sane/libsane-"$sanelibname"sane.so.1
if [ $? -ne 0 ];then
echo "copy libsane file fail sane name is :libsane-"$sanelibname"sane.so!!!"
exit 1
fi
fi
else
echo "del sane file fail"
exit 1
fi
fi
2022-07-29 09:28:21 +00:00
2023-04-15 05:06:21 +00:00
if [ "$oem" == "lscweb" ] || [ "$oem" == "hwweb" ] || [ "$oem" == "hgweb" ] || [ "$oem" == "ctsweb" ] || [ "$oem" == "zjweb" ];
2023-01-14 07:46:27 +00:00
then
2023-03-07 07:10:56 +00:00
cp -rf release/$syspath/$cpu/* dpkg/$dpkgtype/$oem/opt/$dpkgpath/bin
2023-04-15 05:06:21 +00:00
elif [ "$oem" == "hgso" ] || [ "$oem" == "hwso" ] || [ "$oem" == "lscso" ] || [ "$oem" == "ctsso" ] || [ "$oem" == "zjso" ];
2023-01-14 07:46:27 +00:00
then
2023-03-07 07:10:56 +00:00
cp -rf release/$syspath/$cpu/* dpkg/$dpkgtype/$oem/opt/$dpkgpath/lib
cp sdk/include/scannerlib/* dpkg/$dpkgtype/$oem/opt/$dpkgpath/include
2023-01-14 07:46:27 +00:00
elif [ "$oem" == "lscsm" ];
then
2023-03-07 07:10:56 +00:00
cp -rf release/$syspath/$cpu/* dpkg/$dpkgtype/$oem/opt/$dpkgpath
2022-09-30 03:01:17 +00:00
else
2023-02-13 09:12:37 +00:00
#暂时只拷贝立思辰
if [ "$oem" == "lsc" ];
then
if [ ! -d "dpkg/$syspath/$oem/usr/local/lib/sane/" ];
then
mkdir -p "dpkg/$syspath/$oem/usr/local/lib/sane/"
fi
2023-03-07 07:10:56 +00:00
cp release/$syspath/$cpu/libsane-"$sanelibname"sane.so dpkg/$dpkgtype/$oem/usr/local/lib/sane/libsane-"$sanelibname"sane.so.1
2023-02-13 09:12:37 +00:00
fi
2023-03-07 07:10:56 +00:00
savedpkgpath="dpkg/$dpkgtype/$oem/opt/apps/$dpkgpath"
2023-01-14 07:46:27 +00:00
echo $dpkgpath
2023-03-07 07:10:56 +00:00
if [ "$dpkgtype" == "uos" ];
2023-01-13 09:55:21 +00:00
then
#替换uos里面的info 虽然不晓得有啥用
appid='"appid":''"'$dpkgpath'"'','
InfoArch='"arch":[''"'$dpkgarch'"']','
2023-01-13 10:06:50 +00:00
version='"version":''"'$ver'"'','
2023-01-13 09:55:21 +00:00
name='"name":''"'$oem'"'','
2023-01-14 07:46:27 +00:00
sed -i "5s/.*/ $InfoArch/g" "$savedpkgpath/info"
2023-03-07 07:10:56 +00:00
sed -i "2s/.*/ $appid/g" "dpkg/$dpkgtype/$oem/opt/apps/$dpkgpath/info"
sed -i "4s/.*/ $version/g" "dpkg/$dpkgtype/$oem/opt/apps/$dpkgpath/info"
sed -i "3s/.*/ $name/g" "dpkg/$dpkgtype/$oem/opt/apps/$dpkgpath/info"
2023-01-13 09:55:21 +00:00
2023-03-07 07:10:56 +00:00
cp -rf release/$syspath/$cpu/* dpkg/$dpkgtype/$oem/opt/apps/$dpkgpath/files/lib
if [ "$oem" == "hg" ];
then
mv dpkg/$dpkgtype/$oem/opt/apps/$dpkgpath/files/lib/*App dpkg/$dpkgtype/$oem/opt/apps/$dpkgpath/files/bin
fi
2023-06-20 05:46:44 +00:00
mv dpkg/$dpkgtype/$oem/opt/apps/$dpkgpath/files/lib/*OCR dpkg/$dpkgtype/$oem/opt/apps/$dpkgpath/files/bin
if [ "$oem" == "dl" ];
then
mv dpkg/$dpkgtype/$oem/opt/apps/$dpkgpath/files/lib/"DELI SCAN" dpkg/$dpkgtype/$oem/opt/apps/$dpkgpath/files/bin/DELISCAN
else
mv dpkg/$dpkgtype/$oem/opt/apps/$dpkgpath/lib/*Scan dpkg/$dpkgtype/$oem/opt/apps/$dpkgpath/files/bin
fi
2023-04-17 02:18:33 +00:00
2023-06-20 05:46:44 +00:00
2023-01-14 07:46:27 +00:00
if [ $? != 0 ];
then
echo "-----------------cp fail-----------------"
exit 1
fi
2023-01-13 09:55:21 +00:00
2022-09-28 07:15:38 +00:00
else
2023-03-07 07:10:56 +00:00
cp -rf release/$syspath/$cpu/* dpkg/$dpkgtype/$oem/opt/apps/$dpkgpath/lib
if [ "$oem" == "hg" ];
then
mv dpkg/$dpkgtype/$oem/opt/apps/$dpkgpath/lib/*App dpkg/$dpkgtype/$oem/opt/apps/$dpkgpath/bin
fi
2023-06-20 05:46:44 +00:00
mv dpkg/$dpkgtype/$oem/opt/apps/$dpkgpath/lib/*OCR dpkg/$dpkgtype/$oem/opt/apps/$dpkgpath/bin
if [ "$oem" == "dl" ];
then
mv dpkg/$dpkgtype/$oem/opt/apps/$dpkgpath/lib/"DELI SCAN" dpkg/$dpkgtype/$oem/opt/apps/$dpkgpath/bin/DELI SCAN
else
mv dpkg/$dpkgtype/$oem/opt/apps/$dpkgpath/lib/*Scan dpkg/$dpkgtype/$oem/opt/apps/$dpkgpath/bin
fi
2023-04-17 02:27:21 +00:00
2023-01-14 07:46:27 +00:00
if [ $? != 0 ];
then
echo "-----------------cp fail-----------------"
exit 1
fi
2022-07-04 01:48:13 +00:00
fi
2022-08-08 02:10:02 +00:00
fi
2022-07-04 08:31:52 +00:00
2022-07-04 01:48:13 +00:00
chmod 755 dpkg -R
chmod 755 backup -R
2023-03-07 07:10:56 +00:00
if [ -d "backup/$dpkgtype/$oem/$ver" ];
2023-01-13 09:55:21 +00:00
then
2023-03-07 07:10:56 +00:00
rm -rf "backup/$dpkgtype/$oem/$ver"
2022-07-04 01:48:13 +00:00
fi
2023-03-07 07:10:56 +00:00
if [ ! -d "backup/$dpkgtype/$oem/$ver" ];
2023-01-13 09:55:21 +00:00
then
2022-07-04 01:48:13 +00:00
2023-03-07 07:10:56 +00:00
mkdir -p "backup/$dpkgtype/$oem/$ver"
2022-07-04 01:48:13 +00:00
fi
2023-03-07 07:10:56 +00:00
cp -rf dpkg/$dpkgtype/$oem/* backup/$dpkgtype/$oem/$ver
2023-01-14 07:46:27 +00:00
2023-02-03 07:16:26 +00:00
2023-03-07 07:10:56 +00:00
if [ ! -d "backup/dpkg/$dpkgtype/$mainverstr.$minver/$time2/$sanelibname" ];
2023-01-13 09:55:21 +00:00
then
2023-03-07 07:10:56 +00:00
mkdir -p "backup/dpkg/$dpkgtype/$mainverstr.$minver/$time2/$sanelibname/"
2022-11-15 03:27:31 +00:00
fi
2023-01-13 09:55:21 +00:00
2023-03-07 07:10:56 +00:00
dpkg -b backup/$dpkgtype/$oem/$ver backup/dpkg/$dpkgtype/$mainverstr.$minver/$time2/$sanelibname/$dpkgpath"_"$ver"_"$dpkgarch.deb
2022-09-28 09:40:51 +00:00
getismount
2023-01-13 09:55:21 +00:00
if [ $ismount == 0 ];
then
2023-03-07 07:10:56 +00:00
if [ -d "$FIND_FILE/$dpkgtype" ];
2023-01-13 09:55:21 +00:00
then
2023-01-14 07:46:27 +00:00
echo "$(date):mount is succeed and cp dpkg"
2023-03-07 07:10:56 +00:00
echo $password|sudo -S cp -rf backup/dpkg/$dpkgtype/$mainverstr.$minver $FIND_FILE/$dpkgtype
2022-09-28 09:40:51 +00:00
fi
fi