Bug 5652 - Handle single SRC.RPM's as well as entire directories
: Handle single SRC.RPM's as well as entire directories
Status: CLOSED FIXED
: Sisyphus
(All bugs in Sisyphus/sisyphus_check)
: unstable
: all Linux
: P2 enhancement
Assigned To:
:
:
:
:
:
  Show dependency tree
 
Reported: 2004-12-09 01:52 by
Modified: 2005-09-29 13:43 (History)


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


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2004-12-09 01:52:33
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 From 2004-12-09 14:44:12 -------
Please, create new attachment for your patch.
------- Comment #2 From 2004-12-15 09:15:01 -------
Created an attachment (id=668) [details]
This patch allows processing of separate packages as well as entire directories
------- Comment #3 From 2005-04-11 15:14:01 -------
Created an attachment (id=803) [details]
The same idea in new implementation ;-)

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

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

ииии? :)
------- Comment #7 From 2005-05-12 20:54:23 -------
Implemented in sisyphus_check-0.7.12-alt1