songbird wrote:

  ok, figured the four that are missing and generating
null file names are local or obsolete packages that i
have installed...  that i can work around.

  new version of script (with some simple changes to
make things go faster and to make it more flexible
for other uses):

=====
#!/bin/sh
#
#

debarch="/archive/debian/jessie"
dest="/var/cache/apt/archives"

pkglist=`dpkg -l | egrep '^ii  ' | cut --delimiter=' ' -f3,3 | cut 
--delimiter=':' -f1,1`
versionlist=`dpkg -l | egrep '^ii  ' | sed -e 's/  */ /g' | cut -d ' ' -f3,3`

for pkgname in $pkglist; do
  version=`echo $versionlist | cut -d ' ' -f1,1`
  versionlist=`echo $versionlist | cut -d ' ' -f2-`
  debname=`apt-cache show $pkgname=$version | egrep '^Filename: ' | sed -e 
's/^Filename: //' | awk --field-separator='/' -e '{print \$NF}'`

  if test -e "$debarch/$debname" ; then

    echo "$debarch/$debname $dest" > /dev/null
    if test ! -e "$dest/$debname" ; then
      cp -a "$debarch/$debname" $dest
    fi

  else 
    echo "$debname missing?  version ->$version<-"
  fi

done
chown root $dest/*
chgrp root $dest/*
sync


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/umkm9b-nba....@id-306963.user.uni-berlin.de

Reply via email to