Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
hamradio
xwxapt
xwxapt-glade-user-path.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File xwxapt-glade-user-path.patch of Package xwxapt
--- xwxapt-3.4.2/src/main.c.orig 2020-02-19 21:22:42.658000000 +0100 +++ xwxapt-3.4.2/src/main.c 2020-02-19 21:26:32.437313113 +0100 @@ -90,9 +90,7 @@ /* Create xwxapt window */ Strlcpy( rc_data.xwxapt_glade, - getenv("HOME"), sizeof(rc_data.xwxapt_glade) ); - Strlcat( rc_data.xwxapt_glade, - "/xwxapt/xwxapt.glade", sizeof(rc_data.xwxapt_glade) ); + "/usr/share/xwxapt/xwxapt.glade", sizeof(rc_data.xwxapt_glade) ); main_window = create_main_window( &main_window_builder ); gtk_window_set_title( GTK_WINDOW(main_window), PACKAGE_STRING ); gtk_widget_show( main_window ); --- xwxapt-3.4.2/src/utils.c.orig 2020-02-19 19:28:52.246000000 +0100 +++ xwxapt-3.4.2/src/utils.c 2020-02-19 22:45:36.142133970 +0100 @@ -82,7 +82,8 @@ Load_Config( gpointer data ) { char - rc_fpath[64], /* File path to xwxaptrc */ + rc_fpath[3][1024], /* File path to xwxaptrc */ + dirs[2][1024], /* Directories to create for user data */ line[81]; /* Buffer for Load_Line */ /* Config file pointer */ @@ -117,16 +118,34 @@ /* Setup file path to xwxaptrc and working dir */ - snprintf( rc_fpath, sizeof(rc_fpath), + snprintf( rc_fpath[2], sizeof(rc_fpath[2]), + "/etc/xwxaptrc"); + snprintf( rc_fpath[1], sizeof(rc_fpath[1]), "%s/xwxapt/xwxaptrc", getenv("HOME") ); + snprintf( rc_fpath[0], sizeof(rc_fpath[0]), + "%s/.xwxaptrc", getenv("HOME") ); + snprintf( rc_data.xwxapt_dir, sizeof(rc_data.xwxapt_dir), "%s/xwxapt/", getenv("HOME") ); + snprintf( dirs[0], sizeof(dirs[0]), "%s/images/", rc_data.xwxapt_dir ); + g_mkdir_with_parents( dirs[0], 0755 ); + snprintf( dirs[1], sizeof(dirs[1]), "%s/record/", rc_data.xwxapt_dir ); + g_mkdir_with_parents( dirs[1], 0755 ); + /* Open xwxaptrc file */ - xwxaptrc = fopen( rc_fpath, "r" ); + int i=0; + for ( ; i < 3; i++ ) + { + xwxaptrc = fopen( rc_fpath[i], "r" ); + if( xwxaptrc != NULL ) + { + break; + } + } if( xwxaptrc == NULL ) { - perror( rc_fpath ); + perror( rc_fpath[i-1] ); Show_Message( _("Failed to open xwxaptrc file"), "red" ); Error_Dialog(); return( FALSE ); --- xwxapt-3.4.2/src/common.h.orig 2020-02-19 21:25:54.860000000 +0100 +++ xwxapt-3.4.2/src/common.h 2020-02-19 21:26:04.948545192 +0100 @@ -73,7 +73,7 @@ num_chn; /* Number of signal channels (2=stereo, 1=mono) */ /* xwxapt working directory and glade file */ - char xwxapt_dir[64], xwxapt_glade[64]; + char xwxapt_dir[1024], xwxapt_glade[1024]; int window_height, /* Set default widow height, in sec of image decoding */ --- xwxapt-3.4.2/Makefile.in.orig 2020-02-19 21:20:48.339700460 +0100 +++ xwxapt-3.4.2/Makefile.in 2020-02-19 22:47:12.948860412 +0100 @@ -909,7 +909,15 @@ cp -r doc/*.html $(DESTDIR)/usr/share/doc/packages/$(PACKAGE)/; \ mkdir -p $(DESTDIR)/usr/share/man/man1/; \ cp -r doc/$(PACKAGE).1.gz $(DESTDIR)/usr/share/man/man1/; \ - fi; + fi; \ + if !(test -d $(DESTDIR)/usr/share/$(PACKAGE)); then \ + mkdir -p $(DESTDIR)/usr/share/$(PACKAGE)/; \ + fi; \ + cp $(PACKAGE)/$(PACKAGE).glade $(DESTDIR)/usr/share/$(PACKAGE)/; + if !(test -d $(DESTDIR)/etc); then \ + mkdir -p $(DESTDIR)/etc/; \ + fi; \ + cp $(PACKAGE)/$(PACKAGE)rc $(DESTDIR)/etc/; # if !(test -d /home/`logname`/$(PACKAGE)); then \ # cp -r $(PACKAGE) /home/`logname`/; \ # else \
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