Browse Source

Moved the search of lingering files on `sde cleanup` to sde-cleanup-linger

karasz/new-early
Alejandro Mery 17 years ago
parent
commit
66cff79447
2 changed files with 73 additions and 44 deletions
  1. +1
    -44
      bin/sde-cleanup
  2. +72
    -0
      bin/sde-cleanup-linger

+ 1
- 44
bin/sde-cleanup

@ -135,47 +135,4 @@ done
echo -e "\nUse '$0 -build' to remove builds and '$0 -cache'
to also flush the cache."
[ "$nocheck" = 1 ] && exit 0
echo -e "\nSearching for lingering temp/backup files (this may take some time) ..."
sderootdirs="scripts/. bin/. etc/. lib/. doc/. src/. package/. architecture/. target/."
# Remove temp/backup files
#
$SDEROOT/bin/find $sderootdirs -type f \( -name '*~' -o \
-name 'a.out' -o -name 'core.*' -o -name 'core' \) | xargs rm -vf
# Print warnings for 'lingering' files
# (we have to distinguish between the targets and the rest)
#
sderootdirs=${sderootdirs% target/.}
$SDEROOT/bin/find ${sderootdirs} \( \
\( -name 'DEADJOE' -o -name '*-[xX]' -o -name '.[^.]*' \
-o -name '*.orig' -o -name '*.rej' -o -name '*#*' \
-o -name '*.mine' -o -name '*.r[1-9][0-9]*' \
-o -name TRANS.TBL -o -name '*.cksum-err' -o -name x \
-o -name '*[.-]old' -o -name a.out -o -name '*~' \
-o -name '*.incomplete' -o -name '*.ckext-err' \) \
-printf 'WARNING: Found %p\n' \
\) -o \( \
\( ! -type d ! -type f \) \
-printf 'WARNING: Neither a dir nor a regular file: %p\n' \
\)
# for targets we tolerate .files
$SDEROOT/bin/find target/. \
\( \
\( -name 'DEADJOE' -o -name '*-[xX]' \
-o -name '*.orig' -o -name '*.rej' -o -name '*#*' \
-o -name '*.mine' -o -name '*.r[1-9][0-9]*' \
-o -name TRANS.TBL -o -name '*.cksum-err' -o -name x \
-o -name '*[.-]old' -o -name a.out -o -name '*~' \
-o -name '*.incomplete' -o -name '*.ckext-err' \) \
-printf 'WARNING: Found %p\n' \
\) -o \( \
\( ! -type d ! -type f \) \
-printf 'WARNING: Neither a dir nor a regular file: %p\n' \
\)
exit 0
[ "$nocheck" = 1 ] || exec $SDEROOT/bin/sde-clean-linger

+ 72
- 0
bin/sde-cleanup-linger

@ -0,0 +1,72 @@
#!/bin/sh
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: bin/sde-cleanup-linger
# Copyright (C) 2006 - 2008 The OpenSDE Project
# Copyright (C) 2004 - 2006 The T2 SDE Project
# Copyright (C) 1998 - 2003 Clifford Wolf
#
# More information can be found in the files COPYING and README.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License. A copy of the
# GNU General Public License can be found in the file COPYING.
# --- SDE-COPYRIGHT-NOTE-END ---
#Description: Removes temp files and search for lingering files
#Alias: lingering
[ -n "$SDEROOT" ] ||
export SDEROOT=$( cd "${0%/*}/.."; pwd -P )
. $SDEROOT/lib/libsde.in
if [ $# -ne 0 ]; then
echo "Usage: sde cleanup linger"
exit 1
fi
echo "Searching for lingering temp/backup files (this may take some time) ..."
sderootdirs="scripts/. bin/. etc/. lib/. doc/. src/. package/. architecture/. target/."
# Remove temp/backup files
#
$SDEROOT/bin/find $sderootdirs -type f \( -name '*~' -o \
-name 'a.out' -o -name 'core.*' -o -name 'core' \) | xargs rm -vf
# Print warnings for 'lingering' files
# (we have to distinguish between the targets and the rest)
#
sderootdirs=${sderootdirs% target/.}
$SDEROOT/bin/find ${sderootdirs} \( \
\( -name 'DEADJOE' -o -name '*-[xX]' -o -name '.[^.]*' \
-o -name '*.orig' -o -name '*.rej' -o -name '*#*' \
-o -name '*.mine' -o -name '*.r[1-9][0-9]*' \
-o -name TRANS.TBL -o -name '*.cksum-err' -o -name x \
-o -name '*[.-]old' -o -name a.out -o -name '*~' \
-o -name '*.incomplete' -o -name '*.ckext-err' \) \
-printf 'WARNING: Found %p\n' \
\) -o \( \
\( ! -type d ! -type f \) \
-printf 'WARNING: Neither a dir nor a regular file: %p\n' \
\)
# for targets we tolerate .files
$SDEROOT/bin/find target/. \
\( \
\( -name 'DEADJOE' -o -name '*-[xX]' \
-o -name '*.orig' -o -name '*.rej' -o -name '*#*' \
-o -name '*.mine' -o -name '*.r[1-9][0-9]*' \
-o -name TRANS.TBL -o -name '*.cksum-err' -o -name x \
-o -name '*[.-]old' -o -name a.out -o -name '*~' \
-o -name '*.incomplete' -o -name '*.ckext-err' \) \
-printf 'WARNING: Found %p\n' \
\) -o \( \
\( ! -type d ! -type f \) \
-printf 'WARNING: Neither a dir nor a regular file: %p\n' \
\)
exit 0

Loading…
Cancel
Save