summaryrefslogtreecommitdiffstats
path: root/build_tools/bin/repo-cleanup.sh
diff options
context:
space:
mode:
authorCecil Hugh Watson <knoppmyth@gmail.com>2010-01-04 15:55:21 (GMT)
committerCecil Hugh Watson <knoppmyth@gmail.com>2010-01-04 15:55:21 (GMT)
commit51486c041c85bbfb9a946e4711845c682d89c8f4 (patch)
treeac4514c0a76c312266734f96a05034c4d2469f87 /build_tools/bin/repo-cleanup.sh
parent1aeb0dc1e0cb97cb568d9cb554380cc2dc2a8e42 (diff)
parent1978b7ecea22e67fc13234f3622293cf0b807174 (diff)
downloadlinhes_dev-51486c041c85bbfb9a946e4711845c682d89c8f4.zip
Merge branch 'HEAD' of ssh://cesman@knoppmyth.net/mount/repository/LinHES-dev
Diffstat (limited to 'build_tools/bin/repo-cleanup.sh')
-rwxr-xr-xbuild_tools/bin/repo-cleanup.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/build_tools/bin/repo-cleanup.sh b/build_tools/bin/repo-cleanup.sh
new file mode 100755
index 0000000..bb4c369
--- /dev/null
+++ b/build_tools/bin/repo-cleanup.sh
@@ -0,0 +1,28 @@
+#!/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.gz|sed -e "s/-i686.pkg.tar.gz//" > /tmp/pkglist-$currentrepo
+cd - > /dev/null
+if [ ! -e /tmp/$currentrepo_dups ]
+then
+ mkdir /tmp/$currentrepo_dups/
+fi
+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.gz /tmp/$currentrepo_dups/
+ fi
+done < /tmp/pkglist-$currentrepo
+