2

当我使用 -P 参数运行 dpkg-buildpackage 时,它​​失败了

dpkg-buildpackage -b -us -uc -P mypackageprofile
dpkg-buildpackage: unknown option or argument mypackageprofile

我也试过 -P [mypackageprofile] 和 ['mypackageprofile']。根据手册有这个论点

  -P, --build-profiles=profile[,...]
              Specify the profile(s) we build, as a comma-separated list
              (since dpkg 1.17.2, long option since dpkg 1.18.8).  The
              default behavior is to build for no specific profile. Also
              sets them (as a space separated list) as the
              DEB_BUILD_PROFILES environment variable which allows, for
              example, debian/rules files to use this information for
              conditional builds.

https://man7.org/linux/man-pages/man1/dpkg-buildpackage.1.html

4

2 回答 2

1

您应该使用以下样式编写它:

pkg-buildpackage -b -us -uc -Pmypackageprofile

也许这是一个错误,或者它应该有默认参数(通常情况下不允许选项和它的参数之间有空格。

于 2020-06-15T15:45:28.257 回答
-1

dpkg-buildpackage:未知选项或参数mypackageprofile

-P 和您的个人资料之间不应有空格。这是由消息来源证实的:

while (@ARGV) {
    $_ = shift @ARGV;

    if (/^(?:--help|-\?)$/) {
    usage;
    exit 0; 
    # [...]
    } elsif (/^-a(.*)$/ or /^--host-arch=(.*)$/) {
    $host_arch = $1;
    } elsif (/^-P(.*)$/ or /^--build-profiles=(.*)$/) {
    my $arg = $1;
    @build_profiles = split /,/, $arg;
    } elsif (/^-s[iad]$/) {
    push @changes_opts, $_;

可以看出,短选项需要在选项之后立即指定其参数。该错误告诉您它正在尝试将“mypackageprofile”作为参数或选项读取,当然它没有定义。

于 2020-07-29T14:08:18.530 回答