summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Griffin <aaronmgriffin@gmail.com>2009-08-19 01:00:20 +0200
committerAaron Griffin <aaronmgriffin@gmail.com>2009-08-19 01:00:20 +0200
commit37c975929d6a60b21ff9741329bc72e9523f376c (patch)
treeba2474451635187c1bb5b75623c99dd873a8b839
parentae9cf32fbdb54c40c9d0b338368e7cd272590329 (diff)
downloaddbscripts-37c975929d6a60b21ff9741329bc72e9523f376c.tar.gz
dbscripts-37c975929d6a60b21ff9741329bc72e9523f376c.tar.xz
Remove find-dupes script (unused)
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
-rwxr-xr-xmisc-scripts/find-dupes77
1 files changed, 0 insertions, 77 deletions
diff --git a/misc-scripts/find-dupes b/misc-scripts/find-dupes
deleted file mode 100755
index 16bf530..0000000
--- a/misc-scripts/find-dupes
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/bin/bash
-
-if [ $# -ne 2 ]; then
- echo "usage: $(basename $0) <reponame> <arch>"
- exit 1
-fi
-
-reponame=$1
-arch=$2
-
-##### Arch specific stuff. TODO make this configurable #####
-ftppath="/srv/ftp/$reponame/os/$arch/"
-############################################################
-
-if [ ! -d "$ftppath" ]; then
- echo "FTP path '$ftppath' does not exist"
- exit 1
-fi
-
-if [ ! -f /etc/makepkg.conf ]; then
- echo "/etc/makepkg.conf not found! Aborting"
- exit 1
-fi
-
-. /etc/makepkg.conf
-
-cd $ftppath
-
-# Get the package name from the filename
-# hackish, but should work for now
-getpkgname() {
- local tmp
-
- tmp=${1##*/}
- tmp=${tmp%$PKGEXT}
- tmp=${tmp%-$CARCH}
- echo ${tmp%-*-*}
-}
-
-showdupes() {
- done=""
- for i in *${PKGEXT}; do
- pkgname=$(getpkgname $i)
- if [ "$pkgname" = "$1" ]; then
- lastmod="$(stat -c %y $i | cut -d. -f1)"
- fname="$(basename $i)"
-
- echo "$lastmod $fname"
-
- done=1
- else
- if [ "$done" = "1" ]; then
- return
- fi
- fi
- done
-}
-
-echo "Scanning for duplicate packages in '$reponame' ($arch)"
-DUPES=""
-lastpkg=""
-
-for pkg in *${PKGEXT}; do
- pkgname="$(getpkgname $pkg)"
- if [ "$lastpkg" = "$pkgname" ]; then
- DUPES="$DUPES $pkgname"
- fi
- lastpkg=$pkgname
-done
-
-if [ "$DUPES" ]; then
- DUPES="$(echo $DUPES | sed 's| |\n|g' | sort -u)"
- echo "Date Filename"
- for dupe in $DUPES; do
- showdupes $dupe
- done
-fi