tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: distfile renaming - éclaire-moi, svp



Am 14.05.2019 um 07:36 schrieb Jason Thorpe:
> Howdy folks...
>
> I have a situation where I want to add a prefix to some distfiles I'm downloading...
>
> Specifically, let's say I have distfiles "foo", "bar", and "quux" on the distribution server (GitHub, in this case).  When I download them, I want them to land in pkgsrc/distfiles as "oink-foo", "oink-bar", and "oink-quux".
>
> I'm downloading them using this pattern:
>
> FOO=                  foo
> DISTFILES+=      ${FOO}
> SITES.${FOO}=   ${MASTER_SITE_GITHUB:=piggy/wiggly/blob/oink/}
>
> I want that file to be "oink-foo" in pkgsrc/distfiles.

DISTFILES+=     oink-${FOO}
SITES.${FOO}=   ${MASTER_SITE_GITHUB:@url@ \
                    -${url}piggy/wiggly/blob/oink/${FOO} @}

DISTFILES contains the filenames as they appear in DISTDIR. Therefore
the oink needs to go in there.

The URL from which to download the file doesn't need the oink prefix. It
deviates though from the usual convention that the URL ends with the
DISTFILE. When prefixed with "-", a fetch URL does not have the DISTFILE
appended to it.

If you don't like the :@ modifier, you can also do the URL
transformation in two separate steps:

SITES.${FOO}= \
    ${MASTER_SITE_GITHUB:S,^,-,:=piggy/wiggly/blob/oink/${FOO}}


Home | Main Index | Thread Index | Old Index