MantisBT - Zandronum
View Issue Details
0002226Zandronum[All Projects] Bugpublic2015-05-10 20:422018-09-30 21:50
Edward-san 
Torr Samaho 
normalminorhave not tried
closedfixed 
LinuxUbuntu14.04 x86-64
3.0-beta 
3.03.0 
0002226: Zandronum accidentally moves the files from '.zdoom', instead of '.zandronum', to '.config/zandronum'
This is caused by this code snippet in src/m_misc.cpp:


// This can be removed after a release or two
// Transfer the old zdoom directory to the new location
bool moved = false;
FString oldpath = NicePath("~/.zdoom/");
if (stat (oldpath, &extrainfo) != -1)
{
    if (rename(oldpath, path) == -1)
    {
        I_Error ("Failed to move old zdoom directory (%s) to new location (%s).",
            oldpath.GetChars(), path.GetChars());
    }
    else
        moved = true;
}

if (!moved && mkdir (path, S_IRUSR | S_IWUSR | S_IXUSR) == -1)
{
    I_FatalError ("Failed to create %s directory:\n%s",
        path.GetChars(), strerror (errno));
}


The fix is to replace 'zdoom' with 'GAMENAMELOWERCASE', which is 'zandronum' in our case.
This is kind of dangerous. I lost some of the old .zdoom files (screenshots, savegames, inis) because of that.

If an user has run zandronum 3.0, he could be able to recover these by moving back the files to .zdoom, except for zandronum.ini.

Also, even if the issue above is fixed by changing the folder name, all the .zandronum data is moved away to .config/zandronum, causing problems when running zandronum 2.0. In order to avoid complications, it's better to 'copy' instead of 'rename'. No idea how to do this, though.
No tags attached.
child of 0002172closed Torr Samaho Upgrade GZDoom base to 1.8.6 
Issue History
2015-05-10 20:42Edward-sanNew Issue
2015-05-10 20:43Edward-sanDescription Updatedbug_revision_view_page.php?rev_id=7067#r7067
2015-05-11 12:39Edward-sanSummary[merge-experiments] Zandronum accidentally copies the files from '.zdoom', instead of '.zandronum', to '.config/zandronum' => [merge-experiments] Zandronum accidentally moves the files from '.zdoom', instead of '.zandronum', to '.config/zandronum'
2015-05-11 12:39Edward-sanAdditional Information Updatedbug_revision_view_page.php?rev_id=7073#r7073
2015-05-12 13:18ArcoRelationship addedchild of 0002172
2015-05-16 12:39Torr SamahoNote Added: 0012283
2015-05-16 12:41Torr SamahoAssigned To => Torr Samaho
2015-05-16 12:41Torr SamahoStatusnew => needs testing
2015-05-16 12:53Edward-sanNote Added: 0012284
2015-05-16 14:13DuskNote Added: 0012285
2015-05-16 17:05Edward-sanNote Added: 0012290
2015-05-16 17:05Edward-sanNote Edited: 0012290bug_revision_view_page.php?bugnote_id=12290#r7098
2015-05-24 18:56DuskSummary[merge-experiments] Zandronum accidentally moves the files from '.zdoom', instead of '.zandronum', to '.config/zandronum' => Zandronum accidentally moves the files from '.zdoom', instead of '.zandronum', to '.config/zandronum'
2015-05-24 19:29DuskProduct Version3.0 => 3.0-beta
2015-08-23 18:41Blzut3Note Added: 0013252
2015-08-23 19:01KlofkacNote Added: 0013254
2015-08-25 09:58DuskNote Added: 0013263
2016-05-17 06:32Torr SamahoTarget Version => 3.0
2016-05-17 19:21Torr SamahoNote Added: 0014944
2016-05-17 19:22Torr SamahoNote Edited: 0014944bug_revision_view_page.php?bugnote_id=14944#r9022
2016-05-19 08:04Edward-sanNote Added: 0014954
2016-05-21 18:33WaTaKiDNote Added: 0014968
2017-02-06 18:57DuskStatusneeds testing => resolved
2017-02-06 18:57DuskFixed in Version => 3.0
2017-02-06 18:57DuskResolutionopen => fixed
2018-09-30 21:50Blzut3Statusresolved => closed

Notes
(0012283)
Torr Samaho   
2015-05-16 12:39   
I used GAMENAMELOWERCASE as you suggested. Regarding copy instead of move, this is something that should be changed in ZDoom (did they already change it?).
(0012284)
Edward-san   
2015-05-16 12:53   
Quote from Torr Samaho
Regarding copy instead of move, this is something that should be changed in ZDoom (did they already change it?).


ZDoom never changed that, probably because no one bothered about keeping the old stuff in the old place...
(0012285)
Dusk   
2015-05-16 14:13   
Seems quite late to change this in ZDoom now.
(0012290)
Edward-san   
2015-05-16 17:05   
Considering that the code could be removed in zdoom 2.8 because of:


        // This can be removed after a release or two
        // Transfer the old zdoom directory to the new location


(0013252)
Blzut3   
2015-08-23 18:41   
The move is very much intentional as it exists to migrate people to the new location without wasting hard disk space. Copying or creating a symlink after the move may be more suitable for us though since we have a testing program. Should change to moving for the final build though. Note that I'm pretty sure ZDoom will only move if the .config location does not exist.
(0013254)
Klofkac   
2015-08-23 19:01   
I thought about another option: Not copying or moving, but instead creating a symbolic link. That way, both paths still work and files aren't duplicated.
(0013263)
Dusk   
2015-08-25 09:58   
Or we could've withhold the change until 3.0 was ready to be released. Too late now...
(0014944)
Torr Samaho   
2016-05-17 19:21   
(edited on: 2016-05-17 19:22)
For now, I disabled the config file movement for non-release builds. Can somebody check if this works as intended?

(0014954)
Edward-san   
2016-05-19 08:04   
It works. I noticed that the 'created from scratch' ini contains the path '~/.config/zandronum' which isn't present in 2.0 zandronum.ini when the move was done. Should we tell the users to add it when 3.0 will be released and the move would be done?
(0014968)
WaTaKiD   
2016-05-21 18:33   
config file movement was disabled in 3.0 with:'https://bitbucket.org/Torr_Samaho/zandronum/commits/dfebab78f9458adf5d99c58eda7b0d826f6cd636 [^]'