分享一个deb打包解包脚本,方便解决依赖不满足等问题
Tofloor
poster avatar
liyujiang
deepin
2016-09-10 07:34
Author
打包脚本:buildDeb.sh
#!/bin/bash
echo -e "当前目录:`pwd`\n\n"
arr=()
i=0
for dir in *; do
  if test -d $dir; then
    echo "${i}、${dir}"
    arr[$i]=$dir
    i=`expr $i + 1`
  fi
done
echo -e -n "\n打包,请输入deb目录序号:"
read INDEX
DEB_DIR=${arr[$INDEX]}
chmod -R 755 ${DEB_DIR}/DEBIAN
echo "即将打包为:${DEB_DIR}.deb"
dpkg-deb --build ${DEB_DIR}
echo "打包结束"
echo -e "\n\n按回车键退出(Enter)"
read -n1

解包脚本:extractDeb.sh
#!/bin/bash
echo -e "当前目录:`pwd`\n\n"
arr=()
i=0
for file in *.deb; do
  if test -f $file; then
    echo "${i}、${file}"
    arr[$i]=$file
    i=`expr $i + 1`
  fi
done
echo -e -n "\n解包,请输入deb文件序号:"
read INDEX
DEB_NAME=${arr[$INDEX]}
echo "即将解包到:${DEB_NAME/.deb/}"
dpkg-deb --extract ${DEB_NAME} ${DEB_NAME/.deb/}
echo "解包结束"
echo -e "\n\n按回车键退出(Enter)"
read -n1





Reply Favorite View the author
All Replies

No replies yet