public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] build: Exclude cscope and tags files from packaging
@ 2018-05-17 13:48 L. Alberto Giménez
  2018-05-21 13:06 ` Riku Voipio
  0 siblings, 1 reply; 3+ messages in thread
From: L. Alberto Giménez @ 2018-05-17 13:48 UTC (permalink / raw)
  To: linux-kernel; +Cc: Masahiro Yamada, Michal Marek, linux-kbuild

When building a Debian package, cscope and tags generated files are
accounted in the Debian packaging process, even causing some errors
under some circumstances (generating diff between "pristine" tar and
"patched sources").

Ignore these generated files for packaging related purposes.

Signed-off-by: L. Alberto Giménez <agimenez@sysvalve.es>
---
 Makefile                 | 5 ++++-
 scripts/package/Makefile | 4 ++--
 scripts/package/mkspec   | 6 +++---
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index ba3106b36597..0b862a544a6a 100644
--- a/Makefile
+++ b/Makefile
@@ -453,11 +453,14 @@ export MODVERDIR := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/).tmp_ve
 # Files to ignore in find ... statements
 
 export RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o    \
-			  -name CVS -o -name .pc -o -name .hg -o -name .git \) \
+			  -name CVS -o -name .pc -o -name .hg -o -name .git -o \
+			  -name tags -o -name 'cscope*' \) \
 			  -prune -o
 export RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn \
 			 --exclude CVS --exclude .pc --exclude .hg --exclude .git
 
+export TAR_EXTRA_IGNORE := --exclude tags --exclude 'cscope*'
+
 # ===========================================================================
 # Rules shared between *config targets and build targets
 
diff --git a/scripts/package/Makefile b/scripts/package/Makefile
index 73503ebce632..520532b3bcb2 100644
--- a/scripts/package/Makefile
+++ b/scripts/package/Makefile
@@ -44,7 +44,7 @@ if test "$(objtree)" != "$(srctree)"; then \
 	false; \
 fi ; \
 $(srctree)/scripts/setlocalversion --save-scmversion; \
-tar -cz $(RCS_TAR_IGNORE) -f $(2).tar.gz \
+tar -cz $(RCS_TAR_IGNORE) $(TAR_EXTRA_IGNORE) -f $(2).tar.gz \
 	--transform 's:^:$(2)/:S' $(TAR_CONTENT) $(3); \
 rm -f $(objtree)/.scmversion
 
@@ -73,7 +73,7 @@ deb-pkg: FORCE
 	$(call cmd,src_tar,$(KDEB_SOURCENAME))
 	origversion=$$(dpkg-parsechangelog -SVersion |sed 's/-[^-]*$$//');\
 		mv $(KDEB_SOURCENAME).tar.gz ../$(KDEB_SOURCENAME)_$${origversion}.orig.tar.gz
-	+dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) -i.git -us -uc
+	+dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) -i'(.git|cscope.*)' -us -uc
 
 bindeb-pkg: FORCE
 	$(CONFIG_SHELL) $(srctree)/scripts/package/mkdebian
diff --git a/scripts/package/mkspec b/scripts/package/mkspec
index e05646dc24dc..e966a87c0011 100755
--- a/scripts/package/mkspec
+++ b/scripts/package/mkspec
@@ -28,9 +28,9 @@ fi
 
 PROVIDES="$PROVIDES kernel-$KERNELRELEASE"
 __KERNELRELEASE=$(echo $KERNELRELEASE | sed -e "s/-/_/g")
-EXCLUDES="$RCS_TAR_IGNORE --exclude=.tmp_versions --exclude=*vmlinux* \
---exclude=*.o --exclude=*.ko --exclude=*.cmd --exclude=Documentation \
---exclude=.config.old --exclude=.missing-syscalls.d"
+EXCLUDES="$RCS_TAR_IGNORE $TAR_EXTRA_IGNORE --exclude=.tmp_versions \
+--exclude=*vmlinux* --exclude=*.o --exclude=*.ko --exclude=*.cmd \
+--exclude=Documentation --exclude=.config.old --exclude=.missing-syscalls.d"
 
 # We can label the here-doc lines for conditional output to the spec file
 #
-- 
2.17.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] build: Exclude cscope and tags files from packaging
  2018-05-17 13:48 [PATCH] build: Exclude cscope and tags files from packaging L. Alberto Giménez
@ 2018-05-21 13:06 ` Riku Voipio
  2018-05-24  8:47   ` L. Alberto Giménez
  0 siblings, 1 reply; 3+ messages in thread
From: Riku Voipio @ 2018-05-21 13:06 UTC (permalink / raw)
  To: L. Alberto Giménez; +Cc: Masahiro Yamada, Michal Marek, linux-kbuild

On 17 May 2018 at 16:48, L. Alberto Giménez <agimenez@sysvalve.es> wrote:
> When building a Debian package, cscope and tags generated files are
> accounted in the Debian packaging process, even causing some errors
> under some circumstances (generating diff between "pristine" tar and
> "patched sources").

Honestly you should use make mrproper, if you want to spin out source
packages. If otoh you don't have a use for the source package, use
bindeb-pkg.

> Ignore these generated files for packaging related purposes.
>
> Signed-off-by: L. Alberto Giménez <agimenez@sysvalve.es>
> ---
>  Makefile                 | 5 ++++-
>  scripts/package/Makefile | 4 ++--
>  scripts/package/mkspec   | 6 +++---
>  3 files changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index ba3106b36597..0b862a544a6a 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -453,11 +453,14 @@ export MODVERDIR := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/).tmp_ve
>  # Files to ignore in find ... statements
>
>  export RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o    \
> -                         -name CVS -o -name .pc -o -name .hg -o -name .git \) \
> +                         -name CVS -o -name .pc -o -name .hg -o -name .git -o \
> +                         -name tags -o -name 'cscope*' \) \

tags and cscope are not revision control files tho.

>                           -prune -o

>  export RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn \
>                          --exclude CVS --exclude .pc --exclude .hg --exclude .git
>
> +export TAR_EXTRA_IGNORE := --exclude tags --exclude 'cscope*'
> +

Why new variable?

>  # ===========================================================================
>  # Rules shared between *config targets and build targets
>
> diff --git a/scripts/package/Makefile b/scripts/package/Makefile
> index 73503ebce632..520532b3bcb2 100644
> --- a/scripts/package/Makefile
> +++ b/scripts/package/Makefile
> @@ -44,7 +44,7 @@ if test "$(objtree)" != "$(srctree)"; then \
>         false; \
>  fi ; \
>  $(srctree)/scripts/setlocalversion --save-scmversion; \
> -tar -cz $(RCS_TAR_IGNORE) -f $(2).tar.gz \
> +tar -cz $(RCS_TAR_IGNORE) $(TAR_EXTRA_IGNORE) -f $(2).tar.gz \
>         --transform 's:^:$(2)/:S' $(TAR_CONTENT) $(3); \
>  rm -f $(objtree)/.scmversion
>
> @@ -73,7 +73,7 @@ deb-pkg: FORCE
>         $(call cmd,src_tar,$(KDEB_SOURCENAME))
>         origversion=$$(dpkg-parsechangelog -SVersion |sed 's/-[^-]*$$//');\
>                 mv $(KDEB_SOURCENAME).tar.gz ../$(KDEB_SOURCENAME)_$${origversion}.orig.tar.gz
> -       +dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) -i.git -us -uc
> +       +dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) -i'(.git|cscope.*)' -us -uc
>
>  bindeb-pkg: FORCE
>         $(CONFIG_SHELL) $(srctree)/scripts/package/mkdebian
> diff --git a/scripts/package/mkspec b/scripts/package/mkspec
> index e05646dc24dc..e966a87c0011 100755
> --- a/scripts/package/mkspec
> +++ b/scripts/package/mkspec
> @@ -28,9 +28,9 @@ fi
>
>  PROVIDES="$PROVIDES kernel-$KERNELRELEASE"
>  __KERNELRELEASE=$(echo $KERNELRELEASE | sed -e "s/-/_/g")
> -EXCLUDES="$RCS_TAR_IGNORE --exclude=.tmp_versions --exclude=*vmlinux* \
> ---exclude=*.o --exclude=*.ko --exclude=*.cmd --exclude=Documentation \
> ---exclude=.config.old --exclude=.missing-syscalls.d"
> +EXCLUDES="$RCS_TAR_IGNORE $TAR_EXTRA_IGNORE --exclude=.tmp_versions \
> +--exclude=*vmlinux* --exclude=*.o --exclude=*.ko --exclude=*.cmd \
> +--exclude=Documentation --exclude=.config.old --exclude=.missing-syscalls.d"

I take we now have three variants of "exclude these files ending up in
the packages" lists - tar, rpm and .deb. Each choosing slightly
different of subset of files listed in .gitignore. This does not seem
very maintainable.

Riku

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] build: Exclude cscope and tags files from packaging
  2018-05-21 13:06 ` Riku Voipio
@ 2018-05-24  8:47   ` L. Alberto Giménez
  0 siblings, 0 replies; 3+ messages in thread
From: L. Alberto Giménez @ 2018-05-24  8:47 UTC (permalink / raw)
  To: Riku Voipio; +Cc: Masahiro Yamada, Michal Marek, linux-kbuild

On Mon, May 21, 2018 at 04:06:15PM +0300, Riku Voipio wrote:
> On 17 May 2018 at 16:48, L. Alberto Giménez <agimenez@sysvalve.es> wrote:
> > When building a Debian package, cscope and tags generated files are
> > accounted in the Debian packaging process, even causing some errors
> > under some circumstances (generating diff between "pristine" tar and
> > "patched sources").
> 
> Honestly you should use make mrproper, if you want to spin out source
> packages. If otoh you don't have a use for the source package, use
> bindeb-pkg.

Well, to be honest I just wanted a .deb file to distribute to my VM in order to test
and squash some bugs quickly, and in my machine, it was causing a recompilation every
time I tried to build a new package, (26 minutes withh allyes).

I just wanted to speed up things and avoid the full compilation that deb-pkg was
doing (and mrproper would cause anyway) if I already had everything done.

But I realized that bindeb-pkg does just what I want, so you can ignore this patch,
sorry for the inconvenience.


Regards,
-- 
L. Alberto Giménez
GnuPG key ID 0xDD4E27AB

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-24  8:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-17 13:48 [PATCH] build: Exclude cscope and tags files from packaging L. Alberto Giménez
2018-05-21 13:06 ` Riku Voipio
2018-05-24  8:47   ` L. Alberto Giménez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox