On 22:53 Wed 21 Mar     , daniel g. siegel wrote:
> hello there!
> 
> i just asked quite a few times around, but nobody knew the answer to
> this question: how can i remove the old packages from my local
> repository? (i dont mean my cache, but the repo i create by using
> gensync)
> i couldnt find some information in the pacman-doc, or did i simply
> overlook something?
> 
> best regards,
> 
I wrote this simple script:

----------8<---------------------8<-------------------8<-------------

#!/bin/bash
REPO_DIR=~/packages
cd $REPO_DIR
count_rm=0
count_all=0
for pack in *-i686.pkg.tar.gz; do {
   pkgname=${pack%-*-*-i686.pkg.tar.gz}
   if [[ ${p_pkgname} == ${pkgname} ]]; then
      mv ${p_pack} XXX${p_pack}
      let count_rm++
   fi
   let count_all++
   p_pack=${pack}
   p_pkgname=${pkgname}
} done 

rm -f XXX*
echo "REMOVED ${count_rm}/${count_all} PACKAGES"

----------8<---------------------8<-------------------8<-------------

-- 
Alessio 'mOLOk' Bolognino
Arch Linux Trusted User
http://www.archlinux.org


_______________________________________________
arch mailing list
[email protected]
http://www.archlinux.org/mailman/listinfo/arch

Reply via email to