diff options
author | fergus.henderson <fergus.henderson@01de4be4-8c4a-0410-9132-4925637da917> | 2008-06-19 20:55:52 +0000 |
---|---|---|
committer | fergus.henderson <fergus.henderson@01de4be4-8c4a-0410-9132-4925637da917> | 2008-06-19 20:55:52 +0000 |
commit | e1770a6bc7390247df76ff3bae2c9d0793299306 (patch) | |
tree | 10cbb782c35171a2c6bd953095d1532462c8c8bb | |
parent | 07c3479df1781b3d45b2fa29b30935fef3a27ef2 (diff) | |
download | distcc-e1770a6bc7390247df76ff3bae2c9d0793299306.tar.gz |
Change the deb.sh and rpm.sh scripts to remove old .deb or .rpm
files (for the same package and version) before generating the new ones.
Similarly change "make install-deb" and "make upload-dist" so that
they are more selective in which files they install.
This fixes a bug where "make install-deb" tried to install the wrong
.deb files, because it just did "rpm -i *.deb", and there can be old
.deb files lying around. It also fixes a similar problem in "make
upload-dist".
Also, add a "tags" target to the Makefile.
Reviewers: Craig Silverstein
git-svn-id: http://distcc.googlecode.com/svn/trunk@525 01de4be4-8c4a-0410-9132-4925637da917
-rw-r--r-- | Makefile.in | 20 | ||||
-rwxr-xr-x | packaging/deb.sh | 12 | ||||
-rwxr-xr-x | packaging/rpm.sh | 5 |
3 files changed, 28 insertions, 9 deletions
diff --git a/Makefile.in b/Makefile.in index 9194411..11d5f8e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -222,6 +222,9 @@ tarball_sig_bz2 = $(tarball_bz2).asc tarball_sig_gz = $(tarball_gz).asc distnews = $(PACKAGE_TARNAME)-$(VERSION).NEWS +rpm_glob_pattern = "$(PACKAGE)"*[-_.]"$(VERSION)"[-_.]*.deb +deb_glob_pattern = "$(PACKAGE)"*[-_.]"$(VERSION)"[-_.]*.rpm + common_obj = src/arg.o src/argutil.o \ src/cleanup.o src/compress.o \ src/trace.o src/util.o src/io.o src/exec.o \ @@ -946,30 +949,32 @@ upload-man: $(man_HTML) upload-dist: alldist -$(MAKE) upload-man "$(srcdir)/packaging/googlecode_upload.py" \ - `find . -name '*.tar.gz' -o -name '*.tar.bz2' \ - -o -name '*.rpm' -o -name '*.deb'` + "$(tarball_gz)" \ + "$(tarball_bz2)" \ + packaging/$(rpm_glob_pattern) \ + packaging/$(deb_glob_pattern) rpm: dist packaging/rpm.sh packaging/RedHat/rpm.spec cd packaging && ./rpm.sh $(PACKAGE) $(VERSION) # This uses the output of 'make rpm' to convert rpm files to deb files deb: rpm packaging/deb.sh - cd packaging && ./deb.sh *.rpm + cd packaging && ./deb.sh $(PACKAGE) $(VERSION) *.rpm # We copy .deb files to /tmp to avoid problems with NFS root_squash. install-deb: deb tmpdir=`mktemp -d /tmp/distcc-install-deb-XXXXXX` && \ cp packaging/*.deb $$tmpdir && \ cd "$$tmpdir" && \ - sudo dpkg -i *.deb && \ + sudo dpkg -i $(deb_glob_pattern) && \ rm -rf $$tmpdir # deb creates rpm files first, which in turn creates .gz files alldist: deb @echo dist files created: @ls -1 "$(tarball_gz)" "$(tarball_bz2)" - @ls -1 packaging/*[-_.]"$(VERSION)"[-_.]*.rpm - @ls -1 packaging/*[-_.]"$(VERSION)"[-_.]*.deb + @ls -1 packaging/$(rpm_glob_pattern) + @ls -1 packaging/$(deb_glob_pattern) ### INSTALL (and UNINSTALL) targets @@ -1160,3 +1165,6 @@ uninstall-conf: file="$(DESTDIR)$(sysconfdir)/default/`basename $$p`";\ if [ -e "$$file" ]; then rm -fv "$$file"; fi \ done + +tags: $(SRC) $(HEADERS) + ctags --defines --globals --typedefs-and-c++ --no-warn $(SRC) $(HEADERS) diff --git a/packaging/deb.sh b/packaging/deb.sh index c347998..a38b239 100755 --- a/packaging/deb.sh +++ b/packaging/deb.sh @@ -1,10 +1,18 @@ #!/bin/sh -e -# This takes a list of rpms to convert to .deb files. It puts them -# all under a debian-* directory under the current directory. +# This takes a package name and version, +# and a list of rpms to convert to .deb files. +# It puts them all under a debian-* directory under the current directory. # # Run this from the 'packaging' directory, just under rootdir +PACKAGE="$1"; +VERSION="$2"; +shift; shift; + +# Clean out any old .deb files from a previous build. +rm -f "$PACKAGE"*[-._]"$VERSION".deb + for file in "$@"; do fakeroot alien -c -k -v "$file" done diff --git a/packaging/rpm.sh b/packaging/rpm.sh index 492489d..72fc0d5 100755 --- a/packaging/rpm.sh +++ b/packaging/rpm.sh @@ -74,8 +74,11 @@ rpmbuild -bb RedHat/rpm.spec \ --define "_builddir $RPM_BUILD_DIR" \ --define "_rpmdir $RPM_SOURCE_DIR" +# Clean out any existing rpms from a previous build. +rm -f "$PACKAGE"*[-._]"$VERSION"[-._]*.rpm + # We want to get not only the main package but devel etc, hence the middle * -mv "$RPM_SOURCE_DIR"/*/"${PACKAGE}"-*"${VERSION}"*.rpm . +mv "$RPM_SOURCE_DIR"/*/"$PACKAGE"-*"$VERSION"*.rpm . echo echo "The rpm package file(s) are located in $PWD:" |