dpkg-source.1 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. .\" Authors: Ian Jackson
  2. .TH dpkg\-source 1 "2007-09-24" "Debian Project" "dpkg utilities"
  3. .SH NAME
  4. dpkg\-source \- Debian source package (.dsc) manipulation tool
  5. .
  6. .SH SYNOPSIS
  7. .B dpkg\-source
  8. .RI [ options ]
  9. .I command
  10. .
  11. .SH DESCRIPTION
  12. .B dpkg\-source
  13. packs and unpacks Debian source archives.
  14. None of these commands allow multiple options to be combined into one,
  15. and they do not allow the value for an option to be specified in a
  16. separate argument.
  17. .
  18. .SH COMMANDS
  19. .TP
  20. .BI "\-x " filename ".dsc " \fR[\fPoutput-directory\fR]\fP
  21. Extract a source package. One non-option argument must be supplied,
  22. the name of the Debian source control file
  23. .RB ( .dsc ).
  24. An optional second non-option argument may be supplied to specify the
  25. directory to extract the source package to, this must not exist. If
  26. no output directory is specified, the source package is extracted into
  27. a directory named \fIsource\fR-\fIversion\fR under the current working
  28. directory.
  29. .B dpkg\-source
  30. will read the names of the other file(s) making up the source package
  31. from the control file; they are assumed to be in the same directory as
  32. the
  33. .BR .dsc .
  34. The files in the extracted package will have their permissions and
  35. ownerships set to those which would have been expected if the files
  36. and directories had simply been created - directories and executable
  37. files will be 0777 and plain files will be 0666, both modified by the
  38. extractors' umask; if the parent directory is setgid then the
  39. extracted directories will be too, and all the files and directories
  40. will inherit its group ownership.
  41. .TP
  42. .RI "\fB\-b\fP [" options "] " directory " [" orig-directory | orig-targz |'']
  43. Build a source package. One or two non-option arguments should
  44. be supplied. The first is taken as the name of the directory
  45. containing the unpacked source tree. If a second argument is supplied
  46. it should be the name of the original source directory or tarfile or
  47. the empty string if the package is a Debian-specific one and so has no
  48. Debianisation diffs. If no second argument is supplied then
  49. .B dpkg\-source
  50. will look for the original source tarfile
  51. .IB package _ upstream-version .orig.tar.gz
  52. or the original source directory
  53. .IB directory .orig
  54. depending on the \fB\-sX\fP arguments.
  55. .TP
  56. .BR \-h ", " \-\-help
  57. Show the usage message and exit.
  58. .TP
  59. .BR \-\-version
  60. Show the version and exit.
  61. .
  62. .SH OPTIONS
  63. .TP
  64. .BI \-c controlfile
  65. Specifies the main source control file to read information from. The
  66. default is
  67. .BR debian/control .
  68. If given with relative pathname this is interpreted starting at
  69. the source tree's top level directory.
  70. .TP
  71. .BI \-l changelogfile
  72. Specifies the change log file to read information from. The
  73. default is
  74. .BR debian/changelog .
  75. If given with relative pathname this is interpreted starting at
  76. the source tree's top level directory.
  77. .TP
  78. .BI \-F changelogformat
  79. Specifies the format of the changelog. By default the format is read
  80. from a special line near the bottom of the changelog or failing that
  81. defaults to the debian standard format.
  82. .TP
  83. .BI \-V name = value
  84. Set an output substitution variable.
  85. See \fBdeb\-substvars\fP(5) for a discussion of output substitution.
  86. .TP
  87. .BI \-T substvarsfile
  88. Read substitution variables in
  89. .IR substvarsfile ;
  90. the default is
  91. .BR debian/substvars .
  92. .TP
  93. .BI \-D field = value
  94. Override or add an output control file field.
  95. .TP
  96. .BI \-U field
  97. Remove an output control file field.
  98. .TP
  99. .BI \-W
  100. This option turns certain errors into warnings.
  101. .TP
  102. .BI \-E
  103. This option negates a previously set
  104. .BR \-W "."
  105. .TP
  106. .BR \-i [\fIregexp\fP]
  107. You may specify a perl regular expression to match files you want
  108. filtered out of the list of files for the diff. (This list is
  109. generated by a find command.) \fB\-i\fR by itself enables the option,
  110. with a default that will filter out control files and directories of the
  111. most common revision control systems, backup and swap files and Libtool
  112. build output directories. There can only be one active regexp, of multiple
  113. \-i options only the last one will take effect.
  114. This is very helpful in cutting out extraneous files that get included
  115. in the .diff.gz, e.g. if you maintain your source in a revision control
  116. system and want to use a checkout to build a source package without
  117. including the additional files and directories that it will usually
  118. contain (e.g. CVS/, .cvsignore, .svn/). The default regexp is already
  119. very exhaustive, but if you need to replace it, please note that by
  120. default it can match any part of a path, so if you want to match the
  121. begin of a filename or only full filenames, you will need to provide
  122. the neccessary anchors (e.g. '(^|/)', '($|/)') yourself.
  123. .TP
  124. .BR \-I [\fIfile-pattern\fP]
  125. If this option is specified, the pattern will be passed to
  126. .BR tar (1)'s
  127. \-\-exclude
  128. option when it is called to generate a .orig.tar.gz or .tar.gz file. For
  129. example, \-ICVS will make tar skip over CVS directories when generating
  130. a .tar.gz file. The option may be repeated multiple times to list multiple
  131. patterns to exclude.
  132. \fB\-I\fR by itself adds default \-\-exclude options that will
  133. filter out control files and directories of the most common revision
  134. control systems, backup and swap files and Libtool build output
  135. directories.
  136. .PP
  137. .B Note:
  138. While they have similar purposes, \fB-i\fP and \fB-I\fP have very
  139. different syntax and semantics. \fB-i\fP can only be specified once and
  140. takes a perl compatible regular expression which is matched against
  141. the full relative path of each file. \fB-I\fP can specified
  142. multiple times and takes a filename pattern with shell wildcards.
  143. The pattern is applied to the full relative path but also
  144. to each part of the path individually. The exact semantic of tar's
  145. \-\-exclude option is somewhat complicated, see
  146. http://www.gnu.org/software/tar/manual/tar.html#wildcards for a full
  147. documentation.
  148. The default regexp and patterns for both options can be seen
  149. in the output of the \fB\-\-help\fP command.
  150. .TP
  151. .B Build options (with -b):
  152. .PP
  153. .BR \-sa ", " \-sp ", " \-sk ", " \-su " and " \-sr
  154. will not overwrite existing tarfiles or directories. If this is
  155. desired then
  156. .BR \-sA ", " \-sP ", " \-sK ", " \-sU " and " \-sR
  157. should be used instead.
  158. .TP
  159. .BR \-sk
  160. Specifies to expect the original source as a tarfile, by default
  161. .IB package _ upstream-version .orig.tar.gz\fR.
  162. It will leave this original source in place as a tarfile, or copy it
  163. to the current directory if it isn't already there.
  164. .TP
  165. .B \-sp
  166. Like
  167. .B \-sk
  168. but will remove that tarball again afterwards.
  169. .TP
  170. .B \-su
  171. Specifies that the original source is expected as a directory, by
  172. default
  173. .IB package - upstream-version .orig
  174. and
  175. .B dpkg\-source
  176. will create a new original source archive from it.
  177. .TP
  178. .B \-sr
  179. Like
  180. .B \-su
  181. but will remove that directory after it has been used.
  182. .TP
  183. .B \-ss
  184. Specifies that the original source is available both as a directory
  185. and as a tarfile. If will use the directory to create the diff, but
  186. the tarfile to create the
  187. .BR .dsc .
  188. This option must be used with care - if the directory and tarfile do
  189. not match a bad source archive will be generated.
  190. .TP
  191. .B \-sn
  192. Specifies to not look for any original source, and to not generate a diff.
  193. The second argument, if supplied, must be the empty string. This is
  194. used for Debian-specific packages which do not have a separate
  195. upstream source and therefore have no debianisation diffs.
  196. .TP
  197. .BR \-sa " or " \-sA
  198. Specifies to look for the original source archive as a tarfile or as a
  199. directory - the second argument, if any, may be either, or the empty
  200. string (this is equivalent to using
  201. .BR \-sn ).
  202. If a tarfile is found it will unpack it to create the diff and remove
  203. it afterwards (this is equivalent to
  204. .BR \-sp );
  205. if a directory is found it will pack it to create the original source
  206. and remove it afterwards (this is equivalent to
  207. .BR \-sr );
  208. if neither is found it will assume that the package has no
  209. debianisation diffs, only a straightforward source archive (this is
  210. equivalent to
  211. .BR \-sn ).
  212. If both are found then \fBdpkg\-source\fP will ignore the directory,
  213. overwriting it, if
  214. .B \-sA
  215. was specified (this is equivalent to
  216. .BR \-sP )
  217. or raise an error if
  218. .B \-sa
  219. was specified.
  220. .B \-sA
  221. is the default.
  222. .TP
  223. .B Extract options (with \-x):
  224. .PP
  225. In all cases any existing original source tree will be removed.
  226. .TP
  227. .B \-sp
  228. Used when extracting then the original source (if any) will be left
  229. as a tarfile. If it is not already located in the current directory
  230. or if an existing but different file is there it will be copied there.
  231. (\fBThis is the default\fP).
  232. .TP
  233. .B \-su
  234. Unpacks the original source tree.
  235. .TP
  236. .B \-sn
  237. Ensures that the original source is neither copied to the current
  238. directory nor unpacked. Any original source tree that was in the
  239. current directory is still removed.
  240. .PP
  241. All the
  242. .BI \-s X
  243. options are mutually exclusive. If you specify more than one only the
  244. last one will be used.
  245. .
  246. .SH BUGS
  247. The point at which field overriding occurs compared to certain
  248. standard output field settings is rather confused.
  249. The binary package entries in the
  250. .B debian/files
  251. file will be passed through variable substitution twice. This should
  252. not matter, since
  253. .BR $ ", " { " and " }
  254. are not legal in package names or version numbers.
  255. .
  256. .SH SEE ALSO
  257. .BR dpkg\-deb (1),
  258. .BR dpkg (1),
  259. .BR dselect (1).
  260. .
  261. .SH AUTHORS
  262. Copyright (C) 1995-1996 Ian Jackson
  263. .br
  264. Copyright (C) 2000 Wichert Akkerman
  265. .sp
  266. This is free software; see the GNU General Public Licence version 2 or later
  267. for copying conditions. There is NO WARRANTY.