s243a

Cp_dpkg_info

Jul 28th, 2018
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.60 KB | None | 0 0
  1. #/bin/bash
  2. d_INFO=/var/lib/dpkg/info
  3. ReadDir(){
  4.   while read aList; do
  5.     if [ 0 -lt `dirHas $2 $1` ];then
  6.         echo $MACHED_PACKAGE | WriteInfo
  7.     fi
  8.   done <<EOF
  9.      `ls $1`
  10.   EOF  
  11. }
  12. dirHas(){
  13.     DIR=$1
  14.     FILE=$2
  15.     while read file_i; do
  16.        
  17.     done <<EOF
  18.       `ls $1`
  19.     EOF
  20. }
  21. WriteInfo(){
  22.     while read arg_i; do
  23.         BN=`basename $arg_i`
  24.         case $BN
  25.         control)
  26.           echo '' >> $d_INFO
  27.           cat arg_i >>$d_info
  28.           ;;
  29.         *.deb)
  30.             echo '' >> $d_INFO
  31.             dpkg-deb -f $arg_i >>$d_info
  32.         esac
  33.     done
  34. }
Add Comment
Please, Sign In to add comment