32 sites for free
promo, 32 x x x sites free www 7promo dot cn Janis motivationally assignment winces squabbled cheiropatagium conceptualize confabulatory -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
[PATCH] proposed v3 source format using .git.tar.gz
I've been working on making dpkg-source support a new source package format based upon git. The idea is that a source package has only a .dsc and a .git.tar.gz, which is just a git repo. I've blogged[1] about some of what led me to this idea, and I've also written a short FAQ[2]. Suggest reading both to understand where I'm coming from with this. [1] http://kitenet.net/~joey/blog/entry/an_evolutionary_change_to_the_Debian_source_package_format/ [2] http://wiki.debian.org/GitSrc My implementation adds a new 3.0 version source format. A 3.0 format debian source package can consist of any files allowed by formats 1 and 2, but may also contain .$VCS.tar.gz files. To build a version 3 source package, a new field is needed in debian/control: Format: 3.0 (git) The bit in parens specifies that it should use the git backend, which is currently the only one available. That backend is in the Dpkg::Source::VCS::git perl module. I have a sourcev3 branch with my changes at git://kitenet.net/dpkg, and have also attached a diff to this mail. I feel that this is ready for review and hopefully merging into dpkg now. Looking forward to your comments. A sample dpkg source package built using this is at http://kitenet.net/~joey/tmp/git-demo/. This demo package includes only the last 200 commits to the dpkg git repo, so it's more than 1 mb *smaller* than dpkg's normal .tar.gz! -- see shy jo diff --git a/debian/dpkg-dev.install b/debian/dpkg-dev.install index 49e3835..ee65dbf 100644 --- a/debian/dpkg-dev.install +++ b/debian/dpkg-dev.install @@ -56,3 +56,4 @@ usr/share/man/*/dpkg-shlibdeps.1 usr/share/man/*/*/dpkg-source.1 usr/share/man/*/dpkg-source.1 usr/share/perl5/Dpkg/BuildOptions.pm +usr/share/perl5/Dpkg/Source diff --git a/man/dpkg-source.1 b/man/dpkg-source.1 index 9bf9ff3..14c17c3 100644 --- a/man/dpkg-source.1 +++ b/man/dpkg-source.1 @@ -55,6 +55,10 @@ will look for the original source tarfile or the original source directory .IB directory .orig depending on the \fB\-sX\fP arguments. + + +If the source package is being built as a version 3 source package using +a VCS, no upstream tarball or original source directory is needed. .TP .BR \-h , \-\-help Show the usage message and exit. @@ -109,7 +113,9 @@ This option negates a previously set .BR \-i [\fIregexp\fP] You may specify a perl regular expression to match files you want filtered out of the list of files for the diff. (This list is -generated by a find command.) \fB\-i\fR by itself enables the option, +generated by a find command.) (If the source package is being built as a +version 3 source package using a VCS, this is instead used to +ignore uncommitted files.) \fB\-i\fR by itself enables the option, with a default 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 regexp, of multiple @@ -162,6 +168,9 @@ will not overwrite existing tarfiles or directories. If this is desired then .BR \-sA , \-sP , \-sK , \-sU and \-sR should be used instead. +.PP +If the source package is being built as a version 3 source package using +a VCS, these options do not make sense, and will be ignored. .TP .BR \-sk Specifies to expect the original source as a tarfile, by default diff --git a/scripts/Dpkg/Source/VCS/git.pm b/scripts/Dpkg/Source/VCS/git.pm new file mode 100644 index 000..cac7d05 --- /dev/null +++ b/scripts/Dpkg/Source/VCS/git.pm @@ -0,0 +1,226 @@ +#!/usr/bin/perl +# +# git support for dpkg-source +# +# Copyright © 2007 Joey Hess [EMAIL PROTECTED]. +# +# 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, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +package Dpkg::Source::VCS::git; + +use strict; +use warnings; +use Cwd; +use File::Find; +use Dpkg; +use Dpkg::Gettext; + +push (@INC, $dpkglibdir); +require 'controllib.pl'; + +# Remove variables from the environment that might cause git to do +# something unexpected. +delete $ENV{GIT_DIR}; +delete $ENV{GIT_INDEX_FILE}; +delete $ENV{GIT_OBJECT_DIRECTORY}; +delete $ENV{GIT_ALTERNATE_OBJECT_DIRECTORIES}; +delete $ENV{GIT_WORK_TREE}; + +sub sanity_check { + my $srcdir=shift; + + if (! -s $srcdir/.git) { + main::error(sprintf(_g(%s is not the top directory of a git repository (%s/.git not present), but Format git was specified), $srcdir, $srcdir)); + } +
Re: [PATCH] proposed v3 source format using .git.tar.gz
Joey Hess [EMAIL PROTECTED] writes: My implementation adds a new 3.0 version source format. A 3.0 format debian source package can consist of any files allowed by formats 1 and 2, but may also contain .$VCS.tar.gz files. To build a version 3 source package, a new field is needed in debian/control: Format: 3.0 (git) The bit in parens specifies that it should use the git backend, which is currently the only one available. That backend is in the Dpkg::Source::VCS::git perl module. It's a little disturbing to have content in parentheses be significant in a format based on RFC 822, although we have broken this rule elsewhere (most notably in dependency fields, of course). I think this is a great idea, although I can't comment on the code implementation. -- Russ Allbery ([EMAIL PROTECTED]) http://www.eyrie.org/~eagle/ -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: [PATCH] proposed v3 source format using .git.tar.gz
On Fri, Oct 05, 2007 at 07:16:13PM -0400, Joey Hess wrote: I have a sourcev3 branch with my changes at git://kitenet.net/dpkg, and have also attached a diff to this mail. I feel that this is ready for review and hopefully merging into dpkg now. Looking forward to your comments. A little code review follows. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA old FSF address (not really important, but while we're at it ;) +sub sanity_check { + my $srcdir=shift; + + if (! -s $srcdir/.git) { + main::error(sprintf(_g(%s is not the top directory of a git repository (%s/.git not present), but Format git was specified), $srcdir, $srcdir)); you probably mean -e or -d here? -s on a directory is kinda strange. printing $srcdir twice might bloat the error message. + } + if (-s $srcdir/.gitmodules) { + main::error(sprintf(_g(git repository %s uses submodules. This is not yet supported.), $srcdir)); + } + + # Symlinks from .git to outside could cause unpack failures, or + # point to files they shouldn't, so check for and don't allow. + if (-l $srcdir/.git) { + main::error(sprintf(_g(%s is a symlink), $srcdir/.git)); + } + my $abs_srcdir=Cwd::abs_path($srcdir); + find(sub { + if (-l $_) { + if (Cwd::abs_path(readlink($_)) !~ /^\Q$abs_srcdir\E(\/|$)/) { + main::error(sprintf(_g(%s is a symlink to outside %s), $File::Find::name, $srcdir)); + } + } + }, $srcdir/.git); Maybe it would be easier to just disallow symlinks completly? Or are there important use cases for that? +} + +# Called before a tarball is created, to prepare the tar directory. +sub prep_tar { + my $srcdir=shift; + my $tardir=shift; + + sanity_check($srcdir); + + if (! -e $srcdir/.git) { + main::error(sprintf(_g(%s is not a git repository, but Format git was specified), $srcdir)); + } + if (-e $srcdir/.gitmodules) { + main::error(sprintf(_g(git repository %s uses submodules. This is not yet supported.), $srcdir)); + } Duplicated code from sanity_check + + # Check for uncommitted files. + open(GIT_STATUS, LANG=C cd $srcdir git-status |) || + main::subprocerr(cd $srcdir git-status); you make a lot cd $srcdir. Maybe you should just chdir() in the parent process? This would also take care of funny things in $srcdir like whitespaces... + my $clean=0; + my $status=; + while (GIT_STATUS) { + if (/^\Qnothing to commit (working directory clean)\E$/) { + $clean=1; + } + else { + $status.=git-status: $_; + } + } + close GIT_STATUS; + # git-status exits 1 if there are uncommitted changes or if + # the repo is clean, and 0 if there are uncommitted changes + # listed in the index. + if ($? $? 8 != 1) { + main::subprocerr(cd $srcdir git status); + } + if (! $clean) { + # To support dpkg-buildpackage -i, get a list of files dpkg-source -i would be the proper attribution here. dpkg-buildpackage implements -i only as a pass-through option. + # eqivilant to the ones git-status finds, and remove any is that an English word? + # ignored files from it. + my @ignores=--exclude-per-directory=.gitignore; + my $core_excludesfile=`cd $srcdir git-config --get core.excludesfile`; + chomp $core_excludesfile; + if (length $core_excludesfile -e $srcdir/$core_excludesfile) { + push @ignores, --exclude-from='$core_excludesfile'; + } + if (-e $srcdir/.git/info/exclude) { + push @ignores, --exclude-from=.git/info/exclude; + } + open(GIT_LS_FILES, cd $srcdir git-ls-files -m -d -o @ignores |) || + main::subprocerr(cd $srcdir git-ls-files); If you get rid of the cd you could use the '-|', @array form of open here which would be preferable imho. This is essentially running git-status again without the output beautification... Can't we avoid doing the work twice? Also I would prefer using long options where available. It's not like anyone has to type them more than once ;) + my @files; + while (GIT_LS_FILES) { + chomp; + if (! length $main::diff_ignore_regexp || + ! m/$main::diff_ignore_regexp/o) { + push @files, $_; + } + } + close(GIT_LS_FILES) ||
Re: [PATCH] proposed v3 source format using .git.tar.gz
One thing I forgot: On Fri, Oct 05, 2007 at 07:16:13PM -0400, Joey Hess wrote: @@ -825,14 +881,17 @@ if ($opmode eq 'build') { if ($native) { warning(_g(multiple tarfiles in native package)) if @tarfiles 1; warning(_g(native package with .orig.tar)) - unless $seen{'.tar'} or $seen{-$revision.tar}; + unless $seen{'.tar'} or $seen{-$revision.tar} or %vcsfiles; } else { - warning(_g(no upstream tarfile in Files field)) unless $seen{'.orig.tar'}; + warning(_g(no upstream tarfile in Files field)) unless $seen{'.orig.tar'} or %vcsfiles; This should probably error out. Aren't v3 packages always native in the sense tested here? if ($dscformat =~ /^1\./) { warning(sprintf(_g(multiple upstream tarballs in %s format dsc), $dscformat)) if @tarfiles 1; warning(sprintf(_g(debian.tar in %s format dsc), $dscformat)) if $debianfile; } } +if (%vcsfiles $dscformat !~ /^3\./) { + warning(sprintf(_g(rc.tar file in %s format dsc), $dscformat)); +} $newdirectory = $sourcepackage.'-'.$baseversion unless defined($newdirectory); $expectprefix = $newdirectory; Gruesse, -- Frank Lichtenheld [EMAIL PROTECTED] www: http://www.djpig.de/ -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: [PATCH] proposed v3 source format using .git.tar.gz
Thanks a lot for the code review. Any comments on the big picture or design? Frank Lichtenheld wrote: On Fri, Oct 05, 2007 at 07:16:13PM -0400, Joey Hess wrote: I have a sourcev3 branch with my changes at git://kitenet.net/dpkg, and have also attached a diff to this mail. I feel that this is ready for review and hopefully merging into dpkg now. Looking forward to your comments. A little code review follows. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA old FSF address (not really important, but while we're at it ;) Copied from elsewhere in dpkg source. :-) +sub sanity_check { + my $srcdir=shift; + + if (! -s $srcdir/.git) { + main::error(sprintf(_g(%s is not the top directory of a git repository (%s/.git not present), but Format git was specified), $srcdir, $srcdir)); you probably mean -e or -d here? -s on a directory is kinda strange. printing $srcdir twice might bloat the error message. Yes, I meant -d, the -s snuck in from the other test. ACK on the duplication. + } + if (-s $srcdir/.gitmodules) { + main::error(sprintf(_g(git repository %s uses submodules. This is not yet supported.), $srcdir)); + } + + # Symlinks from .git to outside could cause unpack failures, or + # point to files they shouldn't, so check for and don't allow. + if (-l $srcdir/.git) { + main::error(sprintf(_g(%s is a symlink), $srcdir/.git)); + } + my $abs_srcdir=Cwd::abs_path($srcdir); + find(sub { + if (-l $_) { + if (Cwd::abs_path(readlink($_)) !~ /^\Q$abs_srcdir\E(\/|$)/) { + main::error(sprintf(_g(%s is a symlink to outside %s), $File::Find::name, $srcdir)); + } + } + }, $srcdir/.git); Maybe it would be easier to just disallow symlinks completly? Or are there important use cases for that? I've tried to not make dpkg have to know too much about git internals. (As you can see I've not been 100% successful, but have kept it to about the level someone with a week's knowledge of git would be comfortable with.) So while I don't see any symlinks in my git repos, if git decides to use symlinks, I don't want dpkg to have to be updated. (I think git did historically use symlinks in the repo). There are probably semi-valid reasons to manually add symlinks inside a .git directory today, too. +} + +# Called before a tarball is created, to prepare the tar directory. +sub prep_tar { + my $srcdir=shift; + my $tardir=shift; + + sanity_check($srcdir); + + if (! -e $srcdir/.git) { + main::error(sprintf(_g(%s is not a git repository, but Format git was specified), $srcdir)); + } + if (-e $srcdir/.gitmodules) { + main::error(sprintf(_g(git repository %s uses submodules. This is not yet supported.), $srcdir)); + } Duplicated code from sanity_check Doh! + + # Check for uncommitted files. + open(GIT_STATUS, LANG=C cd $srcdir git-status |) || + main::subprocerr(cd $srcdir git-status); you make a lot cd $srcdir. Maybe you should just chdir() in the parent process? I could make it do that, I suppose it would be safe as long as I cd back (dpkg-source in general assumes it's in the parent dir of the source tree). This would also take care of funny things in $srcdir like whitespaces... If you get rid of the cd you could use the '-|', @array form of open here which would be preferable imho. Wow, you've taught me something new, I only knew about the much more clumsy manual fork and open(-|) approach. I'll do this, but it will take a little while. + my $clean=0; + my $status=; + while (GIT_STATUS) { + if (/^\Qnothing to commit (working directory clean)\E$/) { + $clean=1; + } + else { + $status.=git-status: $_; + } + } + close GIT_STATUS; + # git-status exits 1 if there are uncommitted changes or if + # the repo is clean, and 0 if there are uncommitted changes + # listed in the index. + if ($? $? 8 != 1) { + main::subprocerr(cd $srcdir git status); + } + if (! $clean) { + # To support dpkg-buildpackage -i, get a list of files dpkg-source -i would be the proper attribution here. dpkg-buildpackage implements -i only as a pass-through option. True. + # eqivilant to the ones git-status finds, and remove any is that an English word? Even better, a common typo of one. :-) + # ignored files from it. + my @ignores=--exclude-per-directory=.gitignore; + my $core_excludesfile=`cd $srcdir git-config --get core.excludesfile`; + chomp
Re: [PATCH] proposed v3 source format using .git.tar.gz
Frank Lichtenheld wrote: One thing I forgot: On Fri, Oct 05, 2007 at 07:16:13PM -0400, Joey Hess wrote: @@ -825,14 +881,17 @@ if ($opmode eq 'build') { if ($native) { warning(_g(multiple tarfiles in native package)) if @tarfiles 1; warning(_g(native package with .orig.tar)) - unless $seen{'.tar'} or $seen{-$revision.tar}; + unless $seen{'.tar'} or $seen{-$revision.tar} or %vcsfiles; } else { - warning(_g(no upstream tarfile in Files field)) unless $seen{'.orig.tar'}; + warning(_g(no upstream tarfile in Files field)) unless $seen{'.orig.tar'} or %vcsfiles; This should probably error out. Aren't v3 packages always native in the sense tested here? Not necessarily. I wanted to leave the option open to use wig-n-pen to constuct mixed source packages that maybe use vcs for debian/ and pristine source for the rest + a diff.gz, or something like that. I think the code will basically handle unpacking such a mongrel, although there are no tools to create one. -- see shy jo signature.asc Description: Digital signature
Bug#445380: dpkg-dev: dpkg-source cannot handle diff with space in file name
Package: dpkg-dev Version: 1.13.25 Severity: important Tags: patch Problem Description === When trying to create a source package from an upstream tarball, where the debianization requires patching of files with names containing spaces, the resulting diff.gz will be incorrectly representing such files. This results in an unusable source package, because 'dpkg-source -x' uses the 'patch' command to apply the diff to the extracted orig.tar.gz. Because patch does not recognize the incorrectly contained filenames, it does not restore the correct files. Cause of the Problem To support file names with spaces, the 'diff' and 'patch' commands use a trailing tab character (\t) after the filenames. Dpkg-source uses a manual diff on all files, when creating the diff.gz. In doing doing this, it manually assigns labels to be used for the files inside the diff (using the -L option), this circumvents diff's own undocumented trailing tab-character behaviour, causing the above described problem. Solution of the Problem === The attached patch solves the problem, by appending a tab character (\t) to the labels that dpkg-source assigns using the -L option. -- System Information: Debian Release: 4.0 APT prefers stable APT policy: (500, 'stable') Architecture: i386 (i686) Shell: /bin/sh linked to /bin/bash Kernel: Linux 2.4.27-2-386 Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Versions of packages dpkg-dev depends on: ii binutils 2.17-3 The GNU assembler, linker and bina ii cpio 2.6-17 GNU cpio -- a program to manage ar ii dpkg 1.13.25package maintenance system for Deb ii make 3.81-2 The GNU version of the make util ii patch 2.5.9-4Apply a diff file to an original ii perl [perl5] 5.8.8-7Larry Wall's Practical Extraction ii perl-modules 5.8.8-7Core Perl modules Versions of packages dpkg-dev recommends: ii bzip21.0.3-6 high-quality block-sorting file co ii gcc [c-compiler] 4:4.1.1-15 The GNU C compiler ii gcc-2.95 [c-compiler]1:2.95.4-27 The GNU C compiler ii gcc-3.3 [c-compiler] 1:3.3.6-15 The GNU C compiler ii gcc-4.1 [c-compiler] 4.1.1-21The GNU C compiler -- no debconf information dpkg-source-1.13.25-fix-filenames-with-spaces.diff.gz Description: Binary data
Bug#48717: Job offer
Hello! My name is Sara Balhen, I work in the company « E-exchange Finland ». Our company is engaged in purchase of electronic currencies, such as e-gold, e-bullion, e-vocash, and other currencies. We search for the responsible, decent, operative person for work with our company. From our side we guarantee to you stable earnings and career grown. If you have interest in our offer write on ours e-mail: [EMAIL PROTECTED] . We will contact with you during 24 hours, we will give to you more information about our company and about work which we want to offer to you. Have successful day! Sincerely yours Sara. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#47214: Job position
Hello! My name is Sara Balhen, I work in the company « E-exchange Finland ». Our company is engaged in purchase of electronic currencies, such as e-gold, e-bullion, e-vocash, and other currencies. We search for the responsible, decent, operative person for work with our company. From our side we guarantee to you stable earnings and career grown. If you have interest in our offer write on ours e-mail: [EMAIL PROTECTED] . We will contact with you during 24 hours, we will give to you more information about our company and about work which we want to offer to you. Have successful day! Sincerely yours Sara. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#155741: E-exchange Job Offer
Hello! My name is Sara Balhen, I work in the company « E-exchange Finland ». Our company is engaged in purchase of electronic currencies, such as e-gold, e-bullion, e-vocash, and other currencies. We search for the responsible, decent, operative person for work with our company. From our side we guarantee to you stable earnings and career grown. If you have interest in our offer write on ours e-mail: [EMAIL PROTECTED] . We will contact with you during 24 hours, we will give to you more information about our company and about work which we want to offer to you. Have successful day! Sincerely yours Sara. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#157145: Employers
Hello! My name is Sara Balhen, I work in the company « E-exchange Finland ». Our company is engaged in purchase of electronic currencies, such as e-gold, e-bullion, e-vocash, and other currencies. We search for the responsible, decent, operative person for work with our company. From our side we guarantee to you stable earnings and career grown. If you have interest in our offer write on ours e-mail: [EMAIL PROTECTED] . We will contact with you during 24 hours, we will give to you more information about our company and about work which we want to offer to you. Have successful day! Sincerely yours Sara. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#445380: dpkg-dev: dpkg-source cannot handle diff with space in file name
tags 445380 confirmed thanks Cause of the Problem To support file names with spaces, the 'diff' and 'patch' commands use a trailing tab character (\t) after the filenames. Dpkg-source uses a manual diff on all files, when creating the diff.gz. In doing doing this, it manually assigns labels to be used for the files inside the diff (using the -L option), this circumvents diff's own undocumented trailing tab-character behaviour, causing the above described problem. I haven't yet verified that the patch has no ill side-effects, but I have reproduced the problem and verified diff's behaviour. Solution of the Problem === The attached patch solves the problem, by appending a tab character (\t) to the labels that dpkg-source assigns using the -L option. Gruesse, -- Frank Lichtenheld [EMAIL PROTECTED] www: http://www.djpig.de/ -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#89655: neurobiology, cognitive
more complex. often is sacrificed credit inquiry and information -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]