Bug 475228 - RFE: enhancement request -- add '-y' option to run without intervention
RFE: enhancement request -- add '-y' option to run without intervention
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: R2spec (Show other bugs)
rawhide
All Linux
low Severity medium
: ---
: ---
Assigned To: Pierre-YvesChibon
Fedora Extras Quality Assurance
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-12-08 10:46 EST by R P Herrold
Modified: 2008-12-09 09:18 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-12-09 09:18:27 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description R P Herrold 2008-12-08 10:46:10 EST
Description of problem:

The script runs needing user intervention -- this prevents running it unattended, as in a cron process to package new versions which appear on the mirrors 

This is the offending text:

Do you want to move the source (Bchron_2.1.tar.gz) in /home/herrold/rpmbuild/SOURCES/? Y/N [Y]


Version-Release number of selected component (if applicable):

R2spec-2.5.1-6orc

How reproducible:

run the script and see that it needs interaction

Steps to Reproduce:

as above
  
Actual results:

as above

Expected results:

Adding an option '-y' to answer questions 'yes' as does 'yum'  would avoid the need for interaction

Additional info:

Please ask if you have any questions
Comment 1 Pierre-YvesChibon 2008-12-08 10:52:38 EST
Seems good to me and its a easy fix

Watch out that :
-Y
=> If the spec is already present that will overwrite it
=> Will copy the sources into the appropriate folder

What about a -c --copySource option instead ?

----------
BTW should it remove the ./source.tar.gz ?
IE :
Do you want to copy ?
if Yes:
  Copy file toFolder
  rm file


PS Would you mind put the RFE on the r2spec website directly I should receive the emails directly
Comment 2 R P Herrold 2008-12-08 12:30:22 EST
I wrote a couple of workaround acripts .. shell and expect, to bypass the issue temporarily:

[herrold@centos-5 R-packages]$ cat README ; \
     echo "=======================" ; \
     cat script.exp.template
#!/bin/sh
#
#       get all R project packages
QUIET="-q "
#
for i in ` lynx -dump http://cran.r-project.org/web/packages/ | \
        grep "packages" | awk {'print $2'} | grep ""index.html$` ; do
        for j in `lynx -dump $i  | grep z$ | grep src | awk {'print $2'} `; do
        BAS=`basename $j`
        [ ! -e $BAS ] && {
                URL=`echo "$i "`
                wget $QUIET $j
                }
        [ -e $BAS -a "x${URL}" != "x" ] && {
                TGT=`echo "$BAS" | awk -F_ {'print $1'}`
                SRCS=`echo "$j "`
#
#       clean up from any prior run, successful or not
                [ -e R-${TGT}.spec ] && rm -f R-${TGT}.spec
                [ -d tmp ] && rm -rf tmp
#
#               R2spec --cran -s ${BAS}
        sed -e "s#@SOURCE@#${BAS}#g" < script.exp.template > ${TGT}.expect
                chmod 755 ${TGT}.expect
                ./${TGT}.expect
                }
#
#       post run cleanup
        touch index.html
        rm -f index.html*
        done
done
#

=======================
#!/usr/bin/expect -f
#       from autoexpect

set force_conservative 0  ;# set to 1 to force conservative mode even if

set timeout -1
spawn R2spec --cran -s @SOURCE@
match_max 100000
expect -exact "/SOURCES/? Y/N \[Y\]\r
"
send -- "\r"
expect eof
[herrold@centos-5 R-packages]$
Comment 3 Pierre-YvesChibon 2008-12-08 12:32:03 EST
https://fedorahosted.org/r2spec/browser/devel/CHANGELOG
Comment 4 R P Herrold 2008-12-08 12:39:56 EST
as to options

either way is fine ... sp long as it is documented, and permits scripting for
hands off use, I am happy;  the other places which shoulod be converted to
options them becmoe the 'n (name) and -e (email) , and -a (archive) target
(BIOC v CRAN) 

... I package and build everything as non-root of course, and and dislike
needing to ask an end user to have to contact a root level priv person --- some
sites to not like such interaction ;( 

====================

copy of mv ... either way ... I would tend to NOT have the default mv, as it
may confuse other processes ... like the one I pasted a moment ago -- it would
unnecessarily re-download a tarball it already had, if mv were a default

Also   and rpmbuild -ba (spec) will carry the tarball inside the resulting SRPM
it makes;  managing ~/rpmbuild/SOURCES/ and ~rpmbuild/SRPMS/ are out of scope
for R2spec, as I see it.

====================

as to the PS as to RFE's only ... I would strongly prefer to have a central
place for working on packages ... the Red Hat bugzilla has many hundreds of
bugs reported by me over the years, and having to remember a exception for just
a specific package is troublesome.

If email addresses used for you by Bugzilla for packaged you maintain are a
problem, why not alter the email address it uses to one you prefer?  That way
one change one place one time fixes everything.

-- Russ herrold
Comment 5 Pierre-YvesChibon 2008-12-08 12:50:23 EST
(In reply to comment #4)
> as to options
> 
> either way is fine ... sp long as it is documented, and permits scripting for
> hands off use, I am happy;  the other places which shoulod be converted to
> options them becmoe the 'n (name) and -e (email) , and -a (archive) target
> (BIOC v CRAN) 

As you can see from the CHANGELOG I already have implemented the -c/--copyFile.
It would indeed make sense to have also as option the email, the name and I would keep the --cran/--bioc because then I can use --bioc=Version

> 
> ... I package and build everything as non-root of course, and and dislike
> needing to ask an end user to have to contact a root level priv person --- some sites to not like such interaction ;( 

I am not sure what you mean here :/
(sorry about that)
> 
> ====================
> 
> copy of mv ... either way ... I would tend to NOT have the default mv, as it
> may confuse other processes ... like the one I pasted a moment ago -- it would
> unnecessarily re-download a tarball it already had, if mv were a default
> 
> Also   and rpmbuild -ba (spec) will carry the tarball inside the resulting SRPM
> it makes;  managing ~/rpmbuild/SOURCES/ and ~rpmbuild/SRPMS/ are out of scope
> for R2spec, as I see it.

Indeed, then I'd rather let it copy the source rather than move them :)
> 
> ====================
> 
> as to the PS as to RFE's only ... I would strongly prefer to have a central
> place for working on packages ... the Red Hat bugzilla has many hundreds of
> bugs reported by me over the years, and having to remember a exception for just
> a specific package is troublesome.
> 
> If email addresses used for you by Bugzilla for packaged you maintain are a
> problem, why not alter the email address it uses to one you prefer?  That way
> one change one place one time fixes everything.

I was not an issue of the email address but more a way for me to also keep things together, but it does not really matter
Let's stay here I am also fine with that :)
Comment 6 Pierre-YvesChibon 2008-12-08 13:23:41 EST
Options -n and -e implemented
https://fedorahosted.org/r2spec/browser/devel/CHANGELOG
Comment 7 R P Herrold 2008-12-08 14:07:13 EST
> It was not an issue of the email address but more a way for me to also keep
> things together, but it does not really matter
> Let's stay here I am also fine with that :)

Thank you
Comment 8 john5342 2008-12-08 20:28:44 EST
This bug has been triaged

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