Bug 1150113 - Review Request: perl-Cwd-Guard - Temporarily change the current directory
Summary: Review Request: perl-Cwd-Guard - Temporarily change the current directory
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Petr Šabata
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1150121
TreeView+ depends on / blocked
 
Reported: 2014-10-07 13:06 UTC by Paul Howarth
Modified: 2014-10-22 18:49 UTC (History)
2 users (show)

Fixed In Version: perl-Cwd-Guard-0.04-2.fc21
Clone Of:
Environment:
Last Closed: 2014-10-14 04:33:38 UTC
Type: ---
Embargoed:
psabata: fedora-review+
gwync: fedora-cvs+


Attachments (Terms of Use)

Description Paul Howarth 2014-10-07 13:06:42 UTC
Spec URL: http://subversion.city-fan.org/repos/cfo-repo/perl-Cwd-Guard/branches/fedora/perl-Cwd-Guard.spec
SRPM URL: http://www.city-fan.org/~paul/extras/perl-Cwd-Guard/perl-Cwd-Guard-0.04-2.fc22.src.rpm

Description:
Cwd::Guard can change the current directory (chdir) using a limited scope.

  use Cwd::Guard qw/cwd_guard/;
  use Cwd;
 
  my $dir = getcwd;
  MYBLOCK: {
    my $guard = cwd_guard('/tmp/xxxxx') or die
      "failed chdir: $Cwd::Guard::Error";
    # chdir to /tmp/xxxxx
  }
  # back to $dir

Fedora Account System Username: pghmcfc

Comment 1 Petr Šabata 2014-10-07 13:56:16 UTC
Hmm, the perl comments in your description won't show, as they also happen to be SPEC comments.  Is there a way to escape them?

Comment 2 Paul Howarth 2014-10-07 14:17:41 UTC
I've tried a few things, including macros, but nothing seems to work.

Could possibly use a sort of pseudo-code instead, e.g.:

  use Cwd::Guard qw/cwd_guard/;
  use Cwd;
 
  my $dir = getcwd;
  MYBLOCK: {
    my $guard = cwd_guard('/tmp/xxxxx') or die
      "failed chdir: $Cwd::Guard::Error";
    <<< directory is now /tmp/xxxxx >>>
  }
  <<< directory is now back to $dir >>>

Comment 3 Petr Šabata 2014-10-07 14:29:05 UTC
They're visible if there's something else than whitespace before them, so the following would also work:

  use Cwd::Guard qw/cwd_guard/;
  use Cwd;
 
  my $dir = getcwd;
  MYBLOCK: {
    my $guard = cwd_guard('/tmp/xxxxx') or die
      "failed chdir: $Cwd::Guard::Error"; # chdir to /tmp/xxxxx
  } # back to $dir


Up to you :)
There were no other issues, so I'll approve this now.

Comment 4 Paul Howarth 2014-10-07 14:38:58 UTC
New Package SCM Request
=======================
Package Name: perl-Cwd-Guard
Short Description: Temporarily change the current directory
Upstream URL: http://search.cpan.org/dist/Cwd-Guard/
Owners: pghmcfc
Branches: f19 f20 f21 epel7
InitialCC: perl-sig

Thanks for the review Petr. I'll go for yada yada yada operators:

  use Cwd::Guard qw/cwd_guard/;
  use Cwd;
 
  my $dir = getcwd;
  MYBLOCK: {
    my $guard = cwd_guard('/tmp/xxxxx') or die
      "failed chdir: $Cwd::Guard::Error";
    ... # chdir to /tmp/xxxxx
  }
  ... # back to $dir

Comment 5 Gwyn Ciesla 2014-10-07 17:09:46 UTC
Git done (by process-git-requests).

Comment 6 Fedora Update System 2014-10-07 18:24:17 UTC
perl-Software-License-CCpack-1.01-3.el7 has been submitted as an update for Fedora EPEL 7.
https://admin.fedoraproject.org/updates/perl-Software-License-CCpack-1.01-3.el7

Comment 7 Fedora Update System 2014-10-07 18:24:25 UTC
perl-Software-License-CCpack-1.01-3.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/perl-Software-License-CCpack-1.01-3.fc20

Comment 8 Fedora Update System 2014-10-07 18:24:30 UTC
perl-Software-License-CCpack-1.01-3.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/perl-Software-License-CCpack-1.01-3.fc21

Comment 9 Fedora Update System 2014-10-07 19:44:25 UTC
perl-Cwd-Guard-0.04-2.el7 has been submitted as an update for Fedora EPEL 7.
https://admin.fedoraproject.org/updates/perl-Cwd-Guard-0.04-2.el7

Comment 10 Fedora Update System 2014-10-07 19:44:32 UTC
perl-Cwd-Guard-0.04-2.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/perl-Cwd-Guard-0.04-2.fc19

Comment 11 Fedora Update System 2014-10-07 19:44:37 UTC
perl-Cwd-Guard-0.04-2.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/perl-Cwd-Guard-0.04-2.fc20

Comment 12 Fedora Update System 2014-10-07 19:44:44 UTC
perl-Cwd-Guard-0.04-2.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/perl-Cwd-Guard-0.04-2.fc21

Comment 13 Fedora Update System 2014-10-08 19:01:24 UTC
perl-Cwd-Guard-0.04-2.fc21 has been pushed to the Fedora 21 testing repository.

Comment 14 Fedora Update System 2014-10-14 04:33:38 UTC
perl-Software-License-CCpack-1.01-3.fc21 has been pushed to the Fedora 21 stable repository.

Comment 15 Fedora Update System 2014-10-14 04:45:47 UTC
perl-Cwd-Guard-0.04-2.fc21 has been pushed to the Fedora 21 stable repository.

Comment 16 Fedora Update System 2014-10-17 08:37:45 UTC
perl-Cwd-Guard-0.04-2.fc20 has been pushed to the Fedora 20 stable repository.

Comment 17 Fedora Update System 2014-10-17 08:40:17 UTC
perl-Software-License-CCpack-1.01-3.fc20 has been pushed to the Fedora 20 stable repository.

Comment 18 Fedora Update System 2014-10-17 08:41:11 UTC
perl-Cwd-Guard-0.04-2.fc19 has been pushed to the Fedora 19 stable repository.

Comment 19 Fedora Update System 2014-10-22 18:45:39 UTC
perl-Cwd-Guard-0.04-2.el7 has been pushed to the Fedora EPEL 7 stable repository.

Comment 20 Fedora Update System 2014-10-22 18:49:33 UTC
perl-Software-License-CCpack-1.01-3.el7 has been pushed to the Fedora EPEL 7 stable repository.


Note You need to log in before you can comment on or make changes to this bug.