Commit Graph

9 Commits

Author SHA1 Message Date
Moshe Kaplan 87ca8c227a tools: Port make-version.pl to Python 2022-07-11 14:44:23 +00:00
Gerald Combs c5e265f852 CMake: Deduplicate some version variables.
Use PROJECT_VERSION instead of VERSION. Prepend "PROJECT_" or
"LOG_PROJECT_" as needed to other variables. Remove the leftover unused
variables.
2022-06-07 16:04:17 -07:00
Gerald Combs c5b983c93a Packaging: Ignore the return value of git stash.
Make sure we don't trigger '-e'.

[skip ci]
2022-05-11 11:11:53 -07:00
John Thacker 81c67b3e05 packaging: Provide workaround for rpm-package from source tarball
Users might want to download a source tarball and build an RPM
package from it.

Have git-export-release.sh use git-archive's 'export-subst' feature
so that it can detect whether it is being run from a git repository
versus run from source extracted from a tarball produced by git-archive.

In the latter case, produce a helpful console message telling the
user to copy the downloaded tarball into the binary directory so
that the rpm-package target can succeed. Also update the Developer's
Guide to suggest this as well.

We could try to create our own archive using tar, but there are
several possible gotchas, such as in-source builds, excluding a build
directory that is a subdirectory of the source dir, excluding unknown
different build directories from previous builds, dealing with different
options in different versions of tar, etc. This is good enough for
the common case, and anyone who wants something more complicated can
hopefully create their own tarball.

Fix #15167
2022-05-06 00:13:28 +00:00
John Thacker 84515e3175 Packaging: Only preserve a tarball if the commit ID matches
Tarballs created by git archive have the commit ID stored in their
header. Only preserve a preexisting tarball if that commit ID matches
that of the current commit, even if the versions match.

Fix the creation of a temporary commit for when the working directory
does not match the tree. (When git diff-index is called without
--quiet or --exit-code, the exit code is success even when there
are differences). Use git stash create, as it is intended for scripts
like this; it creates a temporary stash not stored in the ref namespace
which does not require being popped later, and does nothing and outputs
the empty string instead of a commit ID if there are no local changes.

This helps when generating tarballs or building rpm packages repeatedly
out of a changing working tree.
2022-04-28 02:02:39 +00:00
John Thacker 007883408f packaging: Fix git-export-release.sh when CI_COMMIT_SHA undefined
Commit 0d820ddc8d added set -u to
the script, so the test for CI_COMMIT_SHA (added in commit
e7296d5208) needs to be changed
so there isn't a fatal error if it is unset.
2022-01-05 01:21:08 +00:00
Gerald Combs e7296d5208 Packaging: Try to fix git-export-release.sh.
Attempting to release 3.5.0 failed with

No local changes to save
Creating ./wireshark-3.5.0.tar.xz
fatal: not a valid object name: stash@{0}

Use CI_COMMIT_SHA for our export commit if it exists.
2021-08-27 11:13:45 -07:00
Gerald Combs 0d820ddc8d Packaging+GitLab CI: Dist tarball updates.
Ninja keeps track of its built files in .ninja_log, so if you copy a
pre-built target into a fresh build directory, Ninja will ignore and
overwrite it. This includes the tarball generated by the 'dist' target.

In get-export-release.sh, check for a preexisting tarball and preserve
it by default. This lets us pass the dist tarball from one GitLab CI
stage to other stages without recreating it. It's also arguably the
right thing to do in general, since we record and publish the tarball
hashes for each release and different contents for the same filename can
cause confusion.

Move the dist tarball to the build directory in .gitlab-ci.yml, and add
a note about using the tarball exclusively.
2021-01-09 19:16:16 +00:00
Gerald Combs 290214adc9 tarball+RPM: Fetch our version from CMake.
Move git-export-release.sh to packaging/source. Have the source and RPM
packaging derive version information from CMake's VERSION variable. This
brings them in line with the rest of our packaging and avoids having to
read chicken entrails^W^Wgit output.

Make sure we always generate wireshark.spec.

Bug: 15359
Change-Id: I188efda489c94449a10a612abebf9c2872c305cb
Reviewed-on: https://code.wireshark.org/review/31504
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-01-14 17:41:43 +00:00