Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:12.2
python-kdebase4
kdm-kdmconf.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File kdm-kdmconf.diff of Package python-kdebase4
Index: kdm/kfrontend/genkdmconf.c =================================================================== --- kdm/kfrontend/genkdmconf.c.orig +++ kdm/kfrontend/genkdmconf.c @@ -1040,6 +1040,26 @@ copyFile(Entry *ce, int mode, int (*proc } static void +cleanupFile( const char *tname, int mode ) +{ + char *nname; + File file, file2; + char bn[PATH_MAX + 4]; + + ASPrintf( &nname, "%s/%s", newdir, tname ); + sprintf( bn, "%s.bak", nname ); + + if (readFile( &file, nname ) && readFile( &file2, bn )) { + if ((file.eof - file.buf == file2.eof - file2.buf) && !strncmp( file.buf, file2.buf, file.eof - file.buf )) { + unlink( nname ); + rename( bn, nname ); + chmod( nname, mode ); + } + } + free( nname ); +} + +static void doLinkFile(const char *name) { File file; @@ -1078,9 +1098,10 @@ writeFile(const char *tname, int mode, c fputs_(cont, f); fclose_(f); addedFile(tname); + if (!no_backup) + cleanupFile(tname + sizeof(KDMCONF), mode); } - static void handleBgCfg(Entry *ce, Section *cs) { @@ -3170,9 +3191,6 @@ int main(int argc, char **argv) memcmp(oldkde + olen - sizeof(SHR_CONF) + 1, SHR_CONF, sizeof(SHR_CONF))) { - fprintf(stderr, - "Warning: --old-kde does not end with " SHR_CONF ". " - "Might wreak havoc.\n"); oldkdepfx = oldkde; } else ASPrintf((char **)&oldkdepfx, @@ -3284,6 +3302,8 @@ int main(int argc, char **argv) f = createFile("kdmrc", kdmrcmode); writeKdmrc(f); fclose_(f); + if (!no_backup) + cleanupFile( "kdmrc", kdmrcmode ); f = createFile("README", 0644); fprintf_(f, @@ -3332,6 +3352,8 @@ int main(int argc, char **argv) "\nTry 'genkdmconf --help' if you want to generate another configuration.\n" "\nYou may delete this README.\n"); fclose_(f); + if (!no_backup) + cleanupFile( "README", 0644 ); return 0; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor