Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit01df147

Browse files
committed
Allow selecting the git revision to be packaged by "make dist".
Commit619bc23 changed "make dist" to invoke "git archive",but hard-wired the call to specify that the HEAD revision shouldbe packaged. Our tarball building process needs to be able tospecify which git commit to package (notably, for packagingback branches). While we could make that work with some hackeryto operate in detached-HEAD state, it's a lot nicer just to exposegit archive's ability to specify what to package. Hence, inventa new make variable PG_GIT_REVISION. This is undocumented, butso is "make dist".Also make corresponding changes in the meson scripts. We have nonear-term intention of using that for package building, but itwill likely happen eventually, so stay prepared.Discussion:https://postgr.es/m/3552543.1713909947@sss.pgh.pa.us
1 parenta42fc1c commit01df147

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

‎GNUmakefile.in

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ update-unicode: | submake-generated-headers submake-libpgport
8787
distdir= postgresql-$(VERSION)
8888
dummy= =install=
8989

90+
# git revision to be packaged
91+
PG_GIT_REVISION = HEAD
92+
9093
GIT = git
9194

9295
dist: $(distdir).tar.gz $(distdir).tar.bz2
@@ -102,10 +105,10 @@ distdir-location:
102105
# on, Unix machines.
103106

104107
$(distdir).tar.gz:
105-
$(GIT) -C $(srcdir) -c core.autocrlf=false archive --format tar.gz -9 --prefix $(distdir)/HEAD -o $(abs_top_builddir)/$@
108+
$(GIT) -C $(srcdir) -c core.autocrlf=false archive --format tar.gz -9 --prefix $(distdir)/$(PG_GIT_REVISION) -o $(abs_top_builddir)/$@
106109

107110
$(distdir).tar.bz2:
108-
$(GIT) -C $(srcdir) -c core.autocrlf=false -c tar.tar.bz2.command='$(BZIP2) -c' archive --format tar.bz2 --prefix $(distdir)/HEAD -o $(abs_top_builddir)/$@
111+
$(GIT) -C $(srcdir) -c core.autocrlf=false -c tar.tar.bz2.command='$(BZIP2) -c' archive --format tar.bz2 --prefix $(distdir)/$(PG_GIT_REVISION) -o $(abs_top_builddir)/$@
109112

110113
distcheck: dist
111114
rm -rf $(dummy)

‎meson.build

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3469,6 +3469,8 @@ bzip2 = find_program('bzip2', required: false, native: true)
34693469

34703470
distdir=meson.project_name()+'-'+meson.project_version()
34713471

3472+
pg_git_revision=get_option('PG_GIT_REVISION')
3473+
34723474
# Note: core.autocrlf=false is needed to avoid line-ending conversion
34733475
# in case the environment has a different setting. Without this, a
34743476
# tarball created on Windows might be different than on, and unusable
@@ -3483,7 +3485,7 @@ tar_gz = custom_target('tar.gz',
34833485
'-9',
34843486
'--prefix', distdir+'/',
34853487
'-o',join_paths(meson.build_root(),'@OUTPUT@'),
3486-
'HEAD','.'],
3488+
pg_git_revision],
34873489
output: distdir+'.tar.gz',
34883490
)
34893491

@@ -3497,7 +3499,7 @@ if bzip2.found()
34973499
'--format','tar.bz2',
34983500
'--prefix', distdir+'/',
34993501
'-o',join_paths(meson.build_root(),'@OUTPUT@'),
3500-
'HEAD','.'],
3502+
pg_git_revision],
35013503
output: distdir+'.tar.bz2',
35023504
)
35033505
else

‎meson_options.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ option('atomics', type: 'boolean', value: true,
5555
option('spinlocks',type:'boolean',value:true,
5656
description:'Use spinlocks')
5757

58+
option('PG_GIT_REVISION',type:'string',value:'HEAD',
59+
description:'git revision to be packaged by pgdist target')
60+
5861

5962
# Compilation options
6063

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp