summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhishek Dasgupta <abhidg@gmail.com>2009-03-20 23:52:14 +0530
committerAbhishek Dasgupta <abhidg@gmail.com>2009-03-20 23:52:51 +0530
commit0959e8914c08042b1a8d1227c33f4ec77ea827f6 (patch)
tree0ff4cba76955f0c1989640a666aabb2ce40f121e
parent67e112955482397bae1971fa60e1634a92ec361c (diff)
ftpdir-cleanup: remove arch-independent packages
Removes architecture independent packages which are not symlinked in any of the architecture repositories.
-rwxr-xr-xmisc-scripts/ftpdir-cleanup26
1 files changed, 25 insertions, 1 deletions
diff --git a/misc-scripts/ftpdir-cleanup b/misc-scripts/ftpdir-cleanup
index 2b91035..ed90437 100755
--- a/misc-scripts/ftpdir-cleanup
+++ b/misc-scripts/ftpdir-cleanup
@@ -10,6 +10,7 @@ arch=$2
##### Arch specific stuff. TODO make this configurable #####
ftppath="/srv/ftp/$reponame/os/$arch/"
+ftppath_base="/srv/ftp/$reponame/os"
############################################################
if [ ! -d "$ftppath" ]; then
@@ -78,11 +79,18 @@ for pkg in *$PKGEXT; do
EXTRAFILES="$EXTRAFILES $pkg"
done
+cd "$ftppath_base/any"
+for pkg in *$PKGEXT; do
+ if [ ! -h $ftppath_base/i686/$pkg && ! -h $ftppath_base/x86_64/$pkg ]; then
+ ARCHINDEPFILES="$ARCHINDEPFILES $pkg"
+ fi
+done
+
cd "$ftppath"
rm -rf ${TMPDIR}
#Make sure we've done *something* before outputting anything
-if [ -z "$DELETEFILES$MISSINGFILES$EXTRAFILES" ]; then
+if [ -z "$DELETEFILES$MISSINGFILES$EXTRAFILES$ARCHINDEPFILES" ]; then
exit 0
fi
@@ -113,6 +121,15 @@ if [ -n "$EXTRAFILES" ]; then
done
fi
+if [ -n "$ARCHINDEPFILES" ]; then
+ echo " The following architecture independent packages"
+ echo " are not symlinked in the architecture repositories."
+ echo " They will be moved to /srv/package/cleanup"
+ for f in $ARCHINDEPFILES; do
+ echo " $f"
+ done
+fi
+
if [ -n "${DELETEFILES}" ]; then
mv ${DELETEFILES} /srv/package-cleanup/
echo ""
@@ -122,3 +139,10 @@ if [ -n "${EXTRAFILES}" ]; then
mv ${EXTRAFILES} /srv/package-cleanup/
echo ""
fi
+
+cd "$ftppath_base/any"
+if [ -n "${ARCHINDEPFILES}" ]; then
+ mv ${ARCHINDEPFILES} /srv/package-cleanup/
+ echo ""
+fi
+