Bug 961574

Summary: spectool fail to rerieve Source file
Product: [Fedora] Fedora Reporter: MERCIER Jonathan <bioinfornatics>
Component: rpmdevtoolsAssignee: Ville Skyttä <ville.skytta>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: a.badger, twoerner, ville.skytta
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-06-29 11:57:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description MERCIER Jonathan 2013-05-10 01:43:27 UTC
sectool -A derelict.spec
return nothing

derelict.spec http://paste.fedoraproject.org/11390/50076136

I think is fail because i do not support advanced style as defined function

Comment 1 Ville Skyttä 2013-05-10 15:40:47 UTC
The "%package %{-n*}" within the add_subpackage macro/function probably confuses spectool. With the approach currently taken by spectool I'm not convinced that it's feasible to try to fix this nor do I personally plan to try it, but I can have a look at patches in case someone else wants to submit some.

Comment 2 MERCIER Jonathan 2013-05-10 15:46:58 UTC
Ok so i wrote in full bash a function to parse spec and store in to an arry sousces files

# Code


declare -x -a sourcesFiles=()

getSourcesFiles () {
    local line sourceFile url key hashValue varValue varName
    local -A variables
    while read line; do
        if [[ "${line}" =~ ^%global[[:blank:]]+([[:alnum:]_]+)[[:blank:]]+([[:alnum:][:punct:]]+) ]]; then
            varName='%{'"${BASH_REMATCH[1]}"'}'
            varValue="${BASH_REMATCH[2]}"
            if [[ "${varValue}" =~ [[:punct:]] ]]; then
                for key in "${!variables[@]}"; do
                        hashValue=${variables["${key}"]}
                    if [[ "${varValue}" =~ "${key}" ]]; then
                        varValue=${varValue//"${key}"/${hashValue}}
                    fi
                done
            fi
            variables["${varName}"]="${varValue}"
        elif [[ "${line}" =~ ^Name:[[:blank:]]+([[:alnum:]]+) ]]; then
            variables['%{name'}]="${BASH_REMATCH[1]}"
        elif [[ "${line}" =~ ^Version:[[:blank:]]+([[:digit:]]+) ]]; then
            variables['%version'}]="${BASH_REMATCH[1]}"
        elif [[ "${line}" =~ ^Patch|Source[[:digit:]]+:[[:blank:]]+([[:alnum:][:punct:]]+) ]]; then
            url="${BASH_REMATCH[1]}"
            if [[ "${url}" =~ ^http|ftp ]]; then
                sourceFile="${url##*/}"
            else
                sourceFile="${url}"
            fi
            for key in "${!variables[@]}"; do
                sourceFile=${sourceFile//"${key}"/${variables["${key}"]}}
            done
            sourcesFiles+=( "${sourceFile}" )  
        fi
    done < "${specFile}"
    [[ ${#sourcesFiles} -ne 0 ]] || die ${LINENO} 'sources files List is epmty' 1
}

Comment 3 MERCIER Jonathan 2013-05-10 15:53:42 UTC
note specFile var should be setted

The code is too help people in same cases

Comment 4 Fedora End Of Life 2013-09-16 13:51:16 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 20 development cycle.
Changing version to '20'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora20

Comment 5 Fedora End Of Life 2015-05-29 09:03:06 UTC
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '20'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 6 Ville Skyttä 2015-05-30 07:05:43 UTC
Looks like the fpaste from initial comment is gone, and derelict.spec in packages git does not contain any source URLs. Unless a reproducer reappears, I'm going to let this bug go autoclosed.

Comment 7 Fedora End Of Life 2015-06-29 11:57:03 UTC
Fedora 20 changed to end-of-life (EOL) status on 2015-06-23. Fedora 20 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.