--- /usr/bin/sisyphus_check.orig 2004-12-29 14:33:43 +0300 +++ /usr/bin/sisyphus_check 2005-04-12 15:38:09 +0400 @@ -484,6 +484,16 @@ packager_pattern='<[^@]+(@| at )(packages\.)?altlinux(\.| dot )(com|net|org|ru)>' } +is_valid_filenametype() +{ + test -d "$1" && return 0 + case "$1" in + *.rpm ) test -f "$1" && return 0 ;; + esac + FileError "$1 is either not directory nor regular RPM file" + return 1 +} + fast_check= # cummulative check check() @@ -493,16 +503,18 @@ # quick arg check. local d for d in "$@"; do - [ -d "$d" ] || { FileError "$d: not a directory"; rc=1; continue; } + is_valid_filenametype "$d" || { rc=1; continue; } done [ $rc = 0 ] || return $rc init_check || Fatal "init_check failed." for d in "$@"; do - [ -d "$d" ] || { FileError "$d: not a directory"; rc=1; continue; } + is_valid_filenametype "$d" || { rc=1; continue; } local filelist f - if [ -n "$recurse_subdir" ]; then + if [ ! -d "$d" ]; then + filelist="$d" + elif [ -n "$recurse_subdir" ]; then filelist="$(find "$d" -mindepth 1 -not -type d)" || { rc=1; continue; } else filelist="$(find "$d" -mindepth 1 -maxdepth 1)" || { rc=1; continue; }