[openbeos] Re: cvs and .rsrc files (again)

  • From: François Revol <revol@xxxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Thu, 31 Oct 2002 20:45:07 +0100 (CET)

En réponse à Matthijs Hollemans <matthijs@xxxxxxxxxxxxxxxxxxx>:

> Hey,
> 
> Yesterday I asked whether it would be okay to tell cvs that .rsrc
> files are really binary, by including them in the "cvswrappers"
> configuration file. The reason I asked is that all .rsrc files in
> the cvs repository are corrupt because the cvs used to treat them as
> ASCII and not binary.
> 
> But it gets worse -- I remembered an old post from bedevtalk about
> this same problem, so I looked it up. Even if you store .rsrc files
> as binary, cvs still strips the file's attributes. And guess where
> the icons and the app signature are stored? In the attributes, of
> course. So putting the .rsrc file type in cvswrappers made
> absolutely no difference -- the .rsrc files are still broken.
> 
> Now, I can't believe no one has noticed this before... after all,
> there are about 20 or so .rsrc files in the repository. Has anyone
> else run into this problem? More to the point, what is the proposed
> solution?
> 
> IMHO, we should not include .rsrc files in the repository, but
> compile them from a special source format instead, something I think
> has already been proposed here. An alternative solution is zipping
> the .rsrc files and storing the zips in the repository, since zip
> _does_ preserve the attributes. That makes cvs a little harder to
> use, but it may be possible to make this zipping and unzipping
> totally transparent to the user (that's us) by writing special
> "commit rules".
> 
> Any thoughts?
> --
> Matthijs
> 
> 
> 
> 


1) it's not cvs that strips attributes, but the cvs server which uses a
filesystem that doesn't support them anyway, so they get lost.
2) anyway icons and other stuff are stored *both* as attributes and 
resources, so this isn't a problem.
3) I think we should really have a look at the rdef stuff in the
OpenTracker cvs...

Btw, just made a script today that extracts an icon from attributes
and creates rdef data, as someone had the need for it on IRC:

-------------
#!/bin/sh

# dumpicon [L|M] filename
function dumpicon () {
catattr "BEOS:$1:STD_ICON" "$2" | grep 0x | cut -d ' ' -f2 | sed 's/,//g' | sed 
's/0x$//'
}

if [ $# -lt 1 ]; then
echo "usage: $0 file"
exit 1
fi

if [ "X$1" = "X-n" ]; then
        shift
        ICONAME="$1"
        shift
else
ICONAME="`basename $1`"
fi

echo "resource(R_$ICONAME) #'ICON' array {"
dumpicon L "$1" | awk ' NR%2==0 { print  } NR%2 { printf $0 }' | awk ' { print 
"\t$\"" $0 "\"" } '
echo "};"
echo ""
echo "resource(R_$ICONAME) #'MICN' array {"
dumpicon M "$1" | awk ' { print "\t$\"" $0 "\"" } '
echo "};"
echo ""


-------------

François.



Other related posts: