Bug 5652 - Handle single SRC.RPM's as well as entire directories
Summary: Handle single SRC.RPM's as well as entire directories
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: sisyphus_check (show other bugs)
Version: unstable
Hardware: all Linux
: P2 enhancement
Assignee: Dmitry V. Levin
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-09 01:52 MSK by evseev
Modified: 2005-09-29 13:43 MSD (History)
7 users (show)

See Also:


Attachments
This patch allows processing of separate packages as well as entire directories (1.03 KB, patch)
2004-12-15 09:15 MSK, evseev
no flags Details | Diff
The same idea in new implementation ;-) (1015 bytes, patch)
2005-04-11 15:14 MSD, evseev
no flags Details | Diff
bugfix'd version of previous patch (1.15 KB, patch)
2005-04-12 20:39 MSD, evseev
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description evseev 2004-12-09 01:52:33 MSK
This patch allows checking of separate RPM's, and should be useful
for ordinal mantainers who sends single package at once.
===================================================
--- /usr/bin/sisyphus_check.orig        2004-07-15 23:45:35 +0400
+++ /usr/bin/sisyphus_check     2004-12-09 01:40:20 +0300
@@ -424,16 +424,22 @@
        # quick arg check.
        local d
        for d in "$@"; do
-               [ -d "$d" ] || { FileError "$d: not a directory"; rc=1; 
continue; }
+               [ -d "$d" ] && continue
+               [ -f "$d" ] || { FileError "$d: not a directory nor regular 
file"; rc=
1; continue; }
+               case "$d" in
+                       *.src.rpm ) continue ;;
+               esac
+               FileError "$d: regular file but not source RPM"; 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; }
+               [ -d "$d" -o -f "$d" ] || { FileError "$d: not a directory nor 
regular file"; rc=1; continue; }
                local f
                for f in "$d"/*.rpm; do
+                       [ -f "$d" ] && f="$d"
                        if [ ! -f "$f" ]; then
                                [ "$f" != "$d/*.rpm" ] || continue
                                FileError "not a regular file" "$f"
@@ -601,6 +607,8 @@
                                rc=1
                                [ -z "$fast_check" ] || continue
                        fi
+
+                       [ "$f" = "$d" ] && break
                done
        done

Steps to Reproduce:
1. sisyphus_check my.src.rpm && echo Ok || echo Bad
Actual Results:  
ERROR: my.src.rpm: not a directory
Bad

Expected Results:  
Ok
Comment 1 Alexey Gladkov 2004-12-09 14:44:12 MSK
Please, create new attachment for your patch.
Comment 2 evseev 2004-12-15 09:15:01 MSK
Created attachment 668 [details]
This patch allows processing of separate packages as well as entire directories
Comment 3 evseev 2005-04-11 15:14:01 MSD
Created attachment 803 [details]
The same idea in new implementation ;-)

Теперь в командной строке можно указывать как каталоги, так и отдельные
RPM-файлы. Удобно для тех, кто собирает и проверяет пакеты поштучно. Предыдущий
патч разрешал указывать только src.rpm, но ругался на бинарные. Теперь
допустимы и те, и те :-)))
Comment 4 evseev 2005-04-12 20:39:50 MSD
Created attachment 807 [details]
bugfix'd version of previous patch

Предыдущая версия патча содержала крошечную ошибку - полностью игнорировала
RPM-файлы ;-((( Исправлено.
Comment 5 Dmitry V. Levin 2005-05-12 17:20:59 MSD
I'll implement it but in different way.
Comment 6 Michael Shigorin 2005-05-12 17:22:15 MSD
"I did it myyyyyy waaaaaay" (c) Frank Sinatra

ииии? :)
Comment 7 Dmitry V. Levin 2005-05-12 20:54:23 MSD
Implemented in sisyphus_check-0.7.12-alt1