skip to Main Content

When I run dpkg-buildpackage with -P argument it fails

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

I have also tried -P [mypackageprofile] and [‘mypackageprofile’]. According to manual there is this argument

  -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

2

Answers


  1. You should write it with the style:

    pkg-buildpackage -b -us -uc -Pmypackageprofile
    

    Maybe it is a bug, or it is expected to have default argument (the usual case not allowing white space between option and its argument.

    Login or Signup to reply.
  2. dpkg-buildpackage: unknown option or argument mypackageprofile

    There should not be spaces between -P and your profile. This is subtentiated by the source:

    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, $_;
    

    As can be seen, short options needs to specify their parameters immediatly after the option. The error is telling you that it’s trying to read "mypackageprofile" as an argument or option, which of course it isn’t defined.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search