Merge lp:~cjwatson/launchpad/tidy-makefile into lp:launchpad

Proposed by Colin Watson on 2018-01-02
Status: Merged
Merged at revision: 18544
Proposed branch: lp:~cjwatson/launchpad/tidy-makefile
Merge into: lp:launchpad
Diff against target: 70 lines (+11/-11)
1 file modified
Makefile (+11/-11)
To merge this branch: bzr merge lp:~cjwatson/launchpad/tidy-makefile
Reviewer Review Type Date Requested Status
William Grant code 2018-01-02 Approve on 2018-01-02
Review via email: mp+335614@code.launchpad.net

Commit message

Tidy up various minor problems in the top-level Makefile.

To post a comment you must log in.
William Grant (wgrant) :
review: Approve (code)
Colin Watson (cjwatson) :
lp:~cjwatson/launchpad/tidy-makefile updated on 2018-02-01
18529. By Colin Watson on 2018-02-01

Move bits of copy-apache-config into codehosting-dir, improved slightly.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile'
2--- Makefile 2018-01-01 20:24:26 +0000
3+++ Makefile 2018-02-01 20:58:36 +0000
4@@ -141,12 +141,18 @@
5 mkdir logs
6
7 codehosting-dir:
8+ mkdir -p $(CODEHOSTING_ROOT)
9 mkdir -p $(CODEHOSTING_ROOT)/mirrors
10 mkdir -p $(CODEHOSTING_ROOT)/config
11 mkdir -p /var/tmp/bzrsync
12 touch $(CODEHOSTING_ROOT)/rewrite.log
13 chmod 777 $(CODEHOSTING_ROOT)/rewrite.log
14 touch $(CODEHOSTING_ROOT)/config/launchpad-lookup.txt
15+ifneq ($(SUDO_UID),)
16+ if [ "$$(id -u)" = 0 ]; then \
17+ chown -R $(SUDO_UID):$(SUDO_GID) $(CODEHOSTING_ROOT); \
18+ fi
19+endif
20
21 inplace: build logs clean_logs codehosting-dir
22 if [ -d /srv/launchpad.dev ]; then \
23@@ -205,8 +211,7 @@
24 ln -sfn ../../yarn/node_modules/yui $@
25
26 $(LP_JS_BUILD): | $(JS_BUILD_DIR)
27- -mkdir $@
28- -mkdir $@/services
29+ mkdir -p $@/services
30 for jsdir in lib/lp/*/javascript lib/lp/services/*/javascript; do \
31 app=$$(echo $$jsdir | sed -e 's,lib/lp/\(.*\)/javascript,\1,'); \
32 cp -a $$jsdir $@/$$app; \
33@@ -398,16 +403,13 @@
34 # it does everything expected from a clean target. When the
35 # referenced bug is fixed, this target may be reunited with
36 # the 'clean' target.
37- $(MAKE) -C sourcecode/pygettextpo clean
38- # XXX gary 2009-11-16 bug 483782
39- # The pygettextpo Makefile should have this next line in it for its make
40- # clean, and then we should remove this line.
41- $(RM) sourcecode/pygpgme/gpgme/*.so
42+ if test -f sourcecode/pygettextpo/Makefile; then \
43+ $(MAKE) -C sourcecode/pygettextpo clean; \
44+ fi
45 if test -f sourcecode/mailman/Makefile; then \
46 $(MAKE) -C sourcecode/mailman clean; \
47 fi
48 $(RM) -r env
49- $(RM) -r lib/subvertpy/*.so
50 $(RM) -r $(LP_BUILT_JS_ROOT)/*
51 $(RM) -r $(CODEHOSTING_ROOT)/*
52 $(RM) -r $(APIDOC_DIR)
53@@ -458,7 +460,7 @@
54 cp configs/development/launchpad.crt /etc/apache2/ssl/
55 cp configs/development/launchpad.key /etc/apache2/ssl/
56
57-copy-apache-config:
58+copy-apache-config: codehosting-dir
59 # We insert the absolute path to the branch-rewrite script
60 # into the Apache config as we copy the file into position.
61 set -e; \
62@@ -472,8 +474,6 @@
63 -e 's,%LISTEN_ADDRESS%,$(LISTEN_ADDRESS),' \
64 configs/development/local-launchpad-apache > \
65 /etc/apache2/sites-available/$$base
66- touch $(CODEHOSTING_ROOT)/rewrite.log
67- chown -R $(SUDO_UID):$(SUDO_GID) $(CODEHOSTING_ROOT)
68 if [ ! -d /srv/launchpad.dev ]; then \
69 mkdir /srv/launchpad.dev; \
70 chown $(SUDO_UID):$(SUDO_GID) /srv/launchpad.dev; \