On 15:19 Fri 23 Mar     , daniel g. siegel wrote:
> thanks for sharing!
> 
> maybe you could put here the new version? also in integration in pacman
> (maybe gensync would be better) would be nice!

My script was buggy with some $pkgver, here is the new version (thanks
to Daniel for the bug-report):

---------------8<-----------------------8<---------------------8<------
#!/bin/bash
# repo-cleaner
# If you use pacman-2.x remove "-i686" where occurs,
# if you use x86_64 packages and pacman3, replace -i686 with -x86_64

REPO_DIR=~/packages
REPO_NAME=abj
PKGBUILDS_DIR=/var/abs/local

cd $REPO_DIR
count_rm=0
count_all=0
mkdir -p XXX
for pack in `ls -v *-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 

echo -n "REMOVED ${count_rm}/${count_all} PACKAGES"
echo " ( -" `ls -sh1 XXX | awk '{ print $2 }' | head -1` ")"
rm -fr XXX/
gensync $PKGBUILDS_DIR $REPO_DIR/$REPO_NAME.db.tar.gz $REPO_DIR/
---------------8<-----------------------8<---------------------8<------

Feel free to improve it.

-- 
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