summaryrefslogtreecommitdiffstats
path: root/build_tools/bin/repo-cleanup.sh
blob: ed6c140672a2f349b6b4a7938b4d17bd4d605918 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
currentrepo=$1
echo $currentrepo
if [ x$currentrepo = "x" ]
then
	echo "./repo_cleanup.sh $repo [core,core-testing,extra,extra-testing]"
	exit 1
fi
REPO=/data/pkg_repo/i686/$currentrepo
pacman -Sl $repo |cut -d" " -f 2- |tr " " - > /tmp/$currentrepo-list
cd $REPO >/dev/null
ls *-i686.pkg.tar.xz|sed -e "s/-i686.pkg.*$//" > /tmp/pkglist-$currentrepo
cd - > /dev/null
if [ ! -e /tmp/$currentrepo_dups ] 
then
	mkdir /tmp/$currentrepo_dups/
fi
echo $REPO
while read LINE
do
#	echo $LINE
	grep -q $LINE /tmp/$currentrepo-list
	if [   $?  = 1 ]
	then
		echo "removing file $LINE"
#		mv $REPO/$LINE-i686.pkg.tar.xz /tmp/$currentrepo_dups/
	fi	
done < /tmp/pkglist-$currentrepo