Bug 783846

Summary: y2tool sample .pm invalid return values
Product: [openSUSE] openSUSE 12.1 Reporter: Jack Thomasson <jkt>
Component: YaST2Assignee: Martin Vidner <mvidner>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P5 - None CC: jkt, locilka, snwint, suse-beta
Version: Final   
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE 12.1   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Jack Thomasson 2012-10-06 14:47:22 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1

according to ycp(3pm):
To send a list, call Return(\@list), not Return(@list). Similarly for a map. You can use references to anonymous lists [] and hashes {}.

in particular, sample functions Summary and Overview return lists instead of references.

Reproducible: Always

Steps to Reproduce:
1.y2tool create-new-package config y2pm 'Jack Thomasson' 'jkt@moonlitsw.com'
2.cd y2pm/src
3.mv Y2pm2.pm Y2pm.pm
4.sed -e 's/Y2pm2.*/Y2pm.pm/' -e '/Y2pm.ycp/d' -e '/Y2pm3/d' -i Makefile.am 
5.cd ..
6.make -f Makefile.cvs
7.make
8.sudo make install
9.sudo Y2DEBUG=1 /sbin/yast2 y2pm


Actual Results:  
a dialog box containing:

UI Syntax Error
Invalid arguments for the Table widget
Check the log file!

Expected Results:  
operate without error

change () to [] in these functions.

the man page should probably read,

You can use [] and {} to produce references to anonymous lists and hashes.

or,

You can produce references to anonymous lists with [] and hashes with {}.
Comment 2 Martin Vidner 2012-10-08 15:00:26 UTC
Thanks for the report!
The fixes are in the review queue:
https://github.com/yast/yast-devtools/pull/3
https://github.com/yast/yast-core/pull/8
Comment 3 Martin Vidner 2014-05-12 15:10:57 UTC
yast-core PR got merged, but the Perl skeleton code meanwhile got dropped, as we converted YaST YCP to Ruby anyway.