8 ms·
Dwarf Fortress starting during apt-get upgrade
- shmerl 9y agoI didn't know Dwarf Fortress was packaged in Debian. The last time I tried playing it on Linux, it was annoyingly 32-bit.
- readams 9y agoSome programs are 32-bit, but not to such an annoying extent.
- Ao7bei3s 9y agoIt's mostly about all necessary libraries being available for the same architecture as the binary. This means either having separate 32bit libraries (typical for closed source applications shipping together with their libraries) or having multiarch libraries (as modern linux distros do).
- pawadu 9y ago> I didn't know Dwarf Fortress was packaged in Debian well, goodbye productivity. I wonder if I can run it on a production server without anyone noticing...
- mikekchar 9y agoThe text renderer seems to use considerably less CPU that the graphics one. I've been tempted to set up a docker image...
- deleted 9y ago[deleted]
- tome 9y agoThe SO question doesn't imply that it is, just that it's installed on the user's machine.
- mnw21cam 9y agoYeah, there's a 64-bit version now.
- jwilk 9y agoIt's not packaged.
- giancarlostoro 9y agoWhen I did my first few programming courses we were using C and on Windows, and using system("pause"); was our way of keeping cmd from closing. So as a joke over the years I've made a pause script for Linux in Python, Perl and even bash just so I can make such code valid. But putting a whole game in place of a standard Linux util sounds like awesome menace, reminds me of the sl command (steam locomotive) which you can install on Debian (and maybe other distros?) for those who may typo ls they'll get a fun surprise :)
- pawadu 9y agowasnt getc() available on windows?
- Const-me 9y agoIt was and still is, the name is _getch() from <conio.h> However, I can see how for a beginner programmer system("pause"); is more intuitive than printf/_getch() combo. Especially if said programmer is already familiar with windows shell and its commands.
- c0nfused 9y agosl also starts for LS too in case you have capslock on.
- ChuckMcM 9y agoJust wait till they release "Ground Control Center" (gcc) :-) For a long time there were two things called 'git' and installing the 'wrong' one invariably led to similar hijinks.
- exikyut 9y agoWhat was the other one?
- Triave 9y agoI'm guessing the interactive fiction interpreter [1], which predated the version control system by a couple of years. [1] http://web.archive.org/web/20120826174233/http://diden.net/if/git/ http://web.archive.org/web/20120826174233/http://diden.net/i...
- djvdorp 9y agoI just spilled my coffee
- grabcocque 9y agoThe fact that the dwarf fortress binary is just 'df' was asking for trouble. In hindsight seems amazing nobody reported this before.
- pawadu 9y agoThat's how i feel about "convert" from imagemagick
- tome 9y agoAnd "import"!
- scbrg 9y agoHate it when I'm starting a newly written python script, and have forgotten the hashbang. For some reason my mouse cursor turns into a cross, and the script does nothing! Always takes me a couple of seconds to realize what's going on...
- masklinn 9y agoI have a similar issue where I tend to start typing python code in the shell without remembering to enter the repl first.
- sohkamyung 9y agoWhich is why I use graphicsmagick [1] instead. The imagamagick executables becomes options behind the 'gm' executable. [1] http://www.graphicsmagick.org/ http://www.graphicsmagick.org/
- igravious 9y agoCan't believe I never heard of GraphicsMagick. Thanks for the heads up. I wonder if it has a Ruby interface.
- vbezhenar 9y agoDon't trust $PATH in scripts. Use `/bin/df`.
- iso-8859-1 9y agoBut then it's not portable across distros and to BSD's. On FreeBSD, bash is in /usr/local/bin/bash (if it is installed) Do you also write "if /usr/bin/[ $? != 0 ]; then ..." ?
- lottin 9y agodf is a standard utility, like ls or cd. Invoking df on a POSIX system should do the expected thing, and if it doesn't it means something is broken.
- mnw21cam 9y agoOn Unix/Linux, there is very little stopping the superuser from introducing new and inventive kinds of breakage, such as in this case. This one is just a little more amusing than most. But seriously, if root wants to install a new command called df and have it higher up in the PATH than the standard utility, why should the OS argue?
- oelmekki 9y agoNote that the OS doesn't argue :) But actually, it would be cool to have some kind of warning, like a POSIX linter that warns the user something broke the standard, and they can decide to ignore it and never hear about it again. I'm not a big fan of linters, usually, but it would make sense for end users tweaking their system.
- JdeBP 9y ago... only if one has used getconf PATH to set the path to the one that guarantees that. * http://pubs.opengroup.org/onlinepubs/9699919799/utilities/getconf.html http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ge... * http://pubs.opengroup.org/onlinepubs/9699919799/functions/confstr.html http://pubs.opengroup.org/onlinepubs/9699919799/functions/co... * http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/unistd.h.html http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/uni...
- pwdisswordfish 9y agoThe real WTF is that APT spawns an external process to check disk usage, instead of invoking statvfs() on its own. Some cases are less clear-cut, however. For example, the Debian 'nodejs' package installs node.js binary as /usr/bin/nodejs and not /usr/bin/node because it conflicts with another package: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=614907#108 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=614907#108 And let's not forget rename(1) from util-linux versus the Perl rename(1)...
- orf 9y agoIt could be called from a bash script rather than from within apt itself.
- phaemon 9y agoIt isn't `apt`. See how they mentioned that `mysql` packages were installing? Well, in the `preinst` shell script, in the .deb, there is the line: `if LC_ALL=C BLOCKSIZE= df --portability $DATADIR/. | tail -n 1 | awk '{ exit ($4>1000) }'; then` There's `df` being called without the full path and that's what would be spawning Dwarf Fortress.
- glandium 9y agoThat doesn't make it much better though. Parsing the output of df (with a useless tail -1) is kind of awful when you can use something like stat -f -c %a.
- MichaelBurge 9y agoThat has the same problem, just with a different name. So your solution solves a style complaint, not an actual functional problem.
- sslayer 9y agoI agree with your comment about it being functional. But wouldn't removing tail from the pipe remove complexity and speed up the processing(Arguably, most likely only by a small fraction)
- proactivesvcs 9y agoWhy not have some Fun while waiting for upgrades to install? The bug is that apt doesn't carry on in the background ;-)
- oelmekki 9y agoUsing aliases in `~/.bashrc` rather than putting scripts or symlinks in $PATH is a good mean to avoid those kind of problems, provided bashrc includes code to quit if ran in non-interactive mode (default at least on ubuntu). Many use aliases only to specify default command parameters, but it works just as well to provide an execution path, like, in this case: alias df=/home/my_user/games/dwarf_fortress/df It would only be executed in interactive sessions, this way, which should guard well enough against system code interpreting it. Of course, this still means user can't use system's `df` easily, but I guess they don't use it anyway since they did not realize the problem until that upgrade.
- cpach 9y agoWhy not name the alias something else than “df”? :) dfortress or something like that. Then it won’t collide with df(1).
- oelmekki 9y agoThis is by far the best approach, yes :) My point was more to show a way this particular user could have achieved the same result without their problem. Plus, we can't expect users to know all the system tools, this is a good way to isolate "user space" from "system space", so I guess taking the habit to use aliases rather than putting things in `/usr/local/bin/` makes sense by itself (except when we want indeed to override an executable provided by system, or we want indeed to provide a new system tool).
- AndrewOMartin 9y agoThey could still type /bin/df, and they could also use: alias freespace=/bin/df Though then they'd have to uninstall FreeSpace 2.
- pwdisswordfish 9y ago> this still means user can't use system's `df` easily \df There you go.
- 9y ago
- jwilk 9y agohttps://bugs.debian.org/752114 https://bugs.debian.org/752114