ALT Linux Bugzilla
– Attachment 4657 Details for
Bug 17058
File::Temp regression
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
restore cwd at the end of script
srpmcmp-0.2-cwd.patch (text/plain), 1.74 KB, created by
Vladimir Lettiev
on 2010-11-14 12:36:32 MSK
(
hide
)
Description:
restore cwd at the end of script
Filename:
MIME Type:
Creator:
Vladimir Lettiev
Created:
2010-11-14 12:36:32 MSK
Size:
1.74 KB
patch
obsolete
>--- a/srpmcmp 2004-09-29 18:11:44.000000000 +0400 >+++ b/srpmcmp 2010-11-14 12:27:37.000000000 +0300 >@@ -78,6 +78,8 @@ > use Getopt::Long qw(GetOptions); > GetOptions verbose => \my $opt_verbose, > deep => \my $opt_deep, autocrap => \my $opt_autocrap, rcs => \my $opt_rcs; >+use Cwd qw(getcwd realpath); >+my $cwd = getcwd(); > > sub verbose { > print STDERR "@_\n" if $opt_verbose; >@@ -91,7 +93,10 @@ > my $dir = tempdir("srpmcmp.XXXXXXXXXX", TMPDIR => 1, CLEANUP => 1); > chdir $dir; > my $rv = system qq(rpm2cpio '$rpm' | cpio -idmu --quiet --no-absolute-filenames); >- die "$0: `rpm2cpio $rpm' failed\n" if $rv; >+ if ($rv) { >+ chdir $cwd; >+ die "$0: `rpm2cpio $rpm' failed\n"; >+ } > return $dir; > } > >@@ -101,15 +106,24 @@ > > if (my @gz = (<*.gz>, <*.tgz>)) { > my $rv = system qw(gzip -d) => @gz; >- die "$0: `gzip -d @gz' failed\n" if $rv; >+ if ($rv) { >+ chdir $cwd; >+ die "$0: `gzip -d @gz' failed\n" >+ } > } > if (my @bz2 = <*.bz2>) { > my $rv = system qw(bzip2 -df) => @bz2; >- die "$0: `bzip2 -df @bz2' failed\n" if $rv; >+ if ($rv) { >+ chdir $cwd; >+ die "$0: `bzip2 -df @bz2' failed\n"; >+ } > } > foreach (<*.tar>) { > my $rv = system qw(tar xf) => $_; >- die "$0: `tar xf $_' failed\n" if $rv; >+ if ($rv) { >+ chdir $cwd; >+ die "$0: `tar xf $_' failed\n"; >+ } > unlink; > } > } >@@ -261,7 +275,6 @@ > } > > sub srpmcmp ($$) { >- use Cwd qw(realpath); > my ($rpm1, $rpm2) = map { realpath($_) } @_; > > my $dir1 = tmp_unpack $rpm1; uncompress $dir1; cleanup $dir1; >@@ -296,5 +309,6 @@ > $0 [--deep] [--autocrap] [--rcs] package1.src.rpm package2.src.rpm > See srpmcmp(1) for details. > EOF >-print srpmcmp $ARGV[0], $ARGV[1]; > >+print srpmcmp $ARGV[0], $ARGV[1]; >+chdir $cwd;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 17058
: 4657