Skip to content

Commit fcfe8db

Browse files
committed
Keep the owner:group of the one downloading the tarball
In the scenario: ./configure --prefix=<something_which_needs_su/sudo> make domserver <as unpriviliged user which downloaded the tarball> sudo make-installdomserver <as root> We would copy the Nelmiodoc files as root, so the user can't run a make {dist}clean without errors as we can't remove the folder as its owned by root. See #2303 (comment) for the reasoning behind this. So we replace phony copy-bundle-assets target by a real one. This makes that we don't rerun the rule during `domserver-install` if it already ran during `domserver`, so that if you install as root, the local files are still owned by the user who first ran `make domserver`, not root. This does assume that if the directory `public/bundles/nelmioapidoc` exists, then it contains the assets, and these won't automatically get updated, for example, in the setting of a maintainer-install so there we always remove the directory and recreate it.
1 parent a64595c commit fcfe8db

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

webapp/Makefile

+10-9
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ include $(TOPDIR)/Makefile.global
99
# Subdirectories to recurse into for REC_TARGETS
1010
SUBDIRS = config
1111

12-
domserver: composer-dump-autoload
12+
domserver: composer-dump-autoload public/bundles/nelmioapidoc
1313

1414
# Install PHP dependencies
1515
composer-dependencies:
@@ -43,20 +43,17 @@ composer-dump-autoload-dev:
4343
@echo "# the DOMjudge Symfony application in developer mode. Adjust as needed." >> $@
4444
@echo "APP_ENV=dev" >> $@
4545

46-
copy-bundle-assets:
46+
public/bundles/nelmioapidoc:
4747
# We can not use bin/console here, as when using a fakeroot,
4848
# the include paths are broken. We just copy in the data we need
49-
-rm -rf public/bundles/nelmioapidoc
50-
mkdir -p public/bundles/nelmioapidoc
51-
cp -R vendor/nelmio/api-doc-bundle/public/* public/bundles/nelmioapidoc/
49+
mkdir -p $@
50+
cp -a vendor/nelmio/api-doc-bundle/public/* $@
5251

5352
clean-l:
5453
-rm -rf public/bundles/nelmioapidoc
5554
-rm -f vendor/autoload_runtime.php
5655

5756
install-domserver:
58-
# This must be done first to install with the rest.
59-
$(MAKE) copy-bundle-assets
6057
$(INSTALL_DIR) $(DESTDIR)$(domserver_webappdir);
6158
for d in bin config migrations public resources src templates tests vendor; do \
6259
$(call install_tree,$(DESTDIR)$(domserver_webappdir),$$d) ; \
@@ -71,12 +68,16 @@ maintainer-conf: .env.local
7168

7269
maintainer-install: composer-dump-autoload-dev
7370

71+
maintainer-install-l:
72+
# This must be done first to install with the rest.
73+
-rm -rf public/bundles/nelmioapidoc
74+
$(MAKE) public/bundles/nelmioapidoc
75+
7476
maintainer-clean-l:
7577
-for d in cache log ; do \
7678
for t in dev prod ; do \
7779
rm -rf var/$$d/$$t ; \
7880
done ; \
7981
done
8082

81-
.PHONY: composer-dump-autoload composer-dump-autoload-dev \
82-
copy-bundle-assets
83+
.PHONY: composer-dump-autoload composer-dump-autoload-dev

0 commit comments

Comments
 (0)