restore_dotpup_menues.sh

Please post any bugs you have found
Post Reply
Message
Author
User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

restore_dotpup_menues.sh

#1 Post by MU »

From the newspage:

BUG 2:
As described below, preservation of DotPup entries is still not working. The entries get extracted by the /usr/sbin/backup_dotpup_menues.wxbs to /tmp/menu_dotpup_fvwm95.txt and /tmp/menu_dotpup_jwm.txt, but when rc.update calls /usr/sbin/restore_dotpup_menues.sh they aren't getting reinserted.
However, run from the commandline:

# restore_dotpup_menues.sh

and they do get restored. So, something is wrong in the call from /etc/rc.d/rc.update.
Therefore for this 1.0.6rc, if upgrading your pup001 file from 1.0.5, after the bootup run the above program to fix the menus. Then restart the window manager. not yet fixed


Maybe it helps, to use absolute paths.

Try a new restore_dotpup_menues.sh:

Code: Select all

#!/bin/sh

### ensure, we are in the correct folder

cd /usr/sbin/resource

./restore_dotpup_menues.sh

echo ---FINISHED---
I will have a look at the RC tomorrow.
Mark

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#2 Post by GuestToo »

some of the environmental variables that are setup in /etc/profile are not set up yet when scripts in /etc/rc.d are run ... this might or might not be the problem

for example, PATH, LD_LIBRARY_PATH

this sometimes causes a problem running something from rc.local

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#3 Post by MU »

The scripts don't use environment-variables.
It might be however (theoretically), puppybasic itself does, what could lead to a crash.

This could be tested by setting a line like this in restore_jwm_menues.wxbs:
writestringtofile("/tmp/testpb.txt" , "test")

If PuppyBasic crashes, there will be no "/tmp/testpb.txt" after execution.

Mark

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#4 Post by GuestToo »

the point is some of the programs and utility programs and library files that are in /usr will not be available ... this might not be the problem, but it might (and the program almost certainly uses the PATH variable, which is changed after /etc/profile executes)

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#5 Post by BarryK »

MU, GuestToo,

restore_dotpup_menues.sh is now totally a simple Ash shell script.
restore_jwm_menu.wxbs is not being used, as it didn't seem to work
-- I wrote a replacement.

Regarding PuppyBasic, that works, as backup_dotpup_menues.wxbs
works.

/usr is available at that stage.
(for example /usr/bin/wxbasicscript).

Both the restore_ and backup_ scripts are in /usr/sbin/.

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#6 Post by BarryK »

Oh, &^%$#@ (substitute culturally and religiously acceptable swear word here).

I think I found the problem.
Previously, it was working for Fvwm95 but not JWM, I think, so I replaced
restore_jwm_menu.wxbs with my own ash code inside restore_dotpup_menues.sh.

But, messing around with rc.update, I left out a key line:
Backup code:

Code: Select all

  #v1.0.6
  #Mark Ulrich has written a DotPup installer that places entries into the w.m. menus.
  #which is a problem. he has written scripts to extract then restore. extract...
  DOTPUPS=""
  if [ ! "`cat $DESTROOT/.jwmrc 2>/dev/null | grep "Menu" | grep "DotPups"`" = "" ];then
   DOTPUPS="yes"
   echo "backing up DotPup entries in w.m. menus..."
   if [ "$DESTROOT" = "/root" ];then
    /usr/sbin/backup_dotpup_menues.wxbs
   else
    #installing to h.d....
    chroot $DESTMNT /usr/sbin/backup_dotpup_menues.wxbs
   fi
  fi
...but for 1.0.6rc I left out that DOTPUPS="yes" line.
Further down:

Code: Select all

  #v1.0.6
  #Mark Ulich's script above to backup the DotPup info in menus. now restore...
  if [ "$DOTPUPS" = "yes" ];then
   echo "Restoring DotPup entries in w.m. menus..."
   if [ "$DESTROOT" = "/root" ];then
    /usr/sbin/restore_dotpup_menues.sh #note also calls restore_jwm_menue.wxbs
   else
    #installing to h.d....
    chroot $DESTMNT /usr/sbin/restore_dotpup_menues.sh
   fi
  fi
...so of course it never worked!
:oops:

Post Reply