packpanda 'cannot copy game to'

I’ve used Panda3d in the past, but I’ve taken a break and recently moved my box completely over to Ubuntu and wanted to get back into it. Just for laughs, I wanted to test packpanda on a sample program to see how things worked. So, I copied ‘Tut-Roaming-Ralph.py’ to ‘main.py’ and let her rip. Here’s what I got:

bummer@bummer-desktop:~/Projects/panda/samples$ sudo packpanda --dir Roaming-Ralph/ --name "Ralph" --pyc --version 1.0
PANDA located at /usr/share/panda3d
Dir            : /home/bummer/Projects/panda/samples/Roaming-Ralph
Name           : Ralph
Start Menu     : Ralph 1.0
Main           : /home/bummer/Projects/panda/samples/Roaming-Ralph/main.pyc (MISSING)
License        : /home/bummer/Projects/panda/samples/Roaming-Ralph/license.txt (MISSING)
Output         : Roaming-Ralph-1.0

Copying the game to /home/bummer/Projects/panda/samples/packpanda-TMP...
Cannot copy game to /home/bummer/Projects/panda/samples/packpanda-TMP
bummer@bummer-desktop:~/Projects/panda/samples$ rm -rf packpanda-TMP/
rm: cannot remove directory `packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games/Roaming-Ralph/game/packpanda-TMP/usr/share/games': Permission denied

Yes, I used ‘sudo packpanda’ on purpose so it would show the entire dir tree when it wouldn’t let me remove it. I got into packpanda.py and changed line 189 from ‘try:’ to ‘if true:’ to get a good traceback, and found out ‘except:’ kicked in when the file name got too long.

Printing TMPDIR, TMPETC, and TMPGAME produced the following:

/home/bummer/Projects/panda/samples/packpanda-TMP
/home/bummer/Projects/panda/samples/packpanda-TMP/usr/share/games/Roaming-Ralph/etc
/home/bummer/Projects/panda/samples/packpanda-TMP/usr/share/games/Roaming-Ralph/game

… which are right, so figured it was getting stuck in loop hell in ‘limitedCopyTree’. I’ve managed to get it to work by commenting lines 171 and 172 in packpanda.py:

166: def limitedCopyTree(src, dst, rmdir):
167:      if (os.path.isdir(src)):
168:          if (rmdir.has_key(os.path.basename(src))):
169:              return
170:          if (not os.path.isdir(dst)): os.mkdir(dst)
171:          #for x in os.listdir(src):
172:          #    limitedCopyTree(os.path.join(src,x), os.path.join(dst,x), rmdir)
173:      else:
174:          shutil.copyfile(src, dst)

I’m sure this isn’t the best solution, but packpanda produced a working .deb like this, and I couldn’t find this resolution anywhere else (yes, I looked! XoD ). Just wanted to post this here in case anyone else needed it, and maybe get a comment or two from anyone more experienced than me with it.

System:
Ubuntu 10.04 LTS 64-bit
Python 2.6.5
Panda3D 1.7.0b-1 (freshly installed from the repo’s)

EDIT
Ok … almost works now …
Getting an error after (or during?) ‘Compiling BAM and PYC files…’, which I didn’t pay much attention to before (I was happy it even tried!).

bummer@bummer-desktop:~/Projects/panda/samples$ packpanda --dir Roaming-Ralph/ --version 0.1
PANDA located at /usr/share/panda3d
Dir            : /home/bummer/Projects/panda/samples/Roaming-Ralph
Name           : Roaming-Ralph
Start Menu     : Roaming-Ralph 0.1
Main           : /home/bummer/Projects/panda/samples/Roaming-Ralph/main.py
License        : /home/bummer/Projects/panda/samples/Roaming-Ralph/license.txt (MISSING)
Output         : Roaming-Ralph-0.1

Copying the game to /home/bummer/Projects/panda/samples/packpanda-TMP...

Compiling BAM and PYC files...
cp: cannot stat `/usr/share/panda3d/Pmw': No such file or directory
dpkg-deb: building package `roaming-ralph' in `Roaming-Ralph_0.1_amd64.deb'.

And after installing the .deb, I can’t seem to find a way to run it, lol. There’s nothing in the ‘/usr/share/games/Roaming-Ralph/game’ folder. Or am I just missing something easy now?