Re: [ptxdist] [PATCH 2/3] usb-ids: new package

2019-10-02 Thread Michael Olbrich
On Tue, Oct 01, 2019 at 01:15:19PM +0200, Roland Hieber wrote:
> The usb.ids file is no longer installed by usbutils since v008, create a
> new package to fetch it. Since the file is not a tarball, we cannot use
> $(call extract) and need to extract it ourselves.
> 
> Signed-off-by: Roland Hieber 
> ---
>  rules/usb-ids.in   |  4 ++
>  rules/usb-ids.make | 92 ++
>  2 files changed, 96 insertions(+)
>  create mode 100644 rules/usb-ids.in
>  create mode 100644 rules/usb-ids.make
> 
> diff --git a/rules/usb-ids.in b/rules/usb-ids.in
> new file mode 100644
> index ..8c447c5c2c47
> --- /dev/null
> +++ b/rules/usb-ids.in
> @@ -0,0 +1,4 @@
> +## SECTION=shell_and_console
> +
> +config USB_IDS
> + tristate
> diff --git a/rules/usb-ids.make b/rules/usb-ids.make
> new file mode 100644
> index ..904cec9537d6
> --- /dev/null
> +++ b/rules/usb-ids.make
> @@ -0,0 +1,92 @@
> +# -*-makefile-*-
> +#
> +# Copyright (C) 2019 by Roland Hieber 
> +#
> +# For further information about the PTXdist project and license conditions
> +# see the README file.
> +#
> +
> +#
> +# We provide this package
> +#
> +PACKAGES-$(PTXCONF_USB_IDS) += usb-ids
> +
> +#
> +# Paths and names
> +#
> +USB_IDS_VERSION  := 0
> +USB_IDS_MD5  := 47a791eab0bf9aa41a33a82bbccaedb3
> +USB_IDS  := usb-ids
> +USB_IDS_SUFFIX   := bz2
> +USB_IDS_URL  := http://www.linux-usb.org/usb.ids.$(USB_IDS_SUFFIX)

This won't work. You'll get a different file from the same URL as soon as
the data changes.

> +USB_IDS_SOURCE   := $(SRCDIR)/$(USB_IDS).$(USB_IDS_SUFFIX)
> +USB_IDS_DIR  := $(BUILDDIR)/$(USB_IDS)
> +USB_IDS_LICENSE  := GPL-2.0-or-later OR BSD-3-Clause
> +
> +# 
> 
> +# Extract
> +# 
> 
> +
> +$(STATEDIR)/usb-ids.extract:
> + @$(call targetinfo)
> + @$(call clean, $(USB_IDS_DIR))
> + @mkdir -p $(USB_IDS_DIR) && \
> + cd $(USB_IDS_DIR) && \
> + bzcat $(USB_IDS_SOURCE) > usb.ids
> + @$(call touch)
> +
> +# 
> 
> +# Prepare
> +# 
> 
> +
> +$(STATEDIR)/usb-ids.prepare:
> + @$(call targetinfo)
> + @$(call touch)
> +
> +# 
> 
> +# Compile
> +# 
> 
> +
> +$(STATEDIR)/usb-ids.compile:
> + @$(call targetinfo)
> + @$(call touch)
> +
> +# 
> 
> +# Install
> +# 
> 
> +
> +$(STATEDIR)/usb-ids.install:
> + @$(call targetinfo)
> + @mkdir -p $(USB_IDS_PKGDIR)/usr/share/
> + @cd $(USB_IDS_DIR) && \
> + install -m0644 usb.ids $(USB_IDS_PKGDIR)/usr/share/
> + @$(call touch)
> +
> +# 
> 
> +# Target-Install
> +# 
> 
> +
> +$(STATEDIR)/usb-ids.targetinstall:
> + @$(call targetinfo)
> +
> + @$(call install_init, usb-ids)
> + @$(call install_fixup, usb-ids,PRIORITY,optional)
> + @$(call install_fixup, usb-ids,SECTION,base)
> + @$(call install_fixup, usb-ids,AUTHOR,"Roland Hieber 
> ")
> + @$(call install_fixup, usb-ids,DESCRIPTION,missing)
> +
> + @$(call install_copy, usb-ids, 0, 0, 0644, -, /usr/share/usb.ids)
> +
> + @$(call install_finish, usb-ids)
> +
> + @$(call touch)
> +
> +# 
> 
> +# Clean
> +# 
> 
> +
> +#$(STATEDIR)/usb-ids.clean:
> +#@$(call targetinfo)
> +#@$(call clean_pkg, USB_IDS)

Remove.

Michael

> +
> +# vim: syntax=make
> -- 
> 2.23.0
> 
> 
> ___
> ptxdist mailing list
> ptxdist@pengutronix.de
> 

-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

___
ptxdist mailing list
ptxdist@pengutronix.de


Re: [ptxdist] [PATCH 2/3] usb-ids: new package

2019-10-02 Thread Roland Hieber
On Tue, Oct 01, 2019 at 06:12:37PM +0200, Alexander Dahl wrote:
> Hello Roland,
> 
> Am Dienstag, 1. Oktober 2019, 13:15:19 CEST schrieb Roland Hieber:
> > The usb.ids file is no longer installed by usbutils since v008, create a
> > new package to fetch it. Since the file is not a tarball, we cannot use
> > $(call extract) and need to extract it ourselves.
> > 
> > Signed-off-by: Roland Hieber 
> > ---
> >  rules/usb-ids.in   |  4 ++
> >  rules/usb-ids.make | 92 ++
> >  2 files changed, 96 insertions(+)
> >  create mode 100644 rules/usb-ids.in
> >  create mode 100644 rules/usb-ids.make
> > 
> > diff --git a/rules/usb-ids.in b/rules/usb-ids.in
> > new file mode 100644
> > index ..8c447c5c2c47
> > --- /dev/null
> > +++ b/rules/usb-ids.in
> > @@ -0,0 +1,4 @@
> > +## SECTION=shell_and_console
> > +
> > +config USB_IDS
> > +   tristate
> > diff --git a/rules/usb-ids.make b/rules/usb-ids.make
> > new file mode 100644
> > index ..904cec9537d6
> > --- /dev/null
> > +++ b/rules/usb-ids.make
> > @@ -0,0 +1,92 @@
> > +# -*-makefile-*-
> > +#
> > +# Copyright (C) 2019 by Roland Hieber 
> > +#
> > +# For further information about the PTXdist project and license conditions
> > +# see the README file.
> > +#
> > +
> > +#
> > +# We provide this package
> > +#
> > +PACKAGES-$(PTXCONF_USB_IDS) += usb-ids
> > +
> > +#
> > +# Paths and names
> > +#
> > +USB_IDS_VERSION:= 0
> > +USB_IDS_MD5:= 47a791eab0bf9aa41a33a82bbccaedb3
> > +USB_IDS:= usb-ids
> > +USB_IDS_SUFFIX := bz2
> > +USB_IDS_URL:= http://www.linux-usb.org/usb.ids.$(USB_IDS_SUFFIX)
> > +USB_IDS_SOURCE := $(SRCDIR)/$(USB_IDS).$(USB_IDS_SUFFIX)
> > +USB_IDS_DIR:= $(BUILDDIR)/$(USB_IDS)
> > +USB_IDS_LICENSE:= GPL-2.0-or-later OR BSD-3-Clause
> > +
> > +#
> > ---
> > - +# Extract
> > +#
> > ---
> > - +
> > +$(STATEDIR)/usb-ids.extract:
> > +   @$(call targetinfo)
> > +   @$(call clean, $(USB_IDS_DIR))
> > +   @mkdir -p $(USB_IDS_DIR) && \
> > +   cd $(USB_IDS_DIR) && \
> > +   bzcat $(USB_IDS_SOURCE) > usb.ids
> > +   @$(call touch)
> 
> Is there a benefit of calling bzcat and redirecting the output, instead of 
> just calling bunzip2?

Yes. bunzip2 deletes the source file and saves the extracted file to the
same folder, but here we want a different output.

 - Roland

> 
> > +
> > +#
> > ---
> > - +# Prepare
> > +#
> > ---
> > - +
> > +$(STATEDIR)/usb-ids.prepare:
> > +   @$(call targetinfo)
> > +   @$(call touch)
> > +
> > +#
> > ---
> > - +# Compile
> > +#
> > ---
> > - +
> > +$(STATEDIR)/usb-ids.compile:
> > +   @$(call targetinfo)
> > +   @$(call touch)
> > +
> > +#
> > ---
> > - +# Install
> > +#
> > ---
> > - +
> > +$(STATEDIR)/usb-ids.install:
> > +   @$(call targetinfo)
> > +   @mkdir -p $(USB_IDS_PKGDIR)/usr/share/
> > +   @cd $(USB_IDS_DIR) && \
> > +   install -m0644 usb.ids $(USB_IDS_PKGDIR)/usr/share/
> > +   @$(call touch)
> > +
> > +#
> > ---
> > - +# Target-Install
> > +#
> > ---
> > - +
> > +$(STATEDIR)/usb-ids.targetinstall:
> > +   @$(call targetinfo)
> > +
> > +   @$(call install_init, usb-ids)
> > +   @$(call install_fixup, usb-ids,PRIORITY,optional)
> > +   @$(call install_fixup, usb-ids,SECTION,base)
> > +   @$(call install_fixup, usb-ids,AUTHOR,"Roland Hieber
> > ") +   @$(call install_fixup,
> > usb-ids,DESCRIPTION,missing)
> > +
> > +   @$(call install_copy, usb-ids, 0, 0, 0644, -, /usr/share/usb.ids)
> > +
> > +   @$(call install_finish, usb-ids)
> > +
> > +   @$(call touch)
> > +
> > +#
> > ---
> > - +# Clean
> > +#
> > ---
> > - +
> > +#$(STATEDIR)/usb-ids.clean:
> > +#  @$(call targetinfo)
> > +#  @$(call clean_pkg, USB_IDS)
> > +
> > +# vim: syntax=make
> 
> Alex
> 
> 
> ___
> ptxdist mailing list
> ptxdist@pengutronix.de
> 

-- 
Roland Hieber | r.hie...@pengutronix.de |
Pengutronix e.K.  | https://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim | Phone: +49-5121-206917-5086 |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917- |

_

Re: [ptxdist] [PATCH 2/3] usb-ids: new package

2019-10-01 Thread Alexander Dahl
Hello Roland,

Am Dienstag, 1. Oktober 2019, 13:15:19 CEST schrieb Roland Hieber:
> The usb.ids file is no longer installed by usbutils since v008, create a
> new package to fetch it. Since the file is not a tarball, we cannot use
> $(call extract) and need to extract it ourselves.
> 
> Signed-off-by: Roland Hieber 
> ---
>  rules/usb-ids.in   |  4 ++
>  rules/usb-ids.make | 92 ++
>  2 files changed, 96 insertions(+)
>  create mode 100644 rules/usb-ids.in
>  create mode 100644 rules/usb-ids.make
> 
> diff --git a/rules/usb-ids.in b/rules/usb-ids.in
> new file mode 100644
> index ..8c447c5c2c47
> --- /dev/null
> +++ b/rules/usb-ids.in
> @@ -0,0 +1,4 @@
> +## SECTION=shell_and_console
> +
> +config USB_IDS
> + tristate
> diff --git a/rules/usb-ids.make b/rules/usb-ids.make
> new file mode 100644
> index ..904cec9537d6
> --- /dev/null
> +++ b/rules/usb-ids.make
> @@ -0,0 +1,92 @@
> +# -*-makefile-*-
> +#
> +# Copyright (C) 2019 by Roland Hieber 
> +#
> +# For further information about the PTXdist project and license conditions
> +# see the README file.
> +#
> +
> +#
> +# We provide this package
> +#
> +PACKAGES-$(PTXCONF_USB_IDS) += usb-ids
> +
> +#
> +# Paths and names
> +#
> +USB_IDS_VERSION  := 0
> +USB_IDS_MD5  := 47a791eab0bf9aa41a33a82bbccaedb3
> +USB_IDS  := usb-ids
> +USB_IDS_SUFFIX   := bz2
> +USB_IDS_URL  := http://www.linux-usb.org/usb.ids.$(USB_IDS_SUFFIX)
> +USB_IDS_SOURCE   := $(SRCDIR)/$(USB_IDS).$(USB_IDS_SUFFIX)
> +USB_IDS_DIR  := $(BUILDDIR)/$(USB_IDS)
> +USB_IDS_LICENSE  := GPL-2.0-or-later OR BSD-3-Clause
> +
> +#
> ---
> - +# Extract
> +#
> ---
> - +
> +$(STATEDIR)/usb-ids.extract:
> + @$(call targetinfo)
> + @$(call clean, $(USB_IDS_DIR))
> + @mkdir -p $(USB_IDS_DIR) && \
> + cd $(USB_IDS_DIR) && \
> + bzcat $(USB_IDS_SOURCE) > usb.ids
> + @$(call touch)

Is there a benefit of calling bzcat and redirecting the output, instead of 
just calling bunzip2?

> +
> +#
> ---
> - +# Prepare
> +#
> ---
> - +
> +$(STATEDIR)/usb-ids.prepare:
> + @$(call targetinfo)
> + @$(call touch)
> +
> +#
> ---
> - +# Compile
> +#
> ---
> - +
> +$(STATEDIR)/usb-ids.compile:
> + @$(call targetinfo)
> + @$(call touch)
> +
> +#
> ---
> - +# Install
> +#
> ---
> - +
> +$(STATEDIR)/usb-ids.install:
> + @$(call targetinfo)
> + @mkdir -p $(USB_IDS_PKGDIR)/usr/share/
> + @cd $(USB_IDS_DIR) && \
> + install -m0644 usb.ids $(USB_IDS_PKGDIR)/usr/share/
> + @$(call touch)
> +
> +#
> ---
> - +# Target-Install
> +#
> ---
> - +
> +$(STATEDIR)/usb-ids.targetinstall:
> + @$(call targetinfo)
> +
> + @$(call install_init, usb-ids)
> + @$(call install_fixup, usb-ids,PRIORITY,optional)
> + @$(call install_fixup, usb-ids,SECTION,base)
> + @$(call install_fixup, usb-ids,AUTHOR,"Roland Hieber
> ") + @$(call install_fixup,
> usb-ids,DESCRIPTION,missing)
> +
> + @$(call install_copy, usb-ids, 0, 0, 0644, -, /usr/share/usb.ids)
> +
> + @$(call install_finish, usb-ids)
> +
> + @$(call touch)
> +
> +#
> ---
> - +# Clean
> +#
> ---
> - +
> +#$(STATEDIR)/usb-ids.clean:
> +#@$(call targetinfo)
> +#@$(call clean_pkg, USB_IDS)
> +
> +# vim: syntax=make

Alex


___
ptxdist mailing list
ptxdist@pengutronix.de