You are not logged in.

#1 2021-10-01 16:08:40

silverhikari
Member
Registered: 2018-09-09
Posts: 21

pkgbuild can not find a file even though the file exists in src folder

i am creating a pkgbuild file to install fonts for a program called magic set editor, i have downloaded the main program to get the fonts. when the pkgbuild tries to cd into the folder it can not find it, even though i have checked the folder exist within the src folder. the exact cd command is "cd $srcdir/Full-Magic-Pack-main/Magic - Fonts/" i have tried backslashing before the spaces but that did not work,i have also tried single quotes to see if that made any difference but that also did not work. what am i missing?

Offline

#2 2021-10-01 16:15:08

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,300

Re: pkgbuild can not find a file even though the file exists in src folder

are the cases correct? In general

cd "$srcdir/Full-Magic-Pack-main/Magic - Fonts/"

should avoid most of the normal space/quoting gotchas. 

Maybe post the full dir tree/output of an ls or so and the actual error message/build log/PKGBUILD for proper diagnostics instead of hearsay.

Offline

#3 2021-10-01 16:32:01

silverhikari
Member
Registered: 2018-09-09
Posts: 21

Re: pkgbuild can not find a file even though the file exists in src folder

i just tried it but that still did not work here is the log

==> Making package: mse-fonts 1.0.0-1 (Fri 01 Oct 2021 12:25:24 PM EDT)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found Full-Magic-Pack-main.zip
==> Validating source files with sha256sums...
    Full-Magic-Pack-main.zip ... Skipped
==> Extracting sources...
  -> Extracting Full-Magic-Pack-main.zip with bsdtar
==> Removing existing $pkgdir/ directory...
==> Entering fakeroot environment...
==> Starting package()...
mkdir: cannot create directory ‘packages/pkg/mse-fonts/usr/share/fonts/mse/’: No such file or directory
==> ERROR: A failure occurred in package().
    Aborting...

and here is the pkgbuild

package()
{
    cd "$srcdir/Full-Magic-Pack-main/Magic - Fonts/"
    mkdir $pkgdir/usr/share/fonts/mse/
    cp ProgressEngine.otf $pkgdir/usr/share/fonts/mse
    cp *.ttf $pkgdir/usr/share/fonts/mse
    cd "/template specific fonts/"
    cp * $pkgdir/usr/share/fonts/mse
}

Offline

#4 2021-10-01 16:35:43

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,498
Website

Re: pkgbuild can not find a file even though the file exists in src folder

The error clearly says 'mkdir' is the problem, not 'cd'.  And the problem is you cannot create many levels of non-existing directory like that ... add the -p flag to mkdir, then read the mkdir man page (or better yet, do those in the opposite order).

Or better yet, read the `install` man page, and kill two (or three or four) birds with one stone.

Last edited by Trilby (2021-10-01 16:36:24)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2021-10-01 16:35:58

silverhikari
Member
Registered: 2018-09-09
Posts: 21

Re: pkgbuild can not find a file even though the file exists in src folder

i think i may have just found my problem i forgot to add -p to the mkdir.

Offline

#6 2021-10-01 16:36:42

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,300

Re: pkgbuild can not find a file even though the file exists in src folder

Wrap outputs in code Tags

It doesn't fail on the cd but on the mkdir, you probably want to use mkdir -p to generate the entire tree.

Edit: Whoops

Last edited by V1del (2021-10-01 16:38:38)

Offline

#7 2021-10-01 16:37:46

silverhikari
Member
Registered: 2018-09-09
Posts: 21

Re: pkgbuild can not find a file even though the file exists in src folder

yeah i think what happen is i originally got the problem with the cd and fixed it but i kept seeing error so i thought it was the same error, it wasn't until i posted the error report that i noticed it had changed.

Offline

Board footer

Powered by FluxBB