Contents of /trunk/pkgtools/remove-stale-md5.sh
Parent Directory | Revision Log
Revision 610 -
(show annotations)
(download)
(as text)
Sun Nov 11 23:40:52 2007 UTC (16 years, 10 months ago) by niro
File MIME type: application/x-sh
File size: 534 byte(s)
Sun Nov 11 23:40:52 2007 UTC (16 years, 10 months ago) by niro
File MIME type: application/x-sh
File size: 534 byte(s)
-added some pkgtools
1 | #!/bin/bash |
2 | # removes stale md5sums from cvs |
3 | |
4 | CVS_REPO="$1" |
5 | |
6 | if [[ -z ${CVS_REPO} ]] |
7 | then |
8 | echo "No cvs repo given!" |
9 | exit 1 |
10 | fi |
11 | |
12 | if [[ ! -d ${CVS_REPO} ]] |
13 | then |
14 | echo "Given cvs repo is not a directory!" |
15 | exit 1 |
16 | fi |
17 | |
18 | pushd ${CVS_REPO} |
19 | for file in $(find . -maxdepth 3 -type f -name '*'.md5) |
20 | do |
21 | md5name="$(basename ${file})" |
22 | smagename="${md5name/.md5/.smage2}" |
23 | smagedirname="$(dirname ${file/\/md5/})" |
24 | |
25 | if [[ ! -f ${smagedirname}/${smagename} ]] |
26 | then |
27 | echo "Deleting ${md5name} ..." |
28 | rm ${file} |
29 | cvs delete ${file} |
30 | fi |
31 | done |
32 | popd |