{
    "mode": "man",
    "parameter": "dpkg-source",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/dpkg-source/1/json",
    "generated": "2026-10-04T07:28:12Z",
    "synopsis": "dpkg-source [option...] command",
    "sections": {
        "NAME": {
            "content": "dpkg-source - Debian source package (.dsc) manipulation tool\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "dpkg-source [option...] command\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "dpkg-source packs and unpacks Debian source archives.\n\nNone of these commands allow multiple options to be combined into one, and they do not allow\nthe value for an option to be specified in a separate argument.\n",
            "subsections": []
        },
        "COMMANDS": {
            "content": "",
            "subsections": [
                {
                    "name": "-x --extract _",
                    "content": "Extract a source package (--extract since dpkg 1.17.14).  One non-option argument must be\nsupplied,  the  name  of  the Debian source control file (.dsc).  An optional second non-\noption argument may be supplied to specify the directory to extract  the  source  package\nto,  this  must  not  exist.   If no output directory is specified, the source package is\nextracted into a directory named source-version under the current working directory.\n\ndpkg-source will read the names of the other file(s) making up the  source  package  from\nthe control file; they are assumed to be in the same directory as the .dsc.\n\nThe  files  in  the  extracted  package will have their permissions and ownerships set to\nthose which would have been expected if the files and directories had simply been created\n- directories and executable files will be 0777  and  plain  files  will  be  0666,  both\nmodified  by  the extractors' umask; if the parent directory is setgid then the extracted\ndirectories will be too, and all  the  files  and  directories  will  inherit  its  group\nownership.\n\nIf the source package uses a non-standard format (currently this means all formats except\n“1.0”),  its  name will be stored in debian/source/format so that the following builds of\nthe source package use the same format by default.\n",
                    "flag": "-x",
                    "long": "--extract"
                },
                {
                    "name": "-b --build _",
                    "content": "Build a source package (--build since dpkg 1.17.14).  The first  non-option  argument  is\ntaken  as  the  name  of the directory containing the debianized source tree (i.e. with a\ndebian sub-directory and maybe changes to the original files).  Depending on  the  source\npackage format used to build the package, additional parameters might be accepted.\n\ndpkg-source  will  build  the  source package with the first format found in this ordered\nlist: the format indicated with the --format command line option, the format indicated in\ndebian/source/format, “1.0”.  The fallback to “1.0” is deprecated and will be removed  at\nsome  point  in  the  future,  you  should  always  document the desired source format in\ndebian/source/format.  See section \"SOURCE PACKAGE FORMATS\" for an extensive  description\nof the various source package formats.\n\n--print-format directory\nPrint  the  source  format  that would be used to build the source package if dpkg-source\n--build directory was called (in the same conditions and with the same parameters;  since\ndpkg 1.15.5).\n\n--before-build directory\nRun  the  corresponding hook of the source package format (since dpkg 1.15.8).  This hook\nis called before any build of the package (dpkg-buildpackage calls  it  very  early  even\nbefore debian/rules clean).  This command is idempotent and can be called multiple times.\nNot  all  source  formats  implement  something  in  this hook, and those that do usually\nprepare the source tree for the build for example by ensuring that the Debian patches are\napplied.\n\n--after-build directory\nRun the corresponding hook of the source package format (since dpkg 1.15.8).   This  hook\nis called after any build of the package (dpkg-buildpackage calls it last).  This command\nis  idempotent  and  can  be  called  multiple  times.   Not all source formats implement\nsomething in this hook, and those that do usually use it to undo what --before-build  has\ndone.\n\n--commit [directory] ...\nRecord  changes  in  the  source  tree  unpacked  in directory (since dpkg 1.16.1).  This\ncommand can take supplementary parameters depending on the source format.  It will  error\nout for formats where this operation doesn't mean anything.\n\n-?, --help\nShow  the  usage  message and exit.  The format specific build and extract options can be\nshown by using the --format option.\n",
                    "flag": "-b",
                    "long": "--build"
                },
                {
                    "name": "--version",
                    "content": "Show the version and exit.\n",
                    "long": "--version"
                }
            ]
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "Generic build options",
                    "content": ""
                },
                {
                    "name": "-c_",
                    "content": "Specifies the main source  control  file  to  read  information  from.   The  default  is\ndebian/control.   If  given  with  relative  pathname this is interpreted starting at the\nsource tree's top level directory.\n"
                },
                {
                    "name": "-l_",
                    "content": "Specifies the changelog file to read information from.  The default is  debian/changelog.\nIf  given  with  relative  pathname this is interpreted starting at the source tree's top\nlevel directory.\n"
                },
                {
                    "name": "-F_",
                    "content": "Specifies the format of the changelog.  See dpkg-parsechangelog(1) for information  about\nalternative formats.\n\n--format=value\nUse  the  given  format  for  building  the source package (since dpkg 1.14.17).  It does\noverride any format given in debian/source/format.\n"
                },
                {
                    "name": "-V_",
                    "content": "Set an output substitution variable.  See deb-substvars(5) for  a  discussion  of  output\nsubstitution.\n"
                },
                {
                    "name": "-T_",
                    "content": "Read substitution variables in substvars-file; the default is to not read any file.  This\noption  can  be  used  multiple  times to read substitution variables from multiple files\n(since dpkg 1.15.6).\n"
                },
                {
                    "name": "-D_",
                    "content": "Override or add an output control file field.\n"
                },
                {
                    "name": "-U_",
                    "content": "Remove an output control file field.\n"
                },
                {
                    "name": "-Z_ --compression",
                    "content": "Specify the compression to use for created tarballs and diff files  (--compression  since\ndpkg 1.15.5).  Note that this option will not cause existing tarballs to be recompressed,\nit  only affects new files.  Supported values are: gzip, bzip2, lzma and xz.  The default\nis xz for formats 2.0 and newer, and gzip for format 1.0.  xz  is  only  supported  since\ndpkg 1.15.5.\n",
                    "long": "--compression"
                },
                {
                    "name": "-z_ --compression-level",
                    "content": "Compression  level  to  use  (--compression-level since dpkg 1.15.5).  As with -Z it only\naffects newly created files.  Supported values are: 1 to 9, best, and fast.  The  default\nis 9 for gzip and bzip2, 6 for xz and lzma.\n",
                    "long": "--compression-level"
                },
                {
                    "name": "-i --diff-ignore",
                    "content": "You  may  specify  a  perl regular expression to match files you want filtered out of the\nlist of files for the diff (--diff-ignore since dpkg 1.15.6).  (This list is generated by\na find command.) (If the source package is being built as  a  version  3  source  package\nusing  a  VCS,  this  can be used to ignore uncommitted changes on specific files.  Using\n-i.* will ignore all of them.)\n\nThe -i option by itself enables  this  setting  with  a  default  regex  (preserving  any\nmodification  to  the  default regex done by a previous use of --extend-diff-ignore) that\nwill filter out control files  and  directories  of  the  most  common  revision  control\nsystems,  backup  and swap files and Libtool build output directories.  There can only be\none active regex, of multiple -i options only the last one will take effect.\n\nThis is very helpful in cutting out extraneous files that get included in the  diff,  for\nexample  if  you  maintain  your  source  in  a revision control system and want to use a\ncheckout to build a source package without including the additional files and directories\nthat it will usually contain (e.g.  CVS/,  .cvsignore,  .svn/).   The  default  regex  is\nalready  very  exhaustive,  but if you need to replace it, please note that by default it\ncan match any part of a path, so if you want to match the begin of  a  filename  or  only\nfull  filenames,  you  will need to provide the necessary anchors (e.g. ‘(^|/)’, ‘($|/)’)\nyourself.\n\n--extend-diff-ignore=regex\nThe perl regular expression specified will extend the default value used by --diff-ignore\nand its current value, if set  (since  dpkg  1.15.6).   It  does  this  by  concatenating\n“|regex”   to   the   existing   value.    This   option   is   convenient   to   use  in\ndebian/source/options to exclude some  auto-generated  files  from  the  automatic  patch\ngeneration.\n",
                    "flag": "-i",
                    "long": "--diff-ignore"
                },
                {
                    "name": "-I --tar-ignore",
                    "content": "If this option is specified, the pattern will be passed to tar(1)'s --exclude option when\nit  is called to generate a .orig.tar or .tar file (--tar-ignore since dpkg 1.15.6).  For\nexample, -ICVS will make tar skip over CVS directories when generating  a  .tar.gz  file.\nThe option may be repeated multiple times to list multiple patterns to exclude.\n\n-I  by  itself  adds  default  --exclude  options  that will filter out control files and\ndirectories of the most common revision  control  systems,  backup  and  swap  files  and\nLibtool build output directories.\n\nNote:  While  they have similar purposes, -i and -I have very different syntax and semantics.",
                    "flag": "-I",
                    "long": "--tar-ignore"
                },
                {
                    "name": "-i",
                    "content": "against the full relative path of each file.  -I can specified multiple  times  and  takes  a\nfilename  pattern with shell wildcards.  The pattern is applied to the full relative path but\nalso to each part of the path individually.  The exact semantic of tar's --exclude option  is\nsomewhat  complicated, see <https://www.gnu.org/software/tar/manual/tar.html#wildcards> for a\nfull documentation.\n\nThe default regex and patterns for both options can be seen  in  the  output  of  the  --help\ncommand.\n",
                    "flag": "-i"
                },
                {
                    "name": "Generic extract options",
                    "content": ""
                },
                {
                    "name": "--no-copy",
                    "content": "Do not copy original tarballs near the extracted source package (since dpkg 1.14.17).\n",
                    "long": "--no-copy"
                },
                {
                    "name": "--no-check",
                    "content": "Do not check signatures and checksums before unpacking (since dpkg 1.14.17).\n",
                    "long": "--no-check"
                },
                {
                    "name": "--no-overwrite-dir",
                    "content": "Do not overwrite the extraction directory if it already exists (since dpkg 1.18.8).\n",
                    "long": "--no-overwrite-dir"
                },
                {
                    "name": "--require-valid-signature",
                    "content": "Refuse  to  unpack the source package if it doesn't contain an OpenPGP signature that can\nbe verified (since dpkg 1.15.0) either with the user's trustedkeys.gpg  keyring,  one  of\nthe    vendor-specific    keyrings,    or   one   of   the   official   Debian   keyrings\n(/usr/share/keyrings/debian-keyring.gpg,   /usr/share/keyrings/debian-nonupload.gpg   and\n/usr/share/keyrings/debian-maintainers.gpg).\n",
                    "long": "--require-valid-signature"
                },
                {
                    "name": "--require-strong-checksums",
                    "content": "Refuse  to  unpack  the source package if it does not contain any strong checksums (since\ndpkg 1.18.7).  Currently the only known checksum considered strong is SHA-256.\n",
                    "long": "--require-strong-checksums"
                },
                {
                    "name": "--ignore-bad-version",
                    "content": "Turns the bad source package version check into a non-fatal warning (since dpkg  1.17.7).\nThis  option should only be necessary when extracting ancient source packages with broken\nversions, just for backwards compatibility.\n",
                    "long": "--ignore-bad-version"
                },
                {
                    "name": "Generic general options",
                    "content": "--threads-max=threads\nSets the maximum number of threads allowed for compressors  that  support  multi-threaded\noperations (since dpkg 1.21.14).\n"
                },
                {
                    "name": "-q",
                    "content": "",
                    "flag": "-q"
                }
            ]
        },
        "SOURCE PACKAGE FORMATS": {
            "content": "If you don't know what source format to use, you should probably pick either “3.0 (quilt)” or\n“3.0  (native)”.   See  <https://wiki.debian.org/Projects/DebSrc3.0>  for  information on the\ndeployment of those formats within Debian.\n",
            "subsections": [
                {
                    "name": "Format: 1.0",
                    "content": "A source package in this format consists either of a .orig.tar.gz associated to a .diff.gz or\na single .tar.gz (in that case the package is said to be native).   Optionally  the  original\ntarball  might  be  accompanied by a detached upstream signature .orig.tar.gz.asc, extraction\nsupported since dpkg 1.18.5.\n"
                },
                {
                    "name": "Extracting",
                    "content": "Extracting a native package is a simple extraction  of  the  single  tarball  in  the  target\ndirectory.   Extracting  a non-native package is done by first unpacking the .orig.tar.gz and\nthen applying the patch contained in the .diff.gz file.  The timestamp of all  patched  files\nis reset to the extraction time of the source package (this avoids timestamp skews leading to\nproblems  when  autogenerated  files  are patched).  The diff can create new files (the whole\ndebian directory is created that way) but cannot remove files (empty files will be left over)\nand cannot create or change symlinks.\n"
                },
                {
                    "name": "Building",
                    "content": "Building a native package is just creating  a  single  tarball  with  the  source  directory.\nBuilding  a non-native package involves extracting the original tarball in a separate “.orig”\ndirectory and regenerating the .diff.gz by comparing the source package  directory  with  the\n.orig directory.\n"
                },
                {
                    "name": "Build options (with --build):",
                    "content": "If  a  second  non-option  argument  is supplied it should be the name of the original source\ndirectory or tarfile or the empty string if the package is a Debian-specific one and  so  has\nno debianization diffs.  If no second argument is supplied then dpkg-source will look for the\noriginal source tarfile packageupstream-version.orig.tar.gz or the original source directory\ndirectory.orig depending on the -sX arguments.\n"
                },
                {
                    "name": "-sa -sp -sk -su  -sr",
                    "content": "desired then -sA, -sP, -sK, -sU and -sR should be used instead.\n"
                },
                {
                    "name": "-sk",
                    "content": "version.orig.tar.extension.  It will leave this original source in place as a tarfile, or\ncopy it to the current directory if it isn't already there.  The tarball will be unpacked\ninto directory.orig for the generation of the diff.\n"
                },
                {
                    "name": "-sp  -sk",
                    "content": ""
                },
                {
                    "name": "-su",
                    "content": "package-upstream-version.orig and dpkg-source will create a new original  source  archive\nfrom it.\n"
                },
                {
                    "name": "-sr  -su",
                    "content": ""
                },
                {
                    "name": "-ss",
                    "content": "dpkg-source will use the directory to create the diff, but  the  tarfile  to  create  the\n.dsc.   This  option must be used with care - if the directory and tarfile do not match a\nbad source archive will be generated.\n"
                },
                {
                    "name": "-sn",
                    "content": "argument,  if  supplied,  must  be  the  empty  string.  This is used for Debian-specific\npackages which do not have a separate upstream source and therefore have no debianization\ndiffs.\n"
                },
                {
                    "name": "-sa  -sA",
                    "content": "Specifies to look for the original source archive as a tarfile or as a  directory  -  the\nsecond  argument, if any, may be either, or the empty string (this is equivalent to using\n-sn).  If a tarfile is found it  will  unpack  it  to  create  the  diff  and  remove  it\nafterwards (this is equivalent to -sp); if a directory is found it will pack it to create\nthe  original  source and remove it afterwards (this is equivalent to -sr); if neither is\nfound it will assume that the package has no debianization diffs, only a  straightforward\nsource  archive  (this  is  equivalent  to -sn).  If both are found then dpkg-source will\nignore the directory, overwriting it, if -sA was specified (this is equivalent to -sP) or\nraise an error if -sa was specified.  -sa is the default.\n"
                },
                {
                    "name": "--abort-on-upstream-changes",
                    "content": "The process fails if the generated diff contains changes to files outside of  the  debian\nsub-directory  (since  dpkg 1.15.8).  This option is not allowed in debian/source/options\nbut can be used in debian/source/local-options.\n",
                    "long": "--abort-on-upstream-changes"
                },
                {
                    "name": "Extract options (with --extract):",
                    "content": "In all cases any existing original source tree will be removed.\n"
                },
                {
                    "name": "-sp",
                    "content": "is  not  already located in the current directory or if an existing but different file is\nthere it will be copied there.  (This is the default).\n"
                },
                {
                    "name": "-su",
                    "content": ""
                },
                {
                    "name": "-sn",
                    "content": "Any original source tree that was in the current directory is still removed.\n\nAll the -sX options are mutually exclusive.  If you specify more than one only the  last  one\nwill be used.\n"
                },
                {
                    "name": "--skip-debianization",
                    "content": "Skips application of the debian diff on top of the upstream sources (since dpkg 1.15.1).\n",
                    "long": "--skip-debianization"
                },
                {
                    "name": "Format: 2.0",
                    "content": "Extraction  supported since dpkg 1.13.9, building supported since dpkg 1.14.8.  Also known as\nwig&pen.  This format is not recommended for wide-spread  usage,  the  format  “3.0  (quilt)”\nreplaces it.  Wig&pen was the first specification of a new-generation source package format.\n\nThe  behavior  of  this format is the same as the “3.0 (quilt)” format except that it doesn't\nuse an explicit list of patches.  All files in  debian/patches/  matching  the  perl  regular\nexpression [\\w-]+ must be valid patches: they are applied at extraction time.\n\nWhen  building  a  new source package, any change to the upstream source is stored in a patch\nnamed zzdebian-diff-auto.\n"
                },
                {
                    "name": "Format: 3.0 (native)",
                    "content": "Supported since dpkg 1.14.17.  This format is an extension of the native  package  format  as\ndefined  in  the  1.0 format.  It supports all compression methods and will ignore by default\nany VCS specific files and directories as well as many temporary  files  (see  default  value\nassociated to -I option in the --help output).\n"
                },
                {
                    "name": "Format: 3.0 (quilt)",
                    "content": "Supported  since dpkg 1.14.17.  A source package in this format contains at least an original\ntarball (.orig.tar.ext where ext  can  be  gz,  bz2,  lzma  and  xz)  and  a  debian  tarball\n(.debian.tar.ext).      It     can     also     contain    additional    original    tarballs\n(.orig-component.tar.ext).  component can only contain alphanumeric (‘a-zA-Z0-9’)  characters\nand  hyphens  (‘-’).   Optionally  each  original  tarball  can  be accompanied by a detached\nupstream signature (.orig.tar.ext.asc and .orig-component.tar.ext.asc), extraction  supported\nsince dpkg 1.17.20, building supported since dpkg 1.18.5.\n"
                },
                {
                    "name": "Extracting",
                    "content": "The  main  original  tarball  is  extracted  first, then all additional original tarballs are\nextracted in subdirectories named after the  component  part  of  their  filename  (any  pre-\nexisting  directory  is  replaced).   The  debian  tarball  is extracted on top of the source\ndirectory after prior removal of any pre-existing debian directory.   Note  that  the  debian\ntarball  must  contain a debian sub-directory but it can also contain binary files outside of\nthat directory (see --include-binaries option).\n\nAll patches listed in debian/patches/vendor.series or debian/patches/series are then applied,\nwhere vendor will be the lowercase name of the current vendor,  or  debian  if  there  is  no\nvendor  defined.   If  the  former  file  is  used  and the latter one doesn't exist (or is a\nsymlink), then the latter is replaced with a  symlink  to  the  former.   This  is  meant  to\nsimplify  usage  of  quilt  to  manage  the set of patches.  Vendor-specific series files are\nintended to make it possible to serialize multiple development branches based on the  vendor,\nin  a  declarative  way, in preference to open-coding this handling in debian/rules.  This is\nparticularly useful when the source would  need  to  be  patched  conditionally  because  the\naffected  files  do not have built-in conditional occlusion support.  Note however that while\ndpkg-source parses correctly series files with explicit options used  for  patch  application\n(stored  on  each line after the patch filename and one or more spaces), it does ignore those\noptions and always expects patches that can be applied with the -p1 option of patch.  It will\nthus emit a warning when it encounters such options, and the build is likely to fail.\n\nNote that lintian(1) will emit unconditional warnings when  using  vendor  series  due  to  a\ncontroversial  Debian specific ruling, which should not affect any external usage; to silence\nthese, the dpkg lintian profile can be used by passing «--profile dpkg» to lintian(1).\n\nThe timestamp of all patched files is reset to the extraction  time  of  the  source  package\n(this avoids timestamp skews leading to problems when autogenerated files are patched).\n\nContrary  to  quilt's default behavior, patches are expected to apply without any fuzz.  When\nthat is not the case, you should refresh such patches with quilt, or dpkg-source  will  error\nout while trying to apply them.\n\nSimilarly to quilt's default behavior, the patches can remove files too.\n\nThe  file  .pc/applied-patches  is  created  if  some  patches  have  been applied during the\nextraction.\n"
                },
                {
                    "name": "Building",
                    "content": "All original tarballs found in the current directory are extracted in a  temporary  directory\nby  following  the  same  logic as for the unpack, the debian directory is copied over in the\ntemporary directory, and all patches except the automatic  patch  (debian-changes-version  or\ndebian-changes,  depending on --single-debian-patch) are applied.  The temporary directory is\ncompared to the source package directory.  When the diff is non-empty, the build fails unless\n--single-debian-patch or --auto-commit has been used, in which case the diff is stored in the\nautomatic patch.  If the automatic patch is  created/deleted,  it's  added/removed  from  the\nseries file and from the quilt metadata.\n\nAny  change  on  a binary file is not representable in a diff and will thus lead to a failure\nunless the maintainer deliberately decided to include that modified binary file in the debian\ntarball (by listing it in debian/source/include-binaries).  The build will also  fail  if  it\nfinds  binary  files  in  the  debian  sub-directory  unless  they  have been allowed through\ndebian/source/include-binaries.\n\nThe updated debian directory and the list of modified binaries is then used to  generate  the\ndebian tarball.\n\nThe  automatically  generated  diff  doesn't include changes on VCS specific files as well as\nmany temporary files (see default value associated to -i option in the  --help  output).   In\nparticular,  the  .pc  directory  used by quilt is ignored during generation of the automatic\npatch.\n\nNote: dpkg-source --before-build (and --build) will ensure that all  patches  listed  in  the\nseries file are applied so that a package build always has all patches applied.  It does this\nby   finding   unapplied   patches   (they   are  listed  in  the  series  file  but  not  in\n.pc/applied-patches), and if the first patch in that set can be applied  without  errors,  it\nwill apply them all.  The option --no-preparation can be used to disable this behavior.\n"
                },
                {
                    "name": "Recording changes",
                    "content": "--commit [directory] [patch-name] [patch-file]\nGenerates  a  patch  corresponding to the local changes that are not managed by the quilt\npatch system and integrates it in the patch system under the  name  patch-name.   If  the\nname  is  missing, it will be asked interactively.  If patch-file is given, it is used as\nthe patch corresponding to the local changes to integrate.  Once  integrated,  an  editor\n(the  first one found from sensible-editor, $VISUAL, $EDITOR, vi) is launched so that you\ncan edit the meta-information in the patch header.\n\nPassing patch-file is mainly useful after a build failure that pre-generated  this  file,\nand  on  this  ground  the  given  file is removed after integration.  Note also that the\nchanges contained in the patch file must already be applied on  the  tree  and  that  the\nfiles modified by the patch must not have supplementary unrecorded changes.\n\nIf  the  patch generation detects modified binary files, they will be automatically added\nto debian/source/include-binaries so that they end up in the debian tarball (exactly like\ndpkg-source --include-binaries --build would do).\n"
                },
                {
                    "name": "Build options",
                    "content": "--allow-version-of-quilt-db=version\nAllow dpkg-source to build the source package if the version of the quilt metadata is the\none specified,  even  if  dpkg-source  doesn't  know  about  it  (since  dpkg  1.15.5.4).\nEffectively this says that the given version of the quilt metadata is compatible with the\nversion  2  that  dpkg-source  currently  supports.  The version of the quilt metadata is\nstored in .pc/.version.\n"
                },
                {
                    "name": "--include-removal",
                    "content": "Do not ignore removed files and include them in the automatically generated patch.\n",
                    "long": "--include-removal"
                },
                {
                    "name": "--include-timestamp",
                    "content": "Include timestamp in the automatically generated patch.\n",
                    "long": "--include-timestamp"
                },
                {
                    "name": "--include-binaries",
                    "content": "Add   all   modified   binaries   in   the   debian   tarball.    Also   add   them    to\ndebian/source/include-binaries:  they  will  be added by default in subsequent builds and\nthis option is thus no more needed.\n",
                    "long": "--include-binaries"
                },
                {
                    "name": "--no-preparation",
                    "content": "Do not try to prepare the build tree by applying patches which are  apparently  unapplied\n(since dpkg 1.14.18).\n",
                    "long": "--no-preparation"
                },
                {
                    "name": "--single-debian-patch",
                    "content": "Use  debian/patches/debian-changes  instead  of debian/patches/debian-changes-version for\nthe name of the automatic patch generated  during  build  (since  dpkg  1.15.5.4).   This\noption  is  particularly  useful  when the package is maintained in a VCS and a patch set\ncan't reliably be generated.  Instead the current diff with upstream should be stored  in\na  single  patch.   The  option  would be put in debian/source/local-options and would be\naccompanied by a debian/source/local-patch-header file explaining how the Debian  changes\ncan be best reviewed, for example in the VCS that is used.\n",
                    "long": "--single-debian-patch"
                },
                {
                    "name": "--create-empty-orig",
                    "content": "Automatically  create the main original tarball as empty if it's missing and if there are\nsupplementary original tarballs (since dpkg 1.15.6).  This option is  meant  to  be  used\nwhen  the source package is just a bundle of multiple upstream software and where there's\nno “main” software.\n",
                    "long": "--create-empty-orig"
                },
                {
                    "name": "--no-unapply-patches, --unapply-patches",
                    "content": "By default, dpkg-source will automatically unapply the patches in the --after-build  hook\nif  it  did  apply  them  during  --before-build  (--unapply-patches  since  dpkg 1.15.8,\n--no-unapply-patches since dpkg 1.16.5).  Those options allow you to  forcefully  disable\nor   enable  the  patch  unapplication  process.   Those  options  are  only  allowed  in\ndebian/source/local-options so that all generated source packages have the same  behavior\nby default.\n",
                    "long": "--unapply-patches"
                },
                {
                    "name": "--abort-on-upstream-changes",
                    "content": "The  process  fails  if  an automatic patch has been generated (since dpkg 1.15.8).  This\noption can be used to ensure that all changes were properly recorded  in  separate  quilt\npatches   prior   to   the   source  package  build.   This  option  is  not  allowed  in\ndebian/source/options but can be used in debian/source/local-options.\n",
                    "long": "--abort-on-upstream-changes"
                },
                {
                    "name": "--auto-commit",
                    "content": "The process doesn't  fail  if  an  automatic  patch  has  been  generated,  instead  it's\nimmediately recorded in the quilt series.\n",
                    "long": "--auto-commit"
                },
                {
                    "name": "Extract options",
                    "content": ""
                },
                {
                    "name": "--skip-debianization",
                    "content": "Skips  extraction  of  the  debian  tarball  on  top  of the upstream sources (since dpkg\n1.15.1).\n",
                    "long": "--skip-debianization"
                },
                {
                    "name": "--skip-patches",
                    "content": "Do not apply patches at the end of the extraction (since dpkg 1.14.18).\n",
                    "long": "--skip-patches"
                },
                {
                    "name": "Format: 3.0 (custom)",
                    "content": "Supported since dpkg 1.14.17.  This format is special.  It doesn't represent  a  real  source\npackage format but can be used to create source packages with arbitrary files.\n"
                },
                {
                    "name": "Build options",
                    "content": "All  non-option  arguments  are  taken as files to integrate in the generated source package.\nThey must exist and are preferably in the current directory.   At  least  one  file  must  be\ngiven.\n\n--target-format=value\nRequired.   Defines  the real format of the generated source package.  The generated .dsc\nfile will contain this value in its Format field and not “3.0 (custom)”.\n"
                },
                {
                    "name": "Format: 3.0 (git)",
                    "content": "Supported since dpkg 1.14.17.  This format is experimental.\n\nA source package in this format consists of a single bundle of a git repository .git to  hold\nthe  source  of  a  package.   There  may  also be a .gitshallow file listing revisions for a\nshallow git clone.\n"
                },
                {
                    "name": "Extracting",
                    "content": "The bundle is cloned as a git repository to the target directory.  If there is  a  gitshallow\nfile, it is installed as .git/shallow inside the cloned git repository.\n\nNote  that  by  default  the  new  repository  will have the same branch checked out that was\nchecked out in the original source.  (Typically “main”, but it could be anything.)  Any other\nbranches will be available under remotes/origin/.\n"
                },
                {
                    "name": "Building",
                    "content": "Before going any further, some checks are done to ensure that we don't have  any  non-ignored\nuncommitted changes.\n\ngit-bundle(1)  is  used to generate a bundle of the git repository.  By default, all branches\nand tags in the repository are included in the bundle.\n"
                },
                {
                    "name": "Build options",
                    "content": "--git-ref=ref\nAllows specifying a git ref to include in the  git  bundle.   Use  disables  the  default\nbehavior  of  including all branches and tags.  May be specified multiple times.  The ref\ncan be the name of a branch or tag to include.  It may also be any parameter that can  be\npassed   to  git-rev-list(1).   For  example,  to  include  only  the  main  branch,  use\n--git-ref=main.  To include all tags and branches, except for  the  private  branch,  use\n--git-ref=--all --git-ref=^private\n\n--git-depth=number\nCreates a shallow clone with a history truncated to the specified number of revisions.\n"
                },
                {
                    "name": "Format: 3.0 (bzr)",
                    "content": "Supported  since  dpkg  1.14.17.  This format is experimental.  It generates a single tarball\ncontaining the bzr repository.\n"
                },
                {
                    "name": "Extracting",
                    "content": "The tarball is unpacked and then bzr is used to checkout the current branch.\n"
                },
                {
                    "name": "Building",
                    "content": "Before going any further, some checks are done to ensure that we don't have  any  non-ignored\nuncommitted changes.\n\nThen  the  VCS specific part of the source directory is copied over to a temporary directory.\nBefore this temporary directory is packed in a tarball, various  cleanup  are  done  to  save\nspace.\n"
                }
            ]
        },
        "DIAGNOSTICS": {
            "content": "",
            "subsections": [
                {
                    "name": "no source format specified in debian/source/format",
                    "content": "The  file  debian/source/format  should  always exist and indicate the desired source format.\nFor backwards compatibility, format “1.0” is assumed when the  file  doesn't  exist  but  you\nshould  not  rely  on  this: at some point in the future dpkg-source will be modified to fail\nwhen that file doesn't exist.\n\nThe rationale is that format “1.0” is no longer the recommended format,  you  should  usually\npick  one  of  the  newer formats (“3.0 (quilt)”, “3.0 (native)”) but dpkg-source will not do\nthis automatically for you.  If you want to continue using the  old  format,  you  should  be\nexplicit about it and put “1.0” in debian/source/format.\n"
                },
                {
                    "name": "the diff modifies the following upstream files",
                    "content": "When  using source format “1.0” it is usually a bad idea to modify upstream files directly as\nthe changes end up hidden and mostly undocumented in the .diff.gz file.  Instead  you  should\nstore your changes as patches in the debian directory and apply them at build-time.  To avoid\nthis complexity you can also use the format “3.0 (quilt)” that offers this natively.\n"
                },
                {
                    "name": "cannot represent change to file",
                    "content": "Changes  to  upstream sources are usually stored with patch files, but not all changes can be\nrepresented with patches: they can only alter the content of plain text files.   If  you  try\nreplacing  a file with something of a different type (for example replacing a plain file with\na symlink or a directory), you will get this error message.\n"
                },
                {
                    "name": "newly created empty file _file_ will not be represented in diff",
                    "content": "Empty files can't be created with patch files.  Thus this  change  is  not  recorded  in  the\nsource package and you are warned about it.\n"
                },
                {
                    "name": "executable mode _perms_ of _file_ will not be represented in diff",
                    "content": "Patch files do not record permissions of files and thus executable permissions are not stored\nin the source package.  This warning reminds you of that fact.\n"
                },
                {
                    "name": "special mode _perms_ of _file_ will not be represented in diff",
                    "content": "Patch  files  do not record permissions of files and thus modified permissions are not stored\nin the source package.  This warning reminds you of that fact.\n"
                }
            ]
        },
        "ENVIRONMENT": {
            "content": "DPKGCOLORS\nSets the color mode (since  dpkg  1.18.5).   The  currently  accepted  values  are:  auto\n(default), always and never.\n\nDPKGNLS\nIf set, it will be used to decide whether to activate Native Language Support, also known\nas  internationalization (or i18n) support (since dpkg 1.19.0).  The accepted values are:\n0 and 1 (default).\n\nSOURCEDATEEPOCH\nIf set, it will be used as the timestamp (as seconds since the epoch) to clamp the  mtime\nin the tar(5) file entries.\n\nSince dpkg 1.18.11.\n\nVISUAL\nEDITOR\nUsed by the “2.0” and “3.0 (quilt)” source format modules.\n\nGITDIR\nGITINDEXFILE\nGITOBJECTDIRECTORY\nGITALTERNATEOBJECTDIRECTORIES\nGITWORKTREE\nUsed by the “3.0 (git)” source format modules.\n",
            "subsections": []
        },
        "FILES": {
            "content": "",
            "subsections": [
                {
                    "name": "debian/source/format",
                    "content": "This  file  contains  on  a  single  line  the format that should be used to build the source\npackage (possible formats are described above).  No leading or trailing spaces are allowed.\n"
                },
                {
                    "name": "debian/source/include-binaries",
                    "content": "This file contains a list of pathnames of binary files (one per line) relative to the  source\nroot  directory  that  should be included in the debian tarball.  Leading and trailing spaces\nare stripped.  Lines starting with ‘#’  are  comments  and  are  skipped.   Empty  lines  are\nignored.\n"
                },
                {
                    "name": "debian/source/options",
                    "content": "This  file  contains a list of long options that should be automatically prepended to the set\nof command line options of a dpkg-source --build or dpkg-source --print-format call.  Options\nlike --compression and --compression-level are well suited for this file.\n\nEach option should be put on a separate line.  Empty lines and lines starting  with  ‘#’  are\nignored.   The  leading  ‘--’ should be stripped and short options are not allowed.  Optional\nspaces are allowed around the ‘=’ symbol and optional quotes are allowed  around  the  value.\nHere's an example of such a file:\n\n# let dpkg-source create a debian.tar.bz2 with maximal compression\ncompression = \"bzip2\"\ncompression-level = 9\n# use debian/patches/debian-changes as automatic patch\nsingle-debian-patch\n# ignore changes on config.{sub,guess}\nextend-diff-ignore = \"(^|/)(config.sub|config.guess)$\"\n\nNote:  format  options  are  not  accepted  in this file, you should use debian/source/format\ninstead.\n"
                },
                {
                    "name": "debian/source/local-options",
                    "content": "Exactly like debian/source/options except that the file is  not  included  in  the  generated\nsource  package.  It can be useful to store a preference tied to the maintainer or to the VCS\nrepository where the source package is maintained.\n"
                },
                {
                    "name": "debian/source/local-patch-header",
                    "content": ""
                },
                {
                    "name": "debian/source/patch-header",
                    "content": "Free form text that is put on top of the automatic patch generated in formats “2.0”  or  “3.0\n(quilt)”.   local-patch-header  is  not included in the generated source package while patch-\nheader is.\n"
                },
                {
                    "name": "debian/patches/_vendor_.series",
                    "content": ""
                },
                {
                    "name": "debian/patches/series",
                    "content": "This file lists all patches that have to be applied (in  the  given  order)  on  top  of  the\nupstream  source  package.  Leading and trailing spaces are stripped.  The vendor will be the\nlowercase name of the current vendor, or debian if  there  is  no  vendor  defined.   If  the\nvendor-specific  series file does not exist, the vendor-less series file will be used.  Lines\nstarting with ‘#’ are comments and are skipped.  Empty lines are  ignored.   Remaining  lines\nstart with a patch filename (relative to the debian/patches/ directory) up to the first space\ncharacter or the end of line.  Optional quilt options can follow up to the end of line or the\nfirst ‘#’ preceded by one or more spaces (which marks the start of a comment up to the end of\nline).\n"
                }
            ]
        },
        "SECURITY": {
            "content": "Examining  untrusted  source  packages  or extracting them into staging directories should be\nconsidered a security boundary, and  any  breakage  of  that  boundary  stemming  from  these\noperations  should  be  considered  a  security vulnerability.  But handling untrusted source\npackages should not be done lightly, as the surface area  includes  any  compression  command\nsupported,  commands to handle specific data formats (such as tar(1) or patch(1)) in addition\nto the source package formats and control files themselves.  Performing these operations over\nuntrusted data as root is strongly discouraged.\n\nBuilding source packages should only be performed over trusted data.\n",
            "subsections": []
        },
        "BUGS": {
            "content": "The point at which field overriding occurs compared to certain standard output field settings\nis rather confused.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "deb-src-control(5), deb-changelog(5), deb-substvars(5), dsc(5).\n\n1.22.6                                       2026-05-06                               dpkg-source(1)",
            "subsections": []
        }
    },
    "summary": "dpkg-source - Debian source package (.dsc) manipulation tool",
    "flags": [
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Specifies the main source control file to read information from. The default is debian/control. If given with relative pathname this is interpreted starting at the source tree's top level directory."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Specifies the changelog file to read information from. The default is debian/changelog. If given with relative pathname this is interpreted starting at the source tree's top level directory."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Specifies the format of the changelog. See dpkg-parsechangelog(1) for information about alternative formats. --format=value Use the given format for building the source package (since dpkg 1.14.17). It does override any format given in debian/source/format."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set an output substitution variable. See deb-substvars(5) for a discussion of output substitution."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Read substitution variables in substvars-file; the default is to not read any file. This option can be used multiple times to read substitution variables from multiple files (since dpkg 1.15.6)."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Override or add an output control file field."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Remove an output control file field."
        },
        {
            "flag": "",
            "long": "--compression",
            "arg": null,
            "description": "Specify the compression to use for created tarballs and diff files (--compression since dpkg 1.15.5). Note that this option will not cause existing tarballs to be recompressed, it only affects new files. Supported values are: gzip, bzip2, lzma and xz. The default is xz for formats 2.0 and newer, and gzip for format 1.0. xz is only supported since dpkg 1.15.5."
        },
        {
            "flag": "",
            "long": "--compression-level",
            "arg": null,
            "description": "Compression level to use (--compression-level since dpkg 1.15.5). As with -Z it only affects newly created files. Supported values are: 1 to 9, best, and fast. The default is 9 for gzip and bzip2, 6 for xz and lzma."
        },
        {
            "flag": "-i",
            "long": "--diff-ignore",
            "arg": null,
            "description": "You may specify a perl regular expression to match files you want filtered out of the list of files for the diff (--diff-ignore since dpkg 1.15.6). (This list is generated by a find command.) (If the source package is being built as a version 3 source package using a VCS, this can be used to ignore uncommitted changes on specific files. Using -i.* will ignore all of them.) The -i option by itself enables this setting with a default regex (preserving any modification to the default regex done by a previous use of --extend-diff-ignore) that will filter out control files and directories of the most common revision control systems, backup and swap files and Libtool build output directories. There can only be one active regex, of multiple -i options only the last one will take effect. This is very helpful in cutting out extraneous files that get included in the diff, for example if you maintain your source in a revision control system and want to use a checkout to build a source package without including the additional files and directories that it will usually contain (e.g. CVS/, .cvsignore, .svn/). The default regex is already very exhaustive, but if you need to replace it, please note that by default it can match any part of a path, so if you want to match the begin of a filename or only full filenames, you will need to provide the necessary anchors (e.g. ‘(^|/)’, ‘($|/)’) yourself. --extend-diff-ignore=regex The perl regular expression specified will extend the default value used by --diff-ignore and its current value, if set (since dpkg 1.15.6). It does this by concatenating “|regex” to the existing value. This option is convenient to use in debian/source/options to exclude some auto-generated files from the automatic patch generation."
        },
        {
            "flag": "-I",
            "long": "--tar-ignore",
            "arg": null,
            "description": "If this option is specified, the pattern will be passed to tar(1)'s --exclude option when it is called to generate a .orig.tar or .tar file (--tar-ignore since dpkg 1.15.6). For example, -ICVS will make tar skip over CVS directories when generating a .tar.gz file. The option may be repeated multiple times to list multiple patterns to exclude. -I by itself adds default --exclude options that will filter out control files and directories of the most common revision control systems, backup and swap files and Libtool build output directories. Note: While they have similar purposes, -i and -I have very different syntax and semantics."
        },
        {
            "flag": "-i",
            "long": null,
            "arg": null,
            "description": "against the full relative path of each file. -I can specified multiple times and takes a filename pattern with shell wildcards. The pattern is applied to the full relative path but also to each part of the path individually. The exact semantic of tar's --exclude option is somewhat complicated, see <https://www.gnu.org/software/tar/manual/tar.html#wildcards> for a full documentation. The default regex and patterns for both options can be seen in the output of the --help command."
        },
        {
            "flag": "",
            "long": "--no-copy",
            "arg": null,
            "description": "Do not copy original tarballs near the extracted source package (since dpkg 1.14.17)."
        },
        {
            "flag": "",
            "long": "--no-check",
            "arg": null,
            "description": "Do not check signatures and checksums before unpacking (since dpkg 1.14.17)."
        },
        {
            "flag": "",
            "long": "--no-overwrite-dir",
            "arg": null,
            "description": "Do not overwrite the extraction directory if it already exists (since dpkg 1.18.8)."
        },
        {
            "flag": "",
            "long": "--require-valid-signature",
            "arg": null,
            "description": "Refuse to unpack the source package if it doesn't contain an OpenPGP signature that can be verified (since dpkg 1.15.0) either with the user's trustedkeys.gpg keyring, one of the vendor-specific keyrings, or one of the official Debian keyrings (/usr/share/keyrings/debian-keyring.gpg, /usr/share/keyrings/debian-nonupload.gpg and /usr/share/keyrings/debian-maintainers.gpg)."
        },
        {
            "flag": "",
            "long": "--require-strong-checksums",
            "arg": null,
            "description": "Refuse to unpack the source package if it does not contain any strong checksums (since dpkg 1.18.7). Currently the only known checksum considered strong is SHA-256."
        },
        {
            "flag": "",
            "long": "--ignore-bad-version",
            "arg": null,
            "description": "Turns the bad source package version check into a non-fatal warning (since dpkg 1.17.7). This option should only be necessary when extracting ancient source packages with broken versions, just for backwards compatibility."
        },
        {
            "flag": "-q",
            "long": null,
            "arg": null,
            "description": ""
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "deb-src-control",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/deb-src-control/5/json"
        },
        {
            "name": "deb-changelog",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/deb-changelog/5/json"
        },
        {
            "name": "deb-substvars",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/deb-substvars/5/json"
        },
        {
            "name": "dsc",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/dsc/5/json"
        }
    ],
    "tldr": {
        "source": "not_found",
        "examples": []
    }
}