Opened 8 years ago

Closed 7 years ago

#1637 closed defect (fixed)

r.pack and fully qualified input

Reported by: martinl Owned by: hamish
Priority: major Milestone: 6.4.3
Component: Raster Version: svn-releasebranch64
Keywords: r.pack Cc: grass-dev@…
CPU: Unspecified Platform: Linux

Description

Recently added r.pack doesn't support fully qualified input maps, e.g.

r.pack input=aspect@PERMANENT
ERROR: No map components found

When copying files the script expects that GIS_OPT_INPUT is not fully qualified name source:grass/branches/releasebranch_6_4/scripts/r.pack/r.pack#L92

91	for ELEMENT in cats cell cellhd colr fcell grid3 hist ; do
92	    if [ -e "$BASEDIR/$ELEMENT/$GIS_OPT_INPUT" ] ; then
93	        cp "$BASEDIR/$ELEMENT/$name" "$TMP_DIR/$ELEMENT"
94	    fi
95	done

One thing related, I would expect that

g.findfile elem=cell file=aspect@PERMANENT

return

name='aspect'
mapset='PERMANENT'
fullname='aspect@PERMANENT'
...

and not

name='aspect@PERMANENT'
mapset='PERMANENT'
fullname='aspect@PERMANENT'
...

In the case that g.findfile would return not fully-qualified name we could simply reuse it in the script. I think that changing g.findfile in G6/G7 to report always non-qualified name should be harmless, in other words, it should not break any scripts written for G6. What do you think?

Attachments (1)

r.pack.diff (1.1 KB) - added by neteler 7 years ago.
Patch to allow for fully qualified input names

Download all attachments as: .zip

Change History (4)

comment:1 Changed 8 years ago by hamish

Cc: grass-dev@… added
Owner: changed from grass-dev@… to hamish
Status: newassigned

Changed 7 years ago by neteler

Attachment: r.pack.diff added

Patch to allow for fully qualified input names

comment:2 Changed 7 years ago by neteler

I have added a patch to allow for fully qualified input names in G6. Please validate.

comment:3 Changed 7 years ago by hamish

Resolution: fixed
Status: assignedclosed

Hi,

thanks; it should be ok now with r55160,1.

Hamish

ps- fyi r.unpack was exposing a tarbug, since it uses head to cut short the tar listing, and tar version 1.23 didn't like the pipe being closed early. It's harmless & seems to be fixed in newer versions of tar.

Note: See TracTickets for help on using tickets.