Bug#504233: Fwd: r11871 - in /deb-maint/svn-buildpackage/trunk: SDCommon.pm debian/changelog
2008/12/7 Jan Hauke Rahm [EMAIL PROTECTED]: tag 363003 +patch tag 422342 +patch thanks Just for the record, a new patch is attached. That looks sane. Please try to build the package with that patch (to check that the docs build; I assume you checked the patch works ;-) ) and if that works, please commit, if you didn't already. -- Regards, EddyP = Imagination is more important than knowledge A.Einstein -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#504233: Fwd: r11871 - in /deb-maint/svn-buildpackage/trunk: SDCommon.pm debian/changelog
2008/12/9 Eddy Petrișor [EMAIL PROTECTED]: 2008/12/7 Jan Hauke Rahm [EMAIL PROTECTED]: tag 363003 +patch tag 422342 +patch thanks Just for the record, a new patch is attached. When I said that I was referring to the patch ignoredfilesaction.diff. Please try to avoid to maneuver bugs in a follow up mail without commenting on the changes. For a second I was confused and I was thinking that I said ok for a patch for 422342/363003. -- Regards, EddyP = Imagination is more important than knowledge A.Einstein
Bug#504233: Fwd: r11871 - in /deb-maint/svn-buildpackage/trunk: SDCommon.pm debian/changelog
tag 363003 +patch tag 422342 +patch thanks Just for the record, a new patch is attached. Hauke Index: debian/changelog === --- debian/changelog (revision 11968) +++ debian/changelog (working copy) @@ -30,8 +30,10 @@ * improved copyright file [ Jan Hauke Rahm ] - * SDCommon.pm: Trigger a warning when files are ignored by subversion -(Closes: #504233) + * When files are ignored due to subversion ignore patterns the user gets +prompted to skip or import those files; in noninteractive mode those files +are automatically skiped unless '--ignored-files-action=import' (only in +svn-upgrade) is set. (Closes: #504233) * Dropping support for linda (Closes: #502653) [ Eddy Petrișor ] Index: doc/svn-upgrade.sgml === --- doc/svn-upgrade.sgml (revision 11968) +++ doc/svn-upgrade.sgml (working copy) @@ -173,7 +173,18 @@ /glossdef /glossentry -para + glossentry +glossterm + cmdsynopsisgroup +argoption--ignored-files-action STRING/option/arg + /group/cmdsynopsis +/glossterm +glossdef + paraMake files that are ignored due to subversion ignore patterns to be 'import'ed or 'skip'ed./para +/glossdef + /glossentry + + para Tarballs must be compressed with gzip or bzip2. /para Index: SDCommon.pm === --- SDCommon.pm (revision 11968) +++ SDCommon.pm (working copy) @@ -579,17 +579,28 @@ for(keys %tmp) { if($tmp{$_} == 2) { $ctx-add($_, 1); -} elsif($tmp{$_} == 11) { # subversion ignores some files, like .swp from vim; see #504233 for details -print STDERR One or more files are ignore due to global subversion ignore patterns,\n\tquit the process here? [y/n?]: ; -prompt: -my $ans = STDIN; -if($ans !~ /^[yn]/i) { -print STDERR The choices are:\n\tYes (y) which means aborting, or No (n) which means to NOT include those files.\n; -goto prompt; -} -if($ans =~ /^y$/i) { -exwerror(Aborting.\n); -} +} elsif($tmp{$_} == 11) { + if ($SDCommon::opt_ignored_files_action) { + exwerror Action for ignored files must be either 'import' or 'skip'!\nAborting! +unless ($SDCommon::opt_ignored_files_action eq import or $SDCommon::opt_ignored_files_action eq skip); + $ctx-add($_, 1) if $SDCommon::opt_ignored_files_action eq import; + } else { + unless ($SDCommon::opt_noninteractive) { + print STDERR One or more files are ignore due to (global) subversion ignore patterns,\n\thow to procede (quit, import, skip)? [Qis?]: ; + prompt: + my $ans = STDIN; + exwerror Aborting!\n if ($ans =~ /^$/ or $ans =~ /^q/i); + if ($ans =~ /^i/i) { +$ctx-add($_, 1); +$SDCommon::opt_ignored_files_action = import; + } elsif ($ans =~ /^s/i) { +$SDCommon::opt_ignored_files_action = skip; + } else { +print STDERR Your choices are:\n\tQuit (q), import (i) which means to add ignored files or skip (s)\n\twhich means to NOT include those files.\n; +goto prompt; + } + } + } } } chdir $curdir; Index: svn-upgrade === --- svn-upgrade (revision 11968) +++ svn-upgrade (working copy) @@ -26,6 +26,8 @@ -r, --replay-conflicting Special cleanup action: replaces all conflicting files with upstream versions -N, --noautodch Upgrade without making a new changelog entry + --ignored-files-action STRINGMake files that are ignored due to subversion + ignore patterns to be either 'import'ed or 'skip'ed The new source may be a tarball compressed with gzip or bzip2 or a directory with extraced source. @@ -49,6 +51,7 @@ my $opt_noautodch; my $opt_noninteractive; my $opt_ignoreerrors; +my $opt_ignored_files_action; my %options = ( h|help= \$opt_help, @@ -61,6 +64,7 @@ N|noautodch = \$opt_noautodch, noninteractive= \$opt_noninteractive, ignoreerrors = \$opt_ignoreerrors, + ignored-files-action=s= \$opt_ignored_files_action, ); my $retval = 0; @@ -75,7 +79,7 @@ next SKIP if /^#/; # drop leading spaces s/^\s+//; -if(/^svn-(noautodch|noninteractive|ignoreerrors|verbose|force|clean|replay-conflicting)/) { +
Bug#504233: Fwd: r11871 - in /deb-maint/svn-buildpackage/trunk: SDCommon.pm debian/changelog
Jan Hauke Rahm a scris: Hi Eddy, On Fri, Nov 28, 2008 at 06:49:46PM +0200, Eddy Petrișor wrote: OTOH, if failing can be avoided (svn add --no-ignore everything except .svn dirs), I think that is preferable. So, since using svn add --no-ignore would yeld the same results for interactive for as for noninteractive builds and avoids creating a prompt, I think that we should investigate into that option. Okay, I figured out something different, patch is attached. It's now simply printing a note about files being ignored and tries to add them via the SVN::Client connection. What would you say? That sounds sane, but it seems you forgot to attach the patch (the second time) and since the current one is outdated, makes sense for me to wait :-) . Off topic: Why is that line return 1 if ($SDCommon::opt_ignoreerrors); in sub withechoNoPrompt? As far as I can see (and debug) that means that no command is executed when noninteractive and ignoreerrors are set. It just returns 1. That pretty much looks like a bug, doesn't it? (I'm becoming more cautious) No, it makes noninteractive builds not fail on errors which otherwise would have stopped the build when --svn-ignoreerrors is passed. I see the idea but I don't see the command being executed in that case. See the lines around it: , | print STDERR $cmd\n if(!$SDCommon::opt_quiet); | return 1 if ($SDCommon::opt_ignoreerrors); | return (!system(@_)); ` That is the whole point, there are some prompts that aren't critical for successful building the package in an automated environment (e.g.: things like being unable to automatically upgrade a package when no upstream release was done - i.e. the version is the same in upstream as in our repo) but still are an abnormal situation. There are several such cases where an abnormal situation should just be ignored for automated builders or similar automated tools. In a better implementation, we would rather have prompts with a default answer preselected in case of failure so, depending on the thing that failed, svn-bp would ignore by default or quit by default. Ideally, it would be nice to have the possibility to specify which individual commands would be OK to fail (and be ignored) by some sort of configuration in ~/.svn-buildpackage.conf. In other words, for a setup which tries periodically operations that may fail regularly in certain spots, the conf file would specify those particular commands (or groups). But, in the end, I really think we should provide some mechanism to hardcode a default answer in case of non-interactive builds for each question and a way to override that. Just to make things clear with an example. Suppose: - you have an upstream which releases .tar.bz2 files so you have to repackage to .tar.gz - your upstream might add undesired files in the package, but you have to check them individually - you have an automated builder which tries to update your package in the repo as soon as upstream releases; that builder sends you an email with the log for that operation Now, a new upstream comes along with a .swp file in it. Your builder should simply ignore the file and not include it in the repackaged source since you'd check the log anyway, so is OK for it to ignore the new file and let the builder try to build the new package. If you didn't had any way to specify that you want to ignore new files by default, your builder would choke by default and fail to help you. the actual system call wouldn't be executed with ignoreerrors set, or am I missing something here? No, you are correct. It is just that the granularity of the option is too coarse since is either ignore all or fail on the first error. PS: Sorry for not commiting the other thing; I was not at home this weekend. Thanks for doing that! no problem -- Regards, EddyP = Imagination is more important than knowledge A.Einstein signature.asc Description: OpenPGP digital signature
Bug#504233: Fwd: r11871 - in /deb-maint/svn-buildpackage/trunk: SDCommon.pm debian/changelog
On Fri, Dec 05, 2008 at 02:00:07PM +0200, Eddy Petrișor wrote: That sounds sane, but it seems you forgot to attach the patch (the second time) and since the current one is outdated, makes sense for me to wait :-) . Seems I need some holidays... :) And *now* the patch *will be* attached! , | print STDERR $cmd\n if(!$SDCommon::opt_quiet); | return 1 if ($SDCommon::opt_ignoreerrors); | return (!system(@_)); ` That is the whole point, there are some prompts that aren't critical for successful building the package in an automated environment (e.g.: things like being unable to automatically upgrade a package when no upstream release was done - i.e. the version is the same in upstream as in our repo) but still are an abnormal situation. There are several such cases where an abnormal situation should just be ignored for automated builders or similar automated tools. It's not about prompts here but about commands being executed. E.g.: You have a command withecho('svn', 'co', 'whatever'); and $opt_noninteractive set. All args of withecho would get passed to withechoNoPrompt which would do the rest. If you then have $opt_ignoreerrors set it would just return 1 but it would never do the 'system(@_)' and so never execute the command. Concludes: withechoNoPrompt with noninteractive and ignoreerrors would not ignore if a command fails but ignore the command at all, wouldn't it? Sorry for bothering if I'm talking nonsense but that's what these lines look like to me... :-/ In a better implementation, we would rather have prompts with a default answer preselected in case of failure so, depending on the thing that failed, svn-bp would ignore by default or quit by default. I agree! Hauke Index: SDCommon.pm === --- SDCommon.pm (revision 11938) +++ SDCommon.pm (working copy) @@ -575,20 +575,20 @@ %tmp=(); $statusref=\%tmp; $ctx-status(, BASE, \collect_name, 1, 1, 0, 1); +my $ignorewarn = 0; for(keys %tmp) { if($tmp{$_} == 2) { $ctx-add($_, 1); -} elsif($tmp{$_} == 11) { # subversion ignores some files, like .swp from vim; see #504233 for details -print STDERR One or more files are ignore due to global subversion ignore patterns,\n\tquit the process here? [y/n?]: ; -prompt: -my $ans = STDIN; -if($ans !~ /^[yn]/i) { -print STDERR The choices are:\n\tYes (y) which means aborting, or No (n) which means to NOT include those files.\n; -goto prompt; -} -if($ans =~ /^y$/i) { -exwerror(Aborting.\n); -} +} elsif($tmp{$_} == 11) { +if $ignorewarn == 0 { + print STDERR EOLWARN +Note: One or more files are being ignored due to global subversion +ignore patterns! You should consider changing your svn config. +svn-buildpackage tries to add those files now, though. +EOLWARN + } +$ignorewarn = 1; +$ctx-add($_, 1); } } chdir $curdir; signature.asc Description: Digital signature
Bug#504233: Fwd: r11871 - in /deb-maint/svn-buildpackage/trunk: SDCommon.pm debian/changelog
*argh* typo and missing ; new patch attached. Hauke signature.asc Description: Digital signature
Bug#504233: Fwd: r11871 - in /deb-maint/svn-buildpackage/trunk: SDCommon.pm debian/changelog
Hi Eddy, On Fri, Nov 28, 2008 at 06:49:46PM +0200, Eddy Petrișor wrote: OTOH, if failing can be avoided (svn add --no-ignore everything except .svn dirs), I think that is preferable. So, since using svn add --no-ignore would yeld the same results for interactive for as for noninteractive builds and avoids creating a prompt, I think that we should investigate into that option. Okay, I figured out something different, patch is attached. It's now simply printing a note about files being ignored and tries to add them via the SVN::Client connection. What would you say? Off topic: Why is that line return 1 if ($SDCommon::opt_ignoreerrors); in sub withechoNoPrompt? As far as I can see (and debug) that means that no command is executed when noninteractive and ignoreerrors are set. It just returns 1. That pretty much looks like a bug, doesn't it? (I'm becoming more cautious) No, it makes noninteractive builds not fail on errors which otherwise would have stopped the build when --svn-ignoreerrors is passed. I see the idea but I don't see the command being executed in that case. See the lines around it: , | print STDERR $cmd\n if(!$SDCommon::opt_quiet); | return 1 if ($SDCommon::opt_ignoreerrors); | return (!system(@_)); ` the actual system call wouldn't be executed with ignoreerrors set, or am I missing something here? Hauke PS: Sorry for not commiting the other thing; I was not at home this weekend. Thanks for doing that! Index: SDCommon.pm === --- SDCommon.pm (revision 11906) +++ SDCommon.pm (working copy) @@ -575,20 +575,19 @@ %tmp=(); $statusref=\%tmp; $ctx-status(, BASE, \collect_name, 1, 1, 0, 1); +my $ignorewarn = 0; for(keys %tmp) { if($tmp{$_} == 2) { $ctx-add($_, 1); -} elsif($tmp{$_} == 11) { # subversion ignores some files, like .swp from vim; see #504233 for details -print STDERR One or more files are ignore due to global subversion ignore patterns,\n\tquit the process here? [y/n?]: ; -prompt: -my $ans = STDIN; -if($ans !~ /^[yn]/i) { -print STDERR The choices are:\n\tYes (y) which means aborting, or No (n) which means to NOT include those files.\n; -goto prompt; -} -if($ans =~ /^y$/i) { -exwerror(Aborting.\n); -} +} elsif($tmp{$_} == 11) { +print STDERR EOLWARN +Note: One or more files are being ignored due to global subversion +ignore patterns! You should consider changing you svn config. +svn-buildpackage tries to add those files now, though. +EOLWARN +unless $ignorewarn 0 +$ignorewarn = 1; +$ctx-add($_, 1); } } chdir $curdir; signature.asc Description: Digital signature
Bug#504233: Fwd: r11871 - in /deb-maint/svn-buildpackage/trunk: SDCommon.pm debian/changelog
2008/11/25 Jan Hauke Rahm [EMAIL PROTECTED]: On Tue, Nov 25, 2008 at 03:38:52PM +0200, Eddy Petrișor wrote: This is not OK, since it breaks noninteractive builders. It should use some form of withEcho or something simillar in order to take into account the noninteractive option. True, my stupid mistake. Unfortunately withecho doesn't fit here. I'll have another look at it to figure something out. As I said before, I think you should add a prompt function that chooses the default option for non-interactive builds and chooses to ignore any errors if --svn-ignore is present. Which reminds me, --svn-ignore is used to choose the ignore errors option in a withEcho prompt, when --svn-noninteractive is used/set. By default, the default option (I think is always Quit) is chosen in noninteractive builds. This should be a warning, not a fatal error, thus... Well, I think user should have the chance to abort the process here (to not upgrade with source that's missing files), so a question seems reasonable for; don't you think? Yes, but there should be support for non-interactive builds, too. OTOH, if failing can be avoided (svn add --no-ignore everything except .svn dirs), I think that is preferable. So, since using svn add --no-ignore would yeld the same results for interactive for as for noninteractive builds and avoids creating a prompt, I think that we should investigate into that option. I don't know, I am confused now about the best course of action... :-/ the default should be to go on with the ignored pattern, not to quit. Actually there is no default at all. At the moment you have to press y/Y or n/N, otherwise it will retry. The question is (as above) if asking the user is more appropriate than just warning him/her. Not having a default is a bug, as I said, since it breaks noninteractive builds. Another solution would be to simply use svn add --no-igore with all the files found in the filesystem. Hmm... I have to reread the code again... Why is that SVN::Client stuff in there and not just your suggested svn add? I can't see any advantage at the moment. Reuses the connection to the server and should be what we use from now on ( =0.7 ) in svn-bp. If that doesn't cut it, there is another perl module, I think is called SVN::Ra, which should be used instead. Off topic: Why is that line return 1 if ($SDCommon::opt_ignoreerrors); in sub withechoNoPrompt? As far as I can see (and debug) that means that no command is executed when noninteractive and ignoreerrors are set. It just returns 1. That pretty much looks like a bug, doesn't it? (I'm becoming more cautious) No, it makes noninteractive builds not fail on errors which otherwise would have stopped the build when --svn-ignoreerrors is passed. There are several cases when such a behaviour is preferred. -- Regards, EddyP = Imagination is more important than knowledge A.Einstein
Bug#504233: Fwd: r11871 - in /deb-maint/svn-buildpackage/trunk: SDCommon.pm debian/changelog
Jan Hauke Rahm a scris: On Tue, Nov 25, 2008 at 03:38:52PM +0200, Eddy Petrișor wrote: This is not OK, since it breaks noninteractive builders. It should use some form of withEcho or something simillar in order to take into account the noninteractive option. True, my stupid mistake. Unfortunately withecho doesn't fit here. I'll have another look at it to figure something out. That's why I said or something simillar ;-) . Maybe is time to add a prompt that takes into account the value of This should be a warning, not a fatal error, thus... Well, I think user should have the chance to abort the process here (to not upgrade with source that's missing files), so a question seems reasonable for; don't you think? +prompt: +my $ans = STDIN; +if($ans !~ /^[yn]/i) { +print STDERR The choices are:\n\tYes (y) which means aborting, or No (n) which means to NOT include those files.\n; the default should be to go on with the ignored pattern, not to quit. Actually there is no default at all. At the moment you have to press y/Y or n/N, otherwise it will retry. The question is (as above) if asking the user is more appropriate than just warning him/her. Another solution would be to simply use svn add --no-igore with all the files found in the filesystem. Hmm... I have to reread the code again... Why is that SVN::Client stuff in there and not just your suggested svn add? I can't see any advantage at the moment. Off topic: Why is that line return 1 if ($SDCommon::opt_ignoreerrors); in sub withechoNoPrompt? As far as I can see (and debug) that means that no command is executed when noninteractive and ignoreerrors are set. It just returns 1. That pretty much looks like a bug, doesn't it? (I'm becoming more cautious) Hauke -- Regards, EddyP = Imagination is more important than knowledge A.Einstein signature.asc Description: OpenPGP digital signature
Bug#504233: Fwd: r11871 - in /deb-maint/svn-buildpackage/trunk: SDCommon.pm debian/changelog
Oops, I sent the message to the wrong bug, initially. -- Forwarded message -- From: Eddy Petrișor [EMAIL PROTECTED] Date: 2008/11/25 Subject: Re: r11871 - in /deb-maint/svn-buildpackage/trunk: SDCommon.pm debian/changelog To: Jan Hauke Rahm [EMAIL PROTECTED], [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] 2008/11/25 [EMAIL PROTECTED]: Author: jhr-guest Date: Tue Nov 25 08:26:26 2008 New Revision: 11871 URL: http://svn.debian.org/wsvn/collab-maint/?sc=1rev=11871 Log: svn-buildpackage: SDCommon.pm: Trigger a warning when files are ignored by subversion (Closes: #504233) Modified: deb-maint/svn-buildpackage/trunk/SDCommon.pm deb-maint/svn-buildpackage/trunk/debian/changelog Modified: deb-maint/svn-buildpackage/trunk/SDCommon.pm URL: http://svn.debian.org/wsvn/collab-maint/deb-maint/svn-buildpackage/trunk/SDCommon.pm?rev=11871op=diff == --- deb-maint/svn-buildpackage/trunk/SDCommon.pm (original) +++ deb-maint/svn-buildpackage/trunk/SDCommon.pm Tue Nov 25 08:26:26 2008 @@ -578,8 +578,19 @@ for(keys %tmp) { if($tmp{$_} == 2) { $ctx-add($_, 1); +} elsif($tmp{$_} == 11) { # subversion ignores some files, like .swp from vim; see #504233 for details +print STDERR One or more files are ignore due to global subversion ignore patterns,\n\tquit the process here? [y/n?]: ; This is not OK, since it breaks noninteractive builders. It should use some form of withEcho or something simillar in order to take into account the noninteractive option. This should be a warning, not a fatal error, thus... +prompt: +my $ans = STDIN; +if($ans !~ /^[yn]/i) { +print STDERR The choices are:\n\tYes (y) which means aborting, or No (n) which means to NOT include those files.\n; the default should be to go on with the ignored pattern, not to quit. +goto prompt; +} +if($ans =~ /^y$/i) { +exwerror(Aborting.\n); +} } - } +} chdir $curdir; } Another solution would be to simply use svn add --no-igore with all the files found in the filesystem. -- Regards, EddyP = Imagination is more important than knowledge A.Einstein -- Regards, EddyP = Imagination is more important than knowledge A.Einstein
Bug#504233: Fwd: r11871 - in /deb-maint/svn-buildpackage/trunk: SDCommon.pm debian/changelog
On Tue, Nov 25, 2008 at 03:38:52PM +0200, Eddy Petrișor wrote: This is not OK, since it breaks noninteractive builders. It should use some form of withEcho or something simillar in order to take into account the noninteractive option. True, my stupid mistake. Unfortunately withecho doesn't fit here. I'll have another look at it to figure something out. This should be a warning, not a fatal error, thus... Well, I think user should have the chance to abort the process here (to not upgrade with source that's missing files), so a question seems reasonable for; don't you think? +prompt: +my $ans = STDIN; +if($ans !~ /^[yn]/i) { +print STDERR The choices are:\n\tYes (y) which means aborting, or No (n) which means to NOT include those files.\n; the default should be to go on with the ignored pattern, not to quit. Actually there is no default at all. At the moment you have to press y/Y or n/N, otherwise it will retry. The question is (as above) if asking the user is more appropriate than just warning him/her. Another solution would be to simply use svn add --no-igore with all the files found in the filesystem. Hmm... I have to reread the code again... Why is that SVN::Client stuff in there and not just your suggested svn add? I can't see any advantage at the moment. Off topic: Why is that line return 1 if ($SDCommon::opt_ignoreerrors); in sub withechoNoPrompt? As far as I can see (and debug) that means that no command is executed when noninteractive and ignoreerrors are set. It just returns 1. That pretty much looks like a bug, doesn't it? (I'm becoming more cautious) Hauke signature.asc Description: Digital signature