← 输入框|github.com|刷新
Skip to content

Makefile-based scanner creation throws error #749

Closed

Description

@malexmave

🐞 Bug report

When using make create-new-scanner NAME=something to create a new scanner (as introduced in #706), I get an error.

Describe the bug

mmaass@my-machine SecureCodeBox % make create-new-scanner NAME=openwpm
Copied template files to new directory ./scanners/openwpm
sed: 1: "./Makefile": invalid command code .

As far as I can tell, all files are created from the template as planned, but the sed command to replace new-scanner with the scanner name fails.

Expected behavior

The command should run without errors and replace new-scanner with the provided name of the scanner inside the template files.

System:

Mac OS 11.6, zsh shell.

Activity

  1. Weltraumschaf commented on Oct 21, 2021

    @Weltraumschaf
    Member

    The problem is that sed on BSD Unix machines behaves slightly different than on GNU Linux machines: On BSD Unix the option -i requires an argument. On Gnu Linux you can simply omit it to make an inline sed. On BSD machines it must besed -i '' ....

  2. malexmave commented on Oct 21, 2021

    @malexmave
    MemberAuthor

    I can confirm that adding the '' after the -i in the makefile makes it work correctly, but cannot test if it breaks it on Linux machines :).

  3. Weltraumschaf commented on Oct 21, 2021

    @Weltraumschaf
    Member

    AFAIK it does not break on GNU Linux. I test it.

  4. added a commit that references this issue on Oct 21, 2021
    44c84a2
  5. Weltraumschaf commented on Oct 21, 2021

    @Weltraumschaf
    Member

    Nope, does not work on GNU Linux. We need a platform based switch in the Makefile. The problem is that -i option of sed is not POSIX conform and not portable. Internet says: Avoid the -i option at all.

  6. Weltraumschaf commented on Oct 21, 2021

    @Weltraumschaf
    Member

    I fixed it. @SebieF maybe you want to look into it, I made some improvements to the make target.

  7. added a commit that references this issue on Oct 22, 2021
    2092f48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions