|
Lines 484-489
Link Here
|
| 484 |
packager_pattern='<[^@]+(@| at )(packages\.)?altlinux(\.| dot )(com|net|org|ru)>' |
484 |
packager_pattern='<[^@]+(@| at )(packages\.)?altlinux(\.| dot )(com|net|org|ru)>' |
| 485 |
} |
485 |
} |
| 486 |
|
486 |
|
|
|
487 |
is_valid_filenametype() |
| 488 |
{ |
| 489 |
test -d "$1" && return 0 |
| 490 |
case "$1" in |
| 491 |
*.rpm ) test -f "$1" && return 0 ;; |
| 492 |
esac |
| 493 |
FileError "$1 is either not directory nor regular RPM file" |
| 494 |
return 1 |
| 495 |
} |
| 496 |
|
| 487 |
fast_check= |
497 |
fast_check= |
| 488 |
# cummulative check |
498 |
# cummulative check |
| 489 |
check() |
499 |
check() |
|
Lines 493-508
Link Here
|
| 493 |
# quick arg check. |
503 |
# quick arg check. |
| 494 |
local d |
504 |
local d |
| 495 |
for d in "$@"; do |
505 |
for d in "$@"; do |
| 496 |
[ -d "$d" ] || { FileError "$d: not a directory"; rc=1; continue; } |
506 |
is_valid_filenametype "$d" || { rc=1; continue; } |
| 497 |
done |
507 |
done |
| 498 |
[ $rc = 0 ] || return $rc |
508 |
[ $rc = 0 ] || return $rc |
| 499 |
|
509 |
|
| 500 |
init_check || Fatal "init_check failed." |
510 |
init_check || Fatal "init_check failed." |
| 501 |
|
511 |
|
| 502 |
for d in "$@"; do |
512 |
for d in "$@"; do |
| 503 |
[ -d "$d" ] || { FileError "$d: not a directory"; rc=1; continue; } |
513 |
is_valid_filenametype "$d" || { rc=1; continue; } |
| 504 |
local filelist f |
514 |
local filelist f |
| 505 |
if [ -n "$recurse_subdir" ]; then |
515 |
if [ ! -d "$d" ]; then |
|
|
516 |
filelist="$d" |
| 517 |
elif [ -n "$recurse_subdir" ]; then |
| 506 |
filelist="$(find "$d" -mindepth 1 -not -type d)" || { rc=1; continue; } |
518 |
filelist="$(find "$d" -mindepth 1 -not -type d)" || { rc=1; continue; } |
| 507 |
else |
519 |
else |
| 508 |
filelist="$(find "$d" -mindepth 1 -maxdepth 1)" || { rc=1; continue; } |
520 |
filelist="$(find "$d" -mindepth 1 -maxdepth 1)" || { rc=1; continue; } |