# webapp-config no longer protect modified files?

## PanardBook

Hello,

Before version 1.50.10, if i remember correctly, when upgrading a webapp, if I modified some files, webapp-config created a .cfg_file.

But since 1.50.10, it seems that it is no longer the case :

```
# webapp-config -I -h localhost -d test/mediawiki mediawiki 1.5.4

*   Creating required directories

*   Linking in required files

*     This can take several minutes for larger apps

*   Files and directories installed

...

```

```
echo 1234 >> test/mediawiki/index.php
```

```
# webapp-config -U -h localhost -d test/mediawiki mediawiki 1.5.6

* Upgrading mediawiki-1.5.4 to mediawiki-1.5.6

*   Installed by root on 2006-02-25 22:26:54

*   Config files owned by 0:0

!time index.php

!empty /var/www/localhost/cgi-bin

!empty /var/www/localhost/icons

--- /var/www/localhost/htdocs/test/mediawiki

* Invalid line "" removed from the database file!

*   Creating required directories

*   Linking in required files

*     This can take several minutes for larger apps

*   Files and directories installed

* Install completed - success

```

```
# ls -A test/mediawiki | egrep '^\.'

.webapp

.webapp-mediawiki-1.5.6

```

no .cfg....

Is that a bug or miss I something ?

Thanks

----------

## wrobel

Hi Panard!

webapp-config will only protect files that are marked as being config files for the application. The list of config files for mediawiki will be stored in 

```

/usr/share/webapps/mediawiki/1.5.4/config-files 

```

webapp-config assumes that all other files are not being modified within the virtual install location (this is in line with what portage does during upgrades).

Regards,

Gunnar

----------

## PanardBook

Hello,

 *wrobel wrote:*   

> 
> 
> webapp-config assumes that all other files are not being modified within the virtual install location (this is in line with what portage does during upgrades).
> 
> 

 

Why? webapp-config detect modified files ( !mtime ), so why send my changes (and sometimes lot of changes) to /dev/null? why not just protect modified files?

I think that the current behaviour is really bad, and may cause important lost of user modifications...

why not use the CONFIG_PROTECT from make.conf to auto-protect server-owned files? it would be better "portage compliant"...

Thanks.

----------

## wrobel

 *PanardBook wrote:*   

> 
> 
> Why? webapp-config detect modified files ( !mtime ), so why send my changes (and sometimes lot of changes) to /dev/null? why not just protect modified files?
> 
> 

 

You are not completely alone with that sentiment since the original author of webapp-config (Stuart) added a comment in the code that he dislikes the behavior  :Smile:  And I am not debating that it could be done.

But the idea of portage and also webapp-config is to get an application installed to a stage where it is completely functional. This will not be possible if the tools are disallowed to write all files of the application since there are local modifications. 

I agree that the situation for webapp-config is slightly more difficult than for portage. For portage the user knows that he has the /etc dir config protected. He also knows that editing stuff in /usr is futile since portage will overwrite any changes there on the next update. For webapp-config this usually happens all within the webroot so the boundaries are not that easy. 

But essentially we are simply copying the portage behavior.

If you feel the issue needs broader discussion I'd suggest posting a mail to gentoo-web-user@lists.gentoo.org our webapps related discussion group.

----------

