mirror of https://gitee.com/openkylin/cups.git
Move cupsd.conf.default from SERVERROOT to DATADIR
Origin: vendor Bug: https://github.com/apple/cups/issues/4342 Bug-Debian: https://bugs.debian.org/640124 Patch-Name: move-cupsd-conf-default-to-share.patch Gbp-Pq: Name 0017-Move-cupsd.conf.default-from-SERVERROOT-to-DATADIR.patch
This commit is contained in:
parent
b90f4adbbb
commit
843db89d68
|
@ -1629,6 +1629,7 @@ do_config_server(http_t *http) /* I - HTTP connection */
|
||||||
int ch; /* Character from file */
|
int ch; /* Character from file */
|
||||||
char filename[1024]; /* Filename */
|
char filename[1024]; /* Filename */
|
||||||
const char *server_root; /* Location of config files */
|
const char *server_root; /* Location of config files */
|
||||||
|
const char *data_dir; /* Location of data files */
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1712,7 +1713,10 @@ do_config_server(http_t *http) /* I - HTTP connection */
|
||||||
* well...
|
* well...
|
||||||
*/
|
*/
|
||||||
|
|
||||||
strlcat(filename, ".default", sizeof(filename));
|
if ((data_dir = getenv("CUPS_DATADIR")) == NULL)
|
||||||
|
data_dir = CUPS_DATADIR;
|
||||||
|
|
||||||
|
snprintf(filename, sizeof(filename), "%s/cupsd.conf.default",data_dir);
|
||||||
|
|
||||||
if (!stat(filename, &info) && info.st_size < (1024 * 1024) &&
|
if (!stat(filename, &info) && info.st_size < (1024 * 1024) &&
|
||||||
(cupsd = cupsFileOpen(filename, "r")) != NULL)
|
(cupsd = cupsFileOpen(filename, "r")) != NULL)
|
||||||
|
|
|
@ -70,7 +70,7 @@ install-data:
|
||||||
else \
|
else \
|
||||||
$(INSTALL_CONFIG) -g $(CUPS_GROUP) $$file $(SERVERROOT) ; \
|
$(INSTALL_CONFIG) -g $(CUPS_GROUP) $$file $(SERVERROOT) ; \
|
||||||
fi ; \
|
fi ; \
|
||||||
$(INSTALL_CONFIG) -g $(CUPS_GROUP) $$file $(SERVERROOT)/$$file.default; \
|
$(INSTALL_CONFIG) -g $(CUPS_GROUP) $$file $(DATADIR)/$$file.default; \
|
||||||
done
|
done
|
||||||
$(INSTALL_DIR) -m 755 $(DATADIR)/mime
|
$(INSTALL_DIR) -m 755 $(DATADIR)/mime
|
||||||
for file in $(REPLACE); do \
|
for file in $(REPLACE); do \
|
||||||
|
@ -118,9 +118,10 @@ install-libs:
|
||||||
#
|
#
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
for file in $(KEEP) $(REPLACE) cupsd.conf.default; do \
|
for file in $(KEEP) $(REPLACE); do \
|
||||||
$(RM) $(SERVERROOT)/$$file; \
|
$(RM) $(SERVERROOT)/$$file; \
|
||||||
done
|
done
|
||||||
|
$(RM) $(DATADIR)/cupsd.conf.default
|
||||||
-$(RMDIR) $(SERVERROOT)
|
-$(RMDIR) $(SERVERROOT)
|
||||||
for file in $(REPLACE); do \
|
for file in $(REPLACE); do \
|
||||||
$(RM) $(DATADIR)/mime/$$file; \
|
$(RM) $(DATADIR)/mime/$$file; \
|
||||||
|
|
Loading…
Reference in New Issue