FS#73482 - [dwarffortress] copies folders into existing ones on second run

Attached to Project: Community Packages
Opened by Ziusudra (Ziusudra) - Monday, 24 January 2022, 07:39 GMT
Last edited by Sven-Hendrik Haase (Svenstaro) - Monday, 31 January 2022, 03:51 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sven-Hendrik Haase (Svenstaro)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
The loop at lines 13-15 of /usr/bin/dwarffortress copies the folders into the existing folders on runs after the first run.

This results in having ~/.dwarffortress/data/art/art with the files duplicated in both art folders, and the same for all the other folders in the list on line 13. Also should result in the game not using any updated versions of those files, since those would go into the deepest folder, though that's not been tested.

In my opinion, on line 14, the "cp -r ..." should be "cp -rtu ..." to prevent this and uneeded overwriting of unupdated files.


Additional info:
* package version(s)
* config and/or log files etc.
* link to upstream bug report, if any

Steps to reproduce:
Install DF, run twice, tree ~/.dwarffortress/data to see duplicated folders, compare to tree /opt/dwarffortress/data.
This task depends upon

Closed by  Sven-Hendrik Haase (Svenstaro)
Monday, 31 January 2022, 03:51 GMT
Reason for closing:  Fixed
Comment by Ziusudra (Ziusudra) - Monday, 24 January 2022, 09:56 GMT
Didn't do nearly enough testing, line 14 should read:
cp -ru /opt/"$pkgname"/data/$link -t "$HOME/.$pkgname/data/"

Or whatever you think best, of course.
Comment by Sven-Hendrik Haase (Svenstaro) - Monday, 31 January 2022, 03:35 GMT
Oh shit, how has this gone unnoticed all these years.
Comment by Sven-Hendrik Haase (Svenstaro) - Monday, 31 January 2022, 03:51 GMT
Built and tested the package and it appears to be behaving alright. Thanks, closing.

Loading...