You are not logged in.

#1 2021-03-31 12:55:42

tori404
Member
Registered: 2021-03-31
Posts: 4

[SOLVED-Potential Bug] Sources with whitespaces in PKGBUILD

Hello all, I feel like this is a newbie question, but I've scoured the internet for answers and am at my wits end.

I'm trying to build a very simple package including 4 font files so I can teach myself about the process as well as customize my newly built environment.

Here's the PKGBUILD (work in progress) :

pkgname=ttf-meslo-nerdfont
pkgver=1.0
pkgrel=1
pkgdesc="Standalone Meslo Nerd Font patched for Powerlevel10k"
arch=("any")
url="https://github.com/romkatv/powerlevel10k-media/"
license=('Apache')
depends=('fontconfig')
provides=( ${pkgname} )
source=('Meslo LGS NF Regular.ttf::https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf'
              'Meslo LGS NF Bold.ttf::https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold.ttf'
              'Meslo LGS NF Italic.ttf::https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Italic.ttf'
              'Meslo LGS NF Bold Italic.ttf::https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold%20Italic.ttf')
sha1sums=('SKIP'
          'SKIP'
          'SKIP'
          'SKIP')
package() {
  find . -iname "*.ttf"
}

And here's the output of makepkg :

==> Making package: ttf-meslo-nerdfont 1.0-1 (Wed 31 Mar 2021 02:50:06 PM CEST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Downloading Meslo
LGS
NF
Regular.ttf...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   162  100   162    0     0    382      0 --:--:-- --:--:-- --:--:--   382
100 1262k  100 1262k    0     0  1088k      0  0:00:01  0:00:01 --:--:-- 2758k
  -> Downloading Meslo
LGS
NF
Bold.ttf...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   159  100   159    0     0    366      0 --:--:-- --:--:-- --:--:--   367
100 1271k  100 1271k    0     0   920k      0  0:00:01  0:00:01 --:--:-- 1859k
  -> Downloading Meslo
LGS
NF
Italic.ttf...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   161  100   161    0     0    342      0 --:--:-- --:--:-- --:--:--   342
100 1222k  100 1222k    0     0   903k      0  0:00:01  0:00:01 --:--:--  903k
  -> Downloading Meslo
LGS
NF
Bold
Italic.ttf...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   168    0   168    0     0    395      0 --:--:-- --:--:-- --:--:--   394
100 1230k  100 1230k    0     0   790k      0  0:00:01  0:00:01 --:--:-- 1514k
==> Validating source files with sha1sums...
    Meslo
LGS
NF
Regular.ttf ... Skipped
    Meslo
LGS
NF
Bold.ttf ... Skipped
    Meslo
LGS
NF
Bold
Italic.ttf ... Skipped
==> Extracting sources...
==> Entering fakeroot environment...
==> Starting package()...
./Meslo?LGS?NF?Bold?Italic.ttf
./Meslo?LGS?NF?Bold.ttf
./Meslo?LGS?NF?Italic.ttf
./Meslo?LGS?NF?Regular.ttf
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Stripping unneeded symbols from binaries and libraries...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "ttf-meslo-nerdfont"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: ttf-meslo-nerdfont 1.0-1 (Wed 31 Mar 2021 02:50:14 PM CEST)

And the ouptput of ls :

'Meslo'$'\n''LGS'$'\n''NF'$'\n''Bold'$'\n''Italic.ttf'   pkg
'Meslo'$'\n''LGS'$'\n''NF'$'\n''Bold.ttf'                PKGBUILD
'Meslo'$'\n''LGS'$'\n''NF'$'\n''Italic.ttf'              src
'Meslo'$'\n''LGS'$'\n''NF'$'\n''Regular.ttf'             ttf-meslo-nerdfont-1.0-1-any.pkg.tar.zst

As you can see, the spaces in the filenames in PKGBUILD are interpreted as newlines. I've tried all sorts of escape sequences, quoting, double-quoting... all to no avail.

While there are different ways to achieve the end goal differently, I'd like to know how to solve this specific issues.
Thanks!

Last edited by tori404 (2021-03-31 14:56:34)

Offline

#2 2021-03-31 13:08:26

Morn
Member
Registered: 2012-09-02
Posts: 886

Re: [SOLVED-Potential Bug] Sources with whitespaces in PKGBUILD

tori404 wrote:

While there are different ways to achieve the end goal differently, I'd like to know how to solve this specific issues.
Thanks!

That's simple, you solve it by not using whitespace in the local filenames: "MesloLGSNF-Regular.ttf", etc.

Just like all the other fonts in /usr/share/fonts/TTF/ are named...

Offline

#3 2021-03-31 13:11:03

tori404
Member
Registered: 2021-03-31
Posts: 4

Re: [SOLVED-Potential Bug] Sources with whitespaces in PKGBUILD

Thanks for you input, thing is, a lot of fonts in /usr/share/fonts/TTF have spaces in them

% ls /usr/share/fonts/TTF
3270Medium.ttf                                    'Meslo LG L Bold for Powerline.ttf'
3270Narrow.ttf                                    'Meslo LG L Bold Italic for Powerline.ttf'
3270SemiNarrow.ttf                                'Meslo LG L DZ Bold for Powerline.ttf'
'Anonymice Powerline Bold Italic.ttf'              'Meslo LG L DZ Bold Italic for Powerline.ttf'
'Anonymice Powerline Bold.ttf'                     'Meslo LG L DZ Italic for Powerline.ttf'
'Anonymice Powerline Italic.ttf'                   'Meslo LG L DZ Regular for Powerline.ttf'
'Anonymice Powerline.ttf'                          'Meslo LG L Italic for Powerline.ttf'
'Arimo Bold for Powerline.ttf'                     'Meslo LG L Regular for Powerline.ttf'
'Arimo Bold Italic for Powerline.ttf'              'Meslo LG M Bold for Powerline.ttf'
'Arimo for Powerline.ttf'                          'Meslo LG M Bold Italic for Powerline.ttf'
'Arimo Italic for Powerline.ttf'                   'Meslo LG M DZ Bold for Powerline.ttf'
'Cousine Bold for Powerline.ttf'                   'Meslo LG M DZ Bold Italic for Powerline.ttf'
'Cousine Bold Italic for Powerline.ttf'            'Meslo LG M DZ Italic for Powerline.ttf'
'Cousine for Powerline.ttf'                        'Meslo LG M DZ Regular for Powerline.ttf'
'Cousine Italic for Powerline.ttf'                 'Meslo LG M Italic for Powerline.ttf'
DejaVuMathTeXGyre.ttf                             'Meslo LG M Regular for Powerline.ttf'
DejaVuSans-BoldOblique.ttf                        'Meslo LG S Bold for Powerline.ttf'
DejaVuSans-Bold.ttf                               'Meslo LG S Bold Italic for Powerline.ttf'
DejaVuSansCondensed-BoldOblique.ttf               'Meslo LG S DZ Bold for Powerline.ttf'
DejaVuSansCondensed-Bold.ttf                      'Meslo LG S DZ Bold Italic for Powerline.ttf'
DejaVuSansCondensed-Oblique.ttf                   'Meslo LG S DZ Italic for Powerline.ttf'
DejaVuSansCondensed.ttf                           'Meslo LG S DZ Regular for Powerline.ttf'
DejaVuSans-ExtraLight.ttf                         'Meslo LG S Italic for Powerline.ttf'
'DejaVu Sans Mono Bold for Powerline.ttf'          'Meslo LG S Regular for Powerline.ttf'
'DejaVu Sans Mono Bold Oblique for Powerline.ttf'  'Monofur Bold for Powerline.ttf'
DejaVuSansMono-BoldOblique.ttf                    'Monofur for Powerline.ttf'
DejaVuSansMono-Bold.ttf                           'Monofur Italic for Powerline.ttf'
'DejaVu Sans Mono for Powerline.ttf'               'Noto Mono for Powerline.ttf'
'DejaVu Sans Mono Oblique for Powerline.ttf'       'NovaMono for Powerline.ttf'
DejaVuSansMono-Oblique.ttf                        'ProFont Bold For Powerline.ttf'
DejaVuSansMono.ttf                                'ProFont For Powerline.ttf'
DejaVuSans-Oblique.ttf                            'Roboto Mono Bold for Powerline.ttf'
DejaVuSans.ttf                                    'Roboto Mono Bold Italic for Powerline.ttf'
DejaVuSerif-BoldItalic.ttf                        'Roboto Mono for Powerline.ttf'
DejaVuSerif-Bold.ttf                              'Roboto Mono Italic for Powerline.ttf'
DejaVuSerifCondensed-BoldItalic.ttf               'Roboto Mono Light for Powerline.ttf'
DejaVuSerifCondensed-Bold.ttf                     'Roboto Mono Light Italic for Powerline.ttf'
DejaVuSerifCondensed-Italic.ttf                   'Roboto Mono Medium for Powerline.ttf'
DejaVuSerifCondensed.ttf                          'Roboto Mono Medium Italic for Powerline.ttf'
DejaVuSerif-Italic.ttf                            'Roboto Mono Thin for Powerline.ttf'
DejaVuSerif.ttf                                   'Roboto Mono Thin Italic for Powerline.ttf'
'Droid Sans Mono Dotted for Powerline.ttf'         'Space Mono Bold for Powerline.ttf'
'Droid Sans Mono Slashed for Powerline.ttf'        'Space Mono Bold Italic for Powerline.ttf'
fonts.dir                                          SpaceMono-BoldItalic.ttf
fonts.scale                                        SpaceMono-Bold.ttf
'Go Mono Bold for Powerline.ttf'                   'Space Mono for Powerline.ttf'
'Go Mono Bold Italic for Powerline.ttf'            'Space Mono Italic for Powerline.ttf'
'Go Mono for Powerline.ttf'                         SpaceMono-Italic.ttf
'Go Mono Italic for Powerline.ttf'                  SpaceMono-Regular.ttf
Hack-BoldItalic.ttf                               'Symbol Neu for Powerline.ttf'
Hack-Bold.ttf                                     'Tinos Bold for Powerline.ttf'
Hack-Italic.ttf                                   'Tinos Bold Italic for Powerline.ttf'
Hack-Regular.ttf                                  'Tinos for Powerline.ttf'
'Inconsolata Bold for Powerline.ttf'               'Tinos Italic for Powerline.ttf'
'Literation Mono Powerline Bold Italic.ttf'        'Ubuntu Mono derivative Powerline Bold Italic.ttf'
'Literation Mono Powerline Bold.ttf'               'Ubuntu Mono derivative Powerline Bold.ttf'
'Literation Mono Powerline Italic.ttf'             'Ubuntu Mono derivative Powerline Italic.ttf'
'Literation Mono Powerline.ttf'                    'Ubuntu Mono derivative Powerline.ttf'

In any case, my question is how to handle whitespaces in filenames in PKGBUILD. I'm sure there's a better option than "do not"

Offline

#4 2021-03-31 14:07:19

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: [SOLVED-Potential Bug] Sources with whitespaces in PKGBUILD

Try replacing the whitespace with the escape code for space , \20 .

example 'Meslo\20LGS\20NF\20Regular.ttf::https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf'


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#5 2021-03-31 14:15:00

tori404
Member
Registered: 2021-03-31
Posts: 4

Re: [SOLVED-Potential Bug] Sources with whitespaces in PKGBUILD

Thanks for your answer, here's what I get :

==> Making package: ttf-meslo-nerdfont 1.0-1 (Wed 31 Mar 2021 04:10:47 PM CEST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Downloading MesloLGS\20NF-Regular.ttf...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   162  100   162    0     0    329      0 --:--:-- --:--:-- --:--:--   329
100 1262k  100 1262k    0     0   773k      0  0:00:01  0:00:01 --:--:-- 1373k
  -> Downloading MesloLGS\20NF-Bold.ttf...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   159  100   159    0     0    347      0 --:--:-- --:--:-- --:--:--   347
100 1271k  100 1271k    0     0   795k      0  0:00:01  0:00:01 --:--:-- 1608k
  -> Downloading MesloLGS\20NF-Italic.ttf...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   161  100   161    0     0    367      0 --:--:-- --:--:-- --:--:--   366
100 1222k  100 1222k    0     0   799k      0  0:00:01  0:00:01 --:--:-- 1643k
  -> Downloading MesloLGS\20NF-BoldItalic.ttf...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   168  100   168    0     0    377      0 --:--:-- --:--:-- --:--:--   377
100 1230k  100 1230k    0     0   758k      0  0:00:01  0:00:01 --:--:-- 1369k
==> Validating source files with sha1sums...
    MesloLGS\20NF-Regular.ttf ... Skipped
    MesloLGS\20NF-Bold.ttf ... Skipped
    MesloLGS\20NF-Italic.ttf ... Skipped
    MesloLGS\20NF-BoldItalic.ttf ... Skipped
==> Extracting sources...
==> Removing existing $pkgdir/ directory...
==> Entering fakeroot environment...
==> Starting package()...
./MesloLGS\20NF-Regular.ttf
./MesloLGSNF-Regular.ttf
./MesloLGS\20NF-Bold.ttf
./MesloLGS\20NF-Italic.ttf
./MesloLGSNF-Italic.ttf
./MesloLGSNF-BoldItalic.ttf
./MesloLGS\20NF-BoldItalic.ttf
./MesloLGSNF-Bold.ttf
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Stripping unneeded symbols from binaries and libraries...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "ttf-meslo-nerdfont"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: ttf-meslo-nerdfont 1.0-1 (Wed 31 Mar 2021 04:10:55 PM CEST)

ls:

'MesloLGS\20NF-BoldItalic.ttf'  'MesloLGS\20NF-Bold.ttf'  'MesloLGS\20NF-Italic.ttf'  'MesloLGS\20NF-Regular.ttf'   pkg   PKGBUILD   src   ttf-meslo-nerdfont-1.0-1-any.pkg.tar.zst

I also had found this prior to posting, any chance it's related?
https://bugs.archlinux.org/task/52992

Which got closed with the following message :

+              - parse stdin as newline-separated instead of whitespace-separated
+                (FS#52992)

As seen here:
https://lists.archlinux.org/pipermail/p … 22504.html

Last edited by tori404 (2021-03-31 14:16:41)

Offline

#6 2021-03-31 14:42:07

progandy
Member
Registered: 2012-05-17
Posts: 5,184

Re: [SOLVED-Potential Bug] Sources with whitespaces in PKGBUILD

That might be a bug in makepkg.

get_filename in /usr/share/makepkg/util/source.sh accesses variables without quotes. Spaces in the local filename seem to work after I quoted everything in that function.

Feel free to open a bug report, but it means you cannot use space in the source array for now. If you want spaces in the local files, you'll have to rename them during the package or build step.

Last edited by progandy (2021-03-31 14:44:27)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#7 2021-03-31 14:55:52

tori404
Member
Registered: 2021-03-31
Posts: 4

Re: [SOLVED-Potential Bug] Sources with whitespaces in PKGBUILD

Thanks! Definitely a satisfying answer. I'll look into it to try to reproduce and I'll post the bug report.

And yeah I went without the spaces for now.

Offline

Board footer

Powered by FluxBB