'\" -*- coding: UTF-8 -*- .if \n(.g .ds T< \\FC .if \n(.g .ds T> \\F[\n[.fam]] .de URL \\$2 \(la\\$1\(ra\\$3 .. .if \n(.g .mso www.tmac .TH gbp-import-orig 1 "15 December 2023" "" "git-buildpackage Manual" .SH NAME gbp-import-orig \- Import an upstream source into a git repository .SH SYNOPSIS 'nh .fi .ad l \*(T<\fBgbp\ import\-orig\fR\*(T> \kx .if (\nx>(\n(.l/2)) .nr x (\n(.l/5) 'in \n(.iu+\nxu [\*(T<\fB\-\-version\fR\*(T>] [\*(T<\fB\-\-help\fR\*(T>] [\*(T<\fB\-\-verbose\fR\*(T>] [\*(T<\fB\-\-color=\fR\*(T>[auto|on|off]] [\*(T<\fB\-\-color\-scheme=\fR\*(T> \fICOLOR_SCHEME\fR] [\*(T<\fB\-\-upstream\-version=\fR\*(T> \fIversion\fR] [\*(T<\fB\-\-[no\-]merge\fR\*(T>] [\*(T<\fB\-\-merge\-mode=\fR\*(T> \fI[auto|merge|replace]\fR] [\*(T<\fB\-\-upstream\-branch=\fR\*(T> \fIbranch_name\fR] [\*(T<\fB\-\-debian\-branch=\fR\*(T> \fIbranch_name\fR] [\*(T<\fB\-\-upstream\-vcs\-tag=\fR\*(T> \fItag-format\fR] [\*(T<\fB\-\-[no\-]sign\-tags\fR\*(T>] [\*(T<\fB\-\-keyid=\fR\*(T> \fIgpg-keyid\fR] [\*(T<\fB\-\-upstream\-tag=\fR\*(T> \fItag-format\fR] [\*(T<\fB\-\-filter=\fR\*(T> \fIpattern\fR]\&... [\*(T<\fB\-\-component=\fR\*(T> \fIcomponent\fR]\&... [\*(T<\fB\-\-[no\-]pristine\-tar\fR\*(T>] [\*(T<\fB\-\-[no\-]filter\-pristine\-tar\fR\*(T>] [\*(T<\fB\-\-[no\-]symlink\-orig\fR\*(T>] [\*(T<\fB\-\-postimport=cmd\fR\*(T>] [\*(T<\fB\-\-postunpack=cmd\fR\*(T>] [\*(T<\fB\-\-[no\-]interactive\fR\*(T>] [\*(T<\fB\-\-[no\-]rollback\fR\*(T>] [\*(T<\fB\-\-upstream\-signatures=\fR\*(T>[auto|on|off]] \fIfilename\fR | \fIurl\fR | \*(T<\fB\-\-uscan\fR\*(T> 'in \n(.iu-\nxu .ad b 'hy .SH DESCRIPTION \fBgbp\ import-orig\fR imports upstream sources into a Git repository. It can import from three sources: .TP 0.4i 1. \fIfilename\fR: A file in the local file system. Gzip, bzip2, lzma and xz compressed tar archives, zip archives and already unpacked source trees are supported. .TP 0.4i 2. \fIurl\fR: The tarball is downloaded from a \fIhttp\fR or \fIhttps\fR \fIurl\fR. This needs the python3-request package installed. .TP 0.4i 3. \*(T<\fB\-\-uscan\fR\*(T>: The latest upstream or specified version is fetched via \fBuscan\fR relying on \*(T<\fIdebian/watch\fR\*(T>. .PP If the tarballs name is already of the form \fIpackage-name_version.orig.tar.gz\fR, the version information is determined from the tarball's filename, otherwise it can be given on the command line via \*(T<\fB\-\-upstream\-version\fR\*(T>. If the source package name or version can't be determined, \fBgbp\ import-orig\fR will prompt for it unless \*(T<\fB\-\-no\-interactive\fR\*(T> is given. .PP The sources are placed on the upstream branch (default: \fIupstream\fR), tagged and merged onto the debian branch (default: \fImaster\fR). This is either done using plain \fBgit merge\fR or by creating a new tree that consists of the new upstream version plus the \*(T<\fIdebian/\fR\*(T> directory. The later is used for source format 3.0 (quilt) packages since direct modifications of the upstream sources are not allowed in that format and so a 1:1 replacement of the upstream sources is almost always desired. It can be tweaked via the \*(T<\fB\-\-merge\-mode\fR\*(T>. .PP In case of an error \fBgbp\ import-orig\fR will rollback (undo) all changes it has done to the repository (see the \*(T<\fB\-\-rollback\fR\*(T> option). .PP Note that for projects using multiple tarballs the name of the additional components needs to be specified via the \*(T<\fB\-\-component\fR\*(T> command line option or via \*(T<\fIgbp.conf\fR\*(T> (see below for details). .SH OPTIONS .TP \*(T<\fB\-\-version\fR\*(T> Print version of the program, i.e. version of the git-buildpackage suite .TP \*(T<\fB\-v\fR\*(T>, \*(T<\fB\-\-verbose\fR\*(T> Verbose execution .TP \*(T<\fB\-h\fR\*(T>, \*(T<\fB\-\-help\fR\*(T> Print help and exit .TP \*(T<\fB\-\-color=\fR\*(T>[auto|on|off] Whether to use colored output. .TP \*(T<\fB\-\-color\-scheme=\fR\*(T>\fICOLOR_SCHEME\fR Colors to use in output (when color is enabled). The format for COLOR_SCHEME is \&':::'. Numerical values and color names are accepted, empty fields imply the default color. For example, \*(T<\fB\-\-git\-color\-scheme=\fR\*(T>\*(T<'cyan:34::'\*(T> would show debug messages in cyan, info messages in blue and other messages in default (i.e. warning and error messages in red). .TP \*(T<\fB\-\-upstream\-version\fR\*(T>=\fIversion\fR, \*(T<\fB\-u\fR\*(T>\fIversion\fR The upstream version number. With \*(T<\fB\-\-uscan\fR\*(T>, passed to uscan as \*(T<\fB\-\-download\-debversion\fR\*(T> .TP \*(T<\fB\-\-[no\-]merge\fR\*(T> Merge the upstream branch to the Debian branch after import .TP \*(T<\fB\-\-merge\-mode=\fR\*(T>\fI[auto|merge|replace]\fR How to fold the newly imported upstream source to the Debian packaging branch after import. \fImerge\fR does a Git \fBmerge\fR leaving you on your own in case of merge conflict resolution. \fIreplace\fR mode on the other hand makes the head of the Debian packaging branch identical to the newly imported tree but preserves the content of the \*(T<\fIdebian/\fR\*(T> directory while keeping the current head as well as the newly imported tree as parents of the generated commit. This is similar to a \*(T<\fBtheirs\fR\*(T> merge strategy while preserving \*(T<\fIdebian/\fR\*(T>. The default is \fIauto\fR which uses \fIreplace\fR for 3.0 (quilt) packages and \fImerge\fR otherwise. .TP \*(T<\fB\-\-upstream\-branch\fR\*(T>=\fIbranch_name\fR The branch in the Git repository the upstream sources are put onto. Default is \fIupstream\fR. .TP \*(T<\fB\-\-debian\-branch\fR\*(T>=\fIbranch_name\fR The branch in the Git repository the Debian package is being developed on, default is \fImaster\fR. After importing the new sources on the upstream branch, \fBgbp\ import-orig\fR will try to merge the new version onto this branch. .TP \*(T<\fB\-\-upstream\-vcs\-tag\fR\*(T>=\fItag-format\fR Add \fItag-format\fR as additional parent to the commit of the upstream tarball. Useful when upstream uses git and you want to link to its revision history. The \fItag-format\fR can be a pattern similar to what \*(T<\fB\-\-upstream\-tag\fR\*(T> supports. .TP \*(T<\fB\-\-[no\-]sign\-tags\fR\*(T> GPG sign all created tags. .TP \*(T<\fB\-\-keyid=\fR\*(T>\fIgpg-keyid\fR Use this \fIkeyid\fR for gpg signing tags. .TP \*(T<\fB\-\-upstream\-tag=\fR\*(T>\fItag-format\fR Use this tag format when tagging upstream versions, default is \fIupstream/%(version)s\fR. .TP \*(T<\fB\-\-import\-msg=\fR\*(T>\fImsg-format\fR Use this format string for the commit message when importing upstream versions, default is \fINew upstream version %(version)s\fR. .TP \*(T<\fB\-\-filter=\fR\*(T>\fIpattern\fR Filter out files glob-matching \fIpattern\fR. This option can be given multiple times. .TP \*(T<\fB\-\-component=\fR\*(T>\fICOMPONENT\fR When importing the upstream tarball also look for an additional tarball with component name \fICOMPONENT\fR. E.g. in \*(T<\fIhello\-debhelper_1.0.orig\-foo.tar.gz\fR\*(T> the component would be \fIfoo\fR. The additional tarball is expected to be in the same directory than the upstream tarball and to use the same compression type. You also need to specify the components when using \*(T<\fB\-\-uscan\fR\*(T>. Using additional original tarballs is a feature of the 3.0 (quilt) source format. See the \fBdpkg-source\fR manpage for details. This is currently considered an experimental feature and might change incompatibly. .TP \*(T<\fB\-\-[no\-]pristine\-tar\fR\*(T> Generate \fBpristine-tar\fR delta file. .TP \*(T<\fB\-\-[no\-]filter\-pristine\-tar\fR\*(T> If using a filter, also filter the files out of the tarball passed to \fBpristine-tar\fR. .TP \*(T<\fB\-\-[no\-]symlink\-orig\fR\*(T> Whether to create and keep a symlink from the upstream tarball to a Debian policy conformant upstream tarball name located in \*(T<\fI\&../\fR\*(T>. This is a good idea if not using \fBpristine-tar\fR since it avoids creating a new tarball with a different md5sum. .TP \*(T<\fB\-\-postimport=\fR\*(T>\fIcmd\fR Run \fIcmd\fR after the import. The hook gets the following environment variables passed: .RS .TP \fBGBP_BRANCH\fR The name of the Debian packaging branch .TP \fBGBP_TAG\fR The name of the just created upstream tag .TP \fBGBP_UPSTREAM_VERSION\fR The just imported upstream version .TP \fBGBP_DEBIAN_VERSION\fR The Debian version of the package with a Debian revision of '-1' .RE .TP \*(T<\fB\-\-postunpack=\fR\*(T>\fIcmd\fR Run \fIcmd\fR after the import. This can be useful to e.g. convert or remove certain files prior to the import. The hook gets passed the following environment variables: .RS .TP \fBGBP_TMP_DIR\fR The temporary directory the tarballs are unapcked into. .TP \fBGBP_SOURCES_DIR\fR The temporary directory where the unpacked sources are. .TP \fBGBP_GIT_DIR\fR The directory of the git repository where the tarball will be imported into. .RE .TP \*(T<\fB\-\-uscan\fR\*(T> Use \fBuscan\fR to fetch new upstream version. The version can be specified with \*(T<\fB\-\-upstream\-version\fR\*(T> .TP \*(T<\fB\-\-[no\-]interactive\fR\*(T> Run command interactively, i.e. ask package name and version if needed. .TP \*(T<\fB\-\-[no\-]rollback\fR\*(T> Rollback changes in case of an error. .TP \*(T<\fB\-\-upstream\-signatures=\fR\*(T>[auto|on|off] Whether upstream signatures should be imported as well (when using pristine-tar). \fIoff\fR turns this off completely while \fIon\fR always tries to import a signature (which can be useful if you want to fail if e.g. \fBuscan\fR did not fetch a signature). The default \fIauto\fR means to import a signature file if present but do nothing otherwise. .SH EXAMPLES Download and import a new upstream version using the information from \*(T<\fIdebian/watch\fR\*(T> .PP .nf \*(T< \fBgbp\ import\-orig\fR \-\-uscan\*(T> .fi .PP Fetch tarball from an URL .PP .nf \*(T< \fBgbp\ import\-orig\fR https://debian.example.com/sid/upstream\-tarball\-0.1.tar.gz\*(T> .fi .PP Import a local tarball .PP .nf \*(T< \fBgbp\ import\-orig\fR ../upstream\-tarball\-0.1.tar.gz\*(T> .fi .SH "CONFIGURATION FILES" Several \*(T<\fIgbp.conf\fR\*(T> files are parsed to set defaults for the above command-line arguments. See the \fBgbp.conf\fR(5) manpage for details. .SH "SEE ALSO" \fBgbp-buildpackage\fR(1), \fBgbp-import-dsc\fR(1), \fBgbp-import-dscs\fR(1), \fBgbp-dch\fR(1), \fBgbp.conf\fR(5), \fBuscan\fR(1), \fBdebuild\fR(1), \fBgit\fR(1), \fBpristine-tar\fR(1), .URL file:///usr/share/doc/git-buildpackage/manual-html/index.html " The Git-Buildpackage Manual" .SH AUTHOR Guido G\(:unther <\*(T>