Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:11.4
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 2010-11-21 20:47:03.510842495 +0100 +++ kdm/kfrontend/genkdmconf.c 2010-11-21 20:47:03.623718730 +0100 @@ -1036,6 +1036,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; @@ -1074,9 +1094,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) { @@ -3166,9 +3187,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, @@ -3280,6 +3298,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, @@ -3328,6 +3348,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