Your message dated Wed, 16 Aug 2023 14:21:56 +0200
with message-id <[email protected]>
and subject line Re: Bug#168095: cvsu does not work like 'cvs update' for 
individual files.
has caused the Debian Bug report #168095,
regarding cvsu does not work like 'cvs update' for individual files.
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
168095: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=168095
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: cvsutils
Version: 0.0.20020311-1

The cvsu perl script works like 'cvs update' for directories, 
but yields the following error message when run against the 
individual file 'file.xxx':

$> cvsu file.xxx
cvsu: ERROR: file.xxx/ is not a directory


where 'cvs update' would issue messages like:

$> cvs update file.xxx # if file.xxx has been modified
M file.xxx
$> cvs update file.xxx # if file.xxx is missing
U file.xxx
$> cvs update file.xxx # if file.xxx is unchanged

The attached patch allows cvsu to work like 'cvs update' for
individual files.  The patch should apply cleanly against
either the version in Woody or the latest cvs version.

sol
--- /usr/bin/cvsu       Mon Mar 11 09:24:18 2002
+++ /tmp/cvsu   Wed Nov  6 08:56:38 2002
@@ -8,6 +8,7 @@
 
 require 5.004;
 use Getopt::Long;
+use File::Basename;
 use Time::Local;
 use strict;
 
@@ -195,23 +196,33 @@
     $curr_dir = shift (@_);
     $ignore_rx = '';
 
-    $curr_dir .= "/"
-       unless ( $curr_dir eq "" || $curr_dir =~ m{/$} );
-
-    my $real_curr_dir = $curr_dir eq "" ? "." : $curr_dir;
-
-    error ("$real_curr_dir is not a directory")
-       unless ( -d $real_curr_dir );
-
-    # Scan present files.
-    file_status (".");
     my %found_files = ();
-    opendir (DIR, $real_curr_dir) ||
+    my $single_filename = 0;
+    if ( -d $curr_dir or $curr_dir eq "" ) {
+       $curr_dir .= "/"
+           unless ( $curr_dir eq "" || $curr_dir =~ m{/$} );
+
+       my $real_curr_dir = $curr_dir eq "" ? "." : $curr_dir;
+
+       error ("$real_curr_dir is not a directory")
+           unless ( -d $real_curr_dir );
+
+       # Scan present files.
+       file_status (".");
+       opendir (DIR, $real_curr_dir) ||
        error ("couldn't open directory $real_curr_dir: $!");
-    foreach (readdir (DIR)) {
-       $found_files {$_} = 1;
+       foreach (readdir (DIR)) {
+           $found_files {$_} = 1;
+       }
+       closedir (DIR);
+    }
+    else {
+       $single_filename = basename $curr_dir;
+       $found_files{$single_filename} = 1 if -f $curr_dir;
+       $curr_dir = dirname $curr_dir;
+       $curr_dir .= "/"
+           unless ( $curr_dir eq "" || $curr_dir =~ m{/$} );
     }
-    closedir (DIR);
 
     # Scan CVS/Entries.
     my %entries = ();
@@ -221,11 +232,13 @@
        || error ("couldn't open ${curr_dir}CVS/Entries: $!");
     while (<ENTRIES>) {
        if ( m{^D/([^/]+)/} ) {
-           $subdirs{$1} = 1;
+           $subdirs{$1} = 1 if !$single_filename;
        } elsif ( m{^/([^/]+)/([^/])[^/]*/([^/]+)/} ) {
-           $entries{$1} = $3;
-           $removed{$1} = 1
-               if $2 eq '-';
+           if ( !$single_filename or $single_filename eq $1 ) {
+               $entries{$1} = $3;
+               $removed{$1} = 1
+                   if $2 eq '-';
+           }
        } else {
            error ("unrecognizable line in ${curr_dir}CVS/Entries")
                unless m{D}; # what does single "D" in CVS/Entries mean?

--- End Message ---
--- Begin Message ---
Version: 0.2.3-1

This issue has been fixed upstream in version 0.2.3 by integrating a modified version of the submitted patch. Thanks.
--- End Message ---

Reply via email to