I am trying to use tup to assemble a document out of selected fragment files. The fragment selection is determined using the TMSU <http://tmsu.org/> file tagging utility, which maintains its tag data in an sqlite database.
The generated file may change if the database is updated. So, I was trying to make the sqlite file an input to the rule generating the output file. The first challenge had to do with TMSU storing its database file in a hidden directory. I was surprised to see that even symlinking the hidden directory to a non-hidden one, e.g. ln -s .tmsu tmsu, still did not make the file visible to tup: tup error: Explicitly named file 'db' not found in subdir 'tmsu' I was eventually able to work around that by doing the reverse: keep the regular database file somewhere visible, and symlinking it to its original location where TMSU expects it (in .tmsu). Both tools saw the file. Side question: why doesn’t tup follow symlinks? Then, I was hit by the main issue of this message. Case 1: listing the sqlite file as an input (this is the desired setup, so that updating the database regenerates the output file) results in the following error: *** tup errors *** tup error: Unspecified output files - A command is writing to files that you didn't specify in the Tupfile. You should add them so tup knows what to expect. -- Unspecified output: tagdb *** Command ID=101 ran successfully, but tup failed to save the dependencies. In fact, even without listing the sqlite file as an input, this new arrangement (sqlite file in the root, not in a hidden directory) results in the error above. Case 2: listing the sqlite as an output, as suggested in the error message above, results in the following error: tup error: Attempting to insert '../tagdb' as a generated node when it already exists as a different type (normal file). You can do one of two things to fix this: 1) If this file is really supposed to be created from the command, delete the file from the filesystem and try again. 2) Change your rule in the Tupfile so you aren't trying to overwrite the file. Obviously, I can’t do either of the two suggestions in this error message. TL;DR: sqlite appears to open its database file for read and write (O_RDWR), which does not allow it to be used as input in a tup rule. So, how can use the sqlite database as input? -- -- tup-users mailing list email: [email protected] unsubscribe: [email protected] options: http://groups.google.com/group/tup-users?hl=en --- You received this message because you are subscribed to the Google Groups "tup-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
