Page 1 of 1
making petget work in devuan
Posted: Tue 09 Aug 2016, 07:58
by learnhow2code
so i spent an hour looking into gtkdialog today because i couldnt get petget to work in an environment it wasnt made for. to be fair, it was complaining about a line with little except <vbox> for gtkdialog.
after trying ppm mod, and downloading libstardust (which isnt a binary ".so" library, but a collection of scripts-- which is fine) i noticed that petget has this line for the shbang:
#!/bin/sh
this AND NOTHING ELSE is actually the culprit here-- /bin/sh isnt /bin/sh... well thats a STANDARD unknown (sh could be lots of things... except when each distro has its own standard)
but i tried copying /bin/sh from puppy (dont worry, i have the entire sfs hierarchy handy) to /bin/pupsh just in case it was a "specially compiled" busybox sh with some exotic patch.
then i tried /bin/pupsh --version ...
SO! /bin/sh is actually /bin/bash
ok, so i run sed -i "s/bin\/sh/bin\/bash/g" /usr/sbin/petget # and what do you think happens then? see attachment.
(note, if there is no reason not to, please consider changing the shbang in petget to /bin/bash -- it seems it will not actually work with any version of /bin/sh that is not a link to /bin/bash)
i still hold that the gtkdialog thread was extremely helpful. the amount of time i wasted on that avenue couldve been MUCH greater without it-- despite the fact that gtkdialog was not even the issue! it actually helped me rule out gtkdialog as the issue much faster.
Posted: Tue 09 Aug 2016, 08:25
by bigpup
Well, /bin/sh is in /bin as a symbolic link to /bin/bash
I wonder if this is someones short hand for coding or something Barry K just likes to do for Puppy code.
Puppy likes to use a lot of symbolic links.
Posted: Tue 09 Aug 2016, 08:40
by learnhow2code
bigpup wrote:Well, /bin/sh is in /bin as a symbolic link to /bin/bash
yeah, it is in puppy. if gtkdialog werent so cumbersome (and guis always are-- id rather play with most of the bash-based ones than the python guis) i wouldve probably found the issue faster.
again, who thought anyone would try to run petget somewhere else? (i never thought dpkg-deb would be in puppy-- i didnt even know there was a dpkg-deb until i found it in puppy, but its in devuan too.)
I wonder if this is someones short hand for coding or something Barry K just likes to do for Puppy code.
Puppy likes to use a lot of symbolic links.
everyone seems to lean on symbolic links sooner or later. i set one up (by hand) almost every time i boot these days.
this is for refracta:
Code: Select all
mkdir /usr/lib/gtkdialog ; cp /mnt/mkrefpup/unsq/squashfs-root/usr/lib/gtkdialog/xml_button-icon /usr/lib/gtkdialog
mkdir /usr/lib/gtkdialog ; cp /mnt/mkrefpup/unsq/squashfs-root/usr/lib/gtkdialog/xml_scalegrip /usr/lib/gtkdialog
cp /mnt/mkrefpup/unsq/squashfs-root/usr/lib/gtkdialog/xml_scalegrip /usr/lib/gtkdialog
cp /mnt/mkrefpup/unsq/squashfs-root/usr/lib/gtkdialog/xml_info /usr/lib/gtkdialog
cp /mnt/mkrefpup/unsq/squashfs-root/usr/lib/gtkdialog/xml_pixmap /usr/lib/gtkdialog
cp /mnt/mkrefpup/unsq/squashfs-root/usr/lib/gtkdialog/svg_analogclock /usr/lib/gtkdialog
cp /mnt/mkrefpup/unsq/squashfs-root/usr/lib/gtkdialog/svg_bar /usr/lib/gtkdialog
cp /mnt/mkrefpup/unsq/squashfs-root/usr/lib/gtkdialog/svg_text /usr/lib/gtkdialog
cp /mnt/mkrefpup/unsq/squashfs-root/usr/lib/gtkdialog/box_splash /usr/lib/gtkdialog
cp /mnt/mkrefpup/unsq/squashfs-root/usr/lib/gtkdialog/box_yesno /usr/lib/gtkdialog
cp /mnt/mkrefpup/unsq/squashfs-root/usr/lib/gtkdialog/box_ok /usr/lib/gtkdialog
cp /mnt/mkrefpup/unsq/squashfs-root/usr/lib/gtkdialog/box_help /usr/lib/gtkdialog
cp /mnt/mkrefpup/unsq/squashfs-root/usr/sbin/petget /usr/sbin
cp /mnt/mkrefpup/unsq/squashfs-root/etc/DISTRO_SPECS /etc
cp /mnt/mkrefpup/unsq/squashfs-root/usr/sbin/gtkdialog4 /usr/sbin
cp /mnt/mkrefpup/unsq/squashfs-root/usr/sbin/gtkdialog3 /usr/sbin
cp /mnt/mkrefpup/unsq/squashfs-root/usr/sbin/gtkdialog /usr/sbin
sed -i "s/bin\/sh/bin\/bash/g" /usr/sbin/petget
history | grep pupsh
ls -l /mnt/mkrefpup/unsq/squashfs-root/bin/sh
cat /mnt/mkrefpup/unsq/squashfs-root/root/.packages/user-installed-packages
mkdir /root/.packages
echo -n > /root/.packages/PK
mkdir /usr/local/petget ; cp /mnt/mkrefpup/unsq/squashfs-root/usr/local/petget/installpkg.sh /usr/local/petget
mkdir /etc/rc.d
cp /mnt/mkrefpup/unsq/squashfs-root/etc/rc.d/PUPSTATE /etc/rc.d/
mkdir /etc/xdg/menus/
echo -n >> /etc/xdg/menus/hierarchy
cp /mnt/mkrefpup/unsq/squashfs-root/usr/bin/pet2tgz /usr/bin
cp /mnt/mkrefpup/unsq/squashfs-root/bin/pupkill /bin
cp /mnt/mkrefpup/unsq/squashfs-root/usr/local/petget/hacks-postinstall.sh /usr/local/petget/
cp /mnt/mkrefpup/unsq/squashfs-root/usr/sbin/indexgen.sh /usr/sbin/
cp /mnt/mkrefpup/unsq/squashfs-root/usr/sbin/fixmenus /usr/sbin/
cat /root/.packages/user-installed-packages
echo -n > /root/.packages/user-installed-packages
cp /mnt/mkrefpup/unsq/squashfs-root/root/.packages/Packages-puppy-* /root/.packages/
cp -r /mnt/mkrefpup/unsq/squashfs-root/root/.packages/PKGS* /root/.packages/
echo -n > /root/.packages/user-installed-packages
echo -n > /etc/xdg/templates
cp /mnt/mkrefpup/unsq/squashfs-root/usr/sbin/printcols /usr/sbin/
echo -n > /root/.packages/user-installed-packages
cp /mnt/mkrefpup/unsq/squashfs-root/usr/share/doc/index.html* /usr/share/doc
cp /mnt/mkrefpup/unsq/squashfs-root/usr/share/doc/home*.htm* /usr/share/doc
cp /mnt/mkrefpup/unsq/squashfs-root/root/.packages/DISTRO* /root/.packages/
echo -n > /root/.packages/user-installed-packages
cp /mnt/mkrefpup/unsq/squashfs-root/usr/bin/tgz2pet
cp /mnt/mkrefpup/unsq/squashfs-root/usr/bin/undeb /usr/bin
sed -i "s/bin\/sh/bin\/bash/g" /usr/bin/tgz2pet
Posted: Tue 09 Aug 2016, 18:33
by amigo
All debian-based distros have 'dash' as /bin/sh
Posted: Tue 09 Aug 2016, 18:51
by learnhow2code
amigo wrote:All debian-based distros have 'dash' as /bin/sh
and they try to have all core scripts work with dash as a standard. but thats not what im proposing. petget requires bash, if a user ends up with /bin/sh as anything other than bash then petget wil not work. it reasonable to not have it use a shortcut that saves two characters, but link to something that always works. nonetheless, only a suggestion. fixed here.
Posted: Wed 10 Aug 2016, 03:05
by MochiMoppel
The shebang #!/bin/sh in all (?) Puppy scripts is not to "save two characters". Calling /bin/sh symlinked to /bin/bash is not the same as calling /bin/bash directly. /bin/sh will put bash into POSIX mode while /bin/bash enables bash specific features and behaviors.
Posted: Wed 10 Aug 2016, 05:24
by learnhow2code
The shebang #!/bin/sh in all (?) Puppy scripts
definitely not all puppy scripts. so far, may use /bin/bash (this is good imo) when they need bin/bash.
i would recommend that for any script that:
* actually requires bash
* wants to be portable.
as i said, it is understandable that petget never intended to be portable-- its a package manager for puppy, people expect it will run in puppy.
otoh, puppy often uses other distros now, so its now worth considering (imo) the possibility of petget being used elsewhere too. perhaps thats a stretch.
is not to "save two characters". Calling /bin/sh symlinked to /bin/bash is not the same as calling /bin/bash directly. /bin/sh will put bash into POSIX mode while /bin/bash enables bash specific features and behaviors.
that is good to know. unfortunately it is possibly also a good reason NOT to change the scripts (if they are actually deliberately choosing /bin/sh in order to put bash in posix mode. how many of the scripts in question actually do it for that reason? who knows?)
* i am toying with the idea of having petget (the one in refracta mode) modify the shbang so that more of the packages loaded by petget actually work.
* but i am also considering the possibility that it could be better to only bother with packages that work out of the box, and not modify petget to fiddle with them.
today i am trying out many pet packages. then i will have a much better idea of how often this is even an issue across package land. petget installed palemoon in refracta, thats pretty good stuff right there.