From 4d57e0a8dab2139a631a21aab862487481548702 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 22:32:59 +0200 Subject: Adding upstream version 2.23.7. Signed-off-by: Daniel Baumann --- scripts/mk-origtargz.pl | 222 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 222 insertions(+) create mode 100755 scripts/mk-origtargz.pl (limited to 'scripts/mk-origtargz.pl') diff --git a/scripts/mk-origtargz.pl b/scripts/mk-origtargz.pl new file mode 100755 index 0000000..4c2ff00 --- /dev/null +++ b/scripts/mk-origtargz.pl @@ -0,0 +1,222 @@ +#!/usr/bin/perl +# vim: set ai shiftwidth=4 tabstop=4 expandtab: +# +# mk-origtargz: Rename upstream tarball, optionally changing the compression +# and removing unwanted files. +# Copyright (C) 2014 Joachim Breitner +# Copyright (C) 2015 James McCoy +# +# It contains code formerly found in uscan. +# Copyright (C) 2002-2006, Julian Gilbey +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +=head1 NAME + +mk-origtargz - rename upstream tarball, optionally changing the compression and removing unwanted files + +=head1 SYNOPSIS + +=over + +=item B [I] F + +=item B B<--help> + +=back + +=head1 DESCRIPTION + +B renames the given file to match what is expected by +B, based on the source package name and version in +F. It can convert B to B, optionally change the +compression scheme and remove files according to B and +BI in F. The resulting file is +placed in F. (In F, the B and +BI stanzas are a part of the first paragraph and +there is a blank line before the following paragraphs which contain B +and other stanzas. The B stanza may be used to ignore +parts of subdirectories specified by the B stanza See +B(1) "COPYRIGHT FILE EXAMPLE".) + +The archive type for B is detected by "B" command. So any B type archives such as B and B +are treated in the same way. + +If the package name is given via the B<--package> option, no information is +read from F, and the result file is placed in the current directory. + +B is commonly called via B, which first obtains the +upstream tarball. + +=head1 OPTIONS + +=head2 Metadata options + +The following options extend or replace information taken from F. + +=over + +=item B<--package> I + +Use I as the name of the Debian source package, and do not require or +use a F directory. This option can only be used together with +B<--version>. + +The default is to use the package name of the first entry in F. + +=item B<-v>, B<--version> I + +Use I as the version of the package. This needs to be the upstream +version portion of a full Debian version, i.e. no Debian revision, no epoch. + +The default is to use the upstream portion of the version of the first entry in +F. + +=item B<--exclude-file> I + +Remove files matching the given I from the tarball, as if it was listed in +B. + +=item B<--copyright-file> I + +Remove files matching the patterns found in I, which should have the +format of a Debian F file +(B +to be precise). Errors parsing that file are silently ignored, exactly as is +the case with F. + +Unmatched patterns will emit a warning so the user can verify whether it is +correct. If there are multiple patterns which match a file, only the last one +will count as being matched. + +Both the B<--exclude-file> and B<--copyright-file> options amend the list of +patterns found in F. If you do not want to read that file, +you will have to use B<--package>. + +=item B<--signature> I + +Set I: + +=over + +=item 0 for no signature + +=item 1 for normal detached signature + +=item 2 for signature on decompressed + +=item 3 for self signature + +=back + +=item B<--signature-file> I + +Use I as the signature file corresponding to the Debian source +package to create a B (post-stretch) compatible signature file. +(optional) + +=back + +=head2 Action options + +These options specify what exactly B should do. The options +B<--copy>, B<--rename> and B<--symlink> are mutually exclusive. + +=over + +=item B<--symlink> + +Make the resulting file a symlink to the given original file. (This is the +default behaviour.) + +If the file has to be modified (because it is a B, B or B file, +because of B<--repack> or B), this option behaves like +B<--copy>. + +=item B<--copy> + +Make the resulting file a copy of the original file (unless it has to be +modified, of course). + +=item B<--rename> + +Rename the original file. + +If the file has to be modified (because it is a B, B, B file, +because of B<--repack> or B), this implies that the original +file is deleted afterwards. + +=item B<--repack> + +If the given file is not compressed using the desired format (see +B<--compression>), recompress it. + +=item B<-S>, B<--repack-suffix> I + +If the file has to be modified, because of B, append I +to the upstream version. + +=item B<--force-repack> + +Recompress even if file is compressed using the desired format and no files +were deleted. + +=item B<-c>, B<--component> I + +Use as the component name for the secondary upstream tarball. +Set I as the component name. This is used only for the +secondary upstream tarball of the Debian source package. +Then I is created. + +=item B<--compression> [ B | B | B | B | B ] + +The default method is B. When mk-origtargz is launched in a debian source +repository which format is "1.0" or undefined, the method switches to B. + +=item B<-C>, B<--directory> I + +Put the resulting file in the given directory. + +=item B<--unzipopt> I + +Add the extra options to use with the B command such as B<-a>, B<-aa>, +and B<-b>. + +=back + +=cut + +#=head1 CONFIGURATION VARIABLES +# +#The two configuration files F and +#F<~/.devscripts> are sourced by a shell in that order to set +#configuration variables. Command line options can be used to override +#configuration file settings. Environment variable settings are ignored +#for this purpose. The currently recognised variables are: + +=head1 SEE ALSO + +B(1), B(1) + +=head1 AUTHOR + +B and this manpage have been written by Joachim Breitner +>. + +=cut + +use Devscripts::MkOrigtargz; + +exit Devscripts::MkOrigtargz->new->do; -- cgit v1.2.3