Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-20317

CVS: Prune empty directories fails when a CVS module is a single file

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: cvs-plugin
    • Labels:
      None
    • Environment:
      Jenkins ver. 1.537
      Windows 2008 Server
      Java 1.7.0_06-b24 (64bit)
      CVS Plugin 2.10
    • Similar Issues:

      Description

      When 'Prune Empty Directories' is checked in Project, and Project checks out
      a CVS-module that is a single file, the CVS Tasks fails with this stacktrace:
      10:16:23 cvs update -C -d -P -r HEAD -D 29 Oct 2013 10:16:15 +0100 Project.sln
      10:16:24 ERROR: CVS empty directory cleanup failed: could not examine d:\jenkins_home\jobs\Project\workspace\Project\Project.sln
      10:16:24 java.io.IOException: could not examine d:\jenkins_home\jobs\Project\workspace\Project\Project.sln
      10:16:24 at hudson.scm.AbstractCvs.pruneEmptyDirectories(AbstractCvs.java:311)
      10:16:24 at hudson.scm.AbstractCvs.access$000(AbstractCvs.java:80)
      10:16:24 at hudson.scm.AbstractCvs$1.invoke(AbstractCvs.java:270)
      10:16:24 at hudson.scm.AbstractCvs$1.invoke(AbstractCvs.java:245)
      10:16:24 at hudson.FilePath.act(FilePath.java:912)
      10:16:24 at hudson.FilePath.act(FilePath.java:885)
      10:16:24 at hudson.scm.AbstractCvs.perform(AbstractCvs.java:245)
      10:16:24 at hudson.scm.AbstractCvs.checkout(AbstractCvs.java:162)
      10:16:24 at hudson.scm.CVSSCM.checkout(CVSSCM.java:346)
      10:16:24 at hudson.model.AbstractProject.checkout(AbstractProject.java:1411)
      10:16:24 at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:652)
      10:16:24 at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
      10:16:24 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:557)
      10:16:24 at hudson.model.Run.execute(Run.java:1665)
      10:16:24 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      10:16:24 at hudson.model.ResourceController.execute(ResourceController.java:88)
      10:16:24 at hudson.model.Executor.run(Executor.java:230)
      10:16:24 ERROR: Cvs task failed

        Attachments

          Activity

          Hide
          valeni Valentin Batz added a comment -

          Project/Project.sln was checked out as a single file.
          I think the problem is in the 'prune empty directory' implementation. It's assuming that a cvs module is a directory on disk.

          Show
          valeni Valentin Batz added a comment - Project/Project.sln was checked out as a single file. I think the problem is in the 'prune empty directory' implementation. It's assuming that a cvs module is a directory on disk.
          Hide
          valeni Valentin Batz added a comment - - edited

          I've tried out the binary build https://jenkins.ci.cloudbees.com/job/plugins/job/cvs-plugin/org.jenkins-ci.plugins$cvs/209/artifact/org.jenkins-ci.plugins/cvs/2.12-SNAPSHOT/cvs-2.12-SNAPSHOT.hpi from the pull request https://github.com/jenkinsci/cvs-plugin/pull/27
          and it seem to fix the issue, but I don't know if it breaks anything. I think the
          check for a directory can be done before calling pruneEmptyDirectories() as well.

          Edit: grammar

          Show
          valeni Valentin Batz added a comment - - edited I've tried out the binary build https://jenkins.ci.cloudbees.com/job/plugins/job/cvs-plugin/org.jenkins-ci.plugins$cvs/209/artifact/org.jenkins-ci.plugins/cvs/2.12-SNAPSHOT/cvs-2.12-SNAPSHOT.hpi from the pull request https://github.com/jenkinsci/cvs-plugin/pull/27 and it seem to fix the issue, but I don't know if it breaks anything. I think the check for a directory can be done before calling pruneEmptyDirectories() as well. Edit: grammar
          Hide
          valeni Valentin Batz added a comment - - edited

          The check for directory is done before calling pruneEmptyDirectories now, so pruneEmptyDirectories() is kept unchanged.
          Tried out the new build https://jenkins.ci.cloudbees.com/job/plugins/job/cvs-plugin/org.jenkins-ci.plugins$cvs/210/artifact/org.jenkins-ci.plugins/cvs/2.12-SNAPSHOT/cvs-2.12-SNAPSHOT.hpi
          And it works for me as well.

          Show
          valeni Valentin Batz added a comment - - edited The check for directory is done before calling pruneEmptyDirectories now, so pruneEmptyDirectories() is kept unchanged. Tried out the new build https://jenkins.ci.cloudbees.com/job/plugins/job/cvs-plugin/org.jenkins-ci.plugins$cvs/210/artifact/org.jenkins-ci.plugins/cvs/2.12-SNAPSHOT/cvs-2.12-SNAPSHOT.hpi And it works for me as well.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Michael Clarke
          Path:
          src/main/java/hudson/scm/AbstractCvs.java
          http://jenkins-ci.org/commit/cvs-plugin/eb2a491ba66cb3177e47bbaba2a65ee4d2637b44
          Log:
          Merge pull request #27 from hrzlgnm/master

          [FIXED JENKINS-20317] Don't prune module if it's not a directory

          Compare: https://github.com/jenkinsci/cvs-plugin/compare/683b9eeb995e...eb2a491ba66c

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Michael Clarke Path: src/main/java/hudson/scm/AbstractCvs.java http://jenkins-ci.org/commit/cvs-plugin/eb2a491ba66cb3177e47bbaba2a65ee4d2637b44 Log: Merge pull request #27 from hrzlgnm/master [FIXED JENKINS-20317] Don't prune module if it's not a directory Compare: https://github.com/jenkinsci/cvs-plugin/compare/683b9eeb995e...eb2a491ba66c

            People

            • Assignee:
              mc1arke Michael Clarke
              Reporter:
              valeni Valentin Batz
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: