diff options
author | Olivier Thauvin <nanardon@mandriva.org> | 2004-01-16 02:48:55 +0000 |
---|---|---|
committer | Olivier Thauvin <nanardon@mandriva.org> | 2004-01-16 02:48:55 +0000 |
commit | 40425966ded63288d46d82030a4c72ba829114bb (patch) | |
tree | f143db8ec019fe16c422053e551d77807d1d4f1d | |
parent | 54920197e4407da73174b3100988d1167dff33ff (diff) | |
download | urpmi-40425966ded63288d46d82030a4c72ba829114bb.tar urpmi-40425966ded63288d46d82030a4c72ba829114bb.tar.gz urpmi-40425966ded63288d46d82030a4c72ba829114bb.tar.bz2 urpmi-40425966ded63288d46d82030a4c72ba829114bb.tar.xz urpmi-40425966ded63288d46d82030a4c72ba829114bb.zip |
- re use strict, because nobody is better than perl
- use sub folder bug report when restart is need
- add cvs $Id$ in script
-rw-r--r-- | urpm.pm | 2 | ||||
-rw-r--r-- | urpme | 6 | ||||
-rwxr-xr-x | urpmf | 3 | ||||
-rwxr-xr-x | urpmi | 28 | ||||
-rwxr-xr-x | urpmi.addmedia | 3 | ||||
-rwxr-xr-x | urpmi.removemedia | 3 | ||||
-rwxr-xr-x | urpmq | 2 |
7 files changed, 34 insertions, 13 deletions
@@ -1,5 +1,7 @@ package urpm; +# $Id$ + use strict; use vars qw($VERSION @ISA @EXPORT); use MDK::Common; @@ -1,5 +1,7 @@ #!/usr/bin/perl +# $Id$ + # Copyright (C) 1999,2002 MandrakeSoft <pixel@linux-mandrake.com> # <fpons@mandrakesoft.com> # @@ -18,14 +20,14 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #We only make good software ;-) -#use strict; +use strict; #use strict qw(subs vars refs); use URPM; use URPM::Resolve; use urpm; -my (@nextargv, $root, $test, $parallel, $auto, $matches, $verbose, $maymatch, $usedistrib, @l); +my (@nextargv, $root, $test, $parallel, $auto, $matches, $verbose, $maymatch, $usedistrib, $force, $bug, @l); my $askok = N("Is this OK?"); # Translator: Add here the keys which might be pressed in the "No"-case. my $noexpr = N("Nn"); @@ -1,5 +1,7 @@ #!/usr/bin/perl +# $Id$ + #- Copyright (C) 2002 MandrakeSoft (fpons@mandrakesoft.com) #- #- This program is free software; you can redistribute it and/or modify @@ -17,6 +19,7 @@ #- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #use strict qw(subs vars refs); +use strict; use urpm; sub usage { @@ -1,5 +1,7 @@ #!/usr/bin/perl +# $Id$ + #- Copyright (C) 1999,2001 MandrakeSoft (pixel@linux-mandrake.com) #- #- This program is free software; you can redistribute it and/or modify @@ -17,6 +19,7 @@ #- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #use strict qw(subs vars refs); +use strict; use urpm; #- contains informations to parse installed system. @@ -451,8 +454,8 @@ if (@ask_unselect) { gmessage("$msg\n".N("do you agree ?")); $? and exit 0; } else { - $noexpr = N("Nn"); - $yesexpr = N("Yy"); + my $noexpr = N("Nn"); + my $yesexpr = N("Yy"); message_input($msg . N(" (Y/n) "), $force && $yesexpr, boolean => 1) =~ /[$noexpr]/ and exit 0; } } @@ -477,8 +480,8 @@ have to be removed for others to be upgraded:\n%s\n", $list); gmessage("$msg\n".N("do you agree ?")); $? and exit 0; } else { - $noexpr = N("Nn"); - $yesexpr = N("Yy"); + my $noexpr = N("Nn"); + my $yesexpr = N("Yy"); message_input($msg . N(" (y/N) "), $force && $yesexpr, boolean => 1) =~ /[$yesexpr]/ or exit 0; } } @@ -523,8 +526,8 @@ if (@root_only) { gmessage("$msg:\n$p\n\n$msg2"); $? and exit 0; } else { - $noexpr = N("Nn"); - $yesexpr = N("Yy"); + my $noexpr = N("Nn"); + my $yesexpr = N("Yy"); message_input("$msg:\n$p\n$msg2" . N(" (Y/n) "), $force && $yesexpr, boolean => 1) =~ /[$noexpr]/ and exit 0; } } @@ -632,8 +635,8 @@ foreach my $set (@{$state->{transaction} || []}) { gmessage("$msg:\n$p\n\n$msg2"); $? and exit 1; } else { - $noexpr = N("Nn"); - $yesexpr = N("Yy"); + my $noexpr = N("Nn"); + my $yesexpr = N("Yy"); message_input("$msg:\n$p\n$msg2" . N(" (y/N) "), $force && $yesexpr, boolean => 1) =~ /[$yesexpr]/ or exit 1; } } @@ -710,8 +713,8 @@ foreach my $set (@{$state->{transaction} || []}) { ++$nok; push @errors, @l; } else { - $noexpr = N("Nn"); - $yesexpr = N("Yy"); + my $noexpr = N("Nn"); + my $yesexpr = N("Yy"); message_input(N("Try installation without checking dependencies? (y/N) "), $force && $yesexpr, boolean => 1) =~ /[$yesexpr]/ or ++$nok, next; $urpm->{log}("starting installing packages without deps"); @@ -798,7 +801,10 @@ if ($restart_itself && !$exit_code) { #- it seems to work correctly with exec instead of system, provided #- STDOUT or STDERR are not closed before (else no output at all). #- added --no-priority-upgrade to make sure no restart will be done after this one. - exec "/usr/sbin/urpmi", '--no-priority-upgrade', @ARGV; + #- renamed bug report dir as /restarted to avoid exit because it alllreday exists + #- This permit to have in same dir bug report before and after the restart + my @arg = ($ARGV[0], map { $ARGV[$_] . ($ARGV[$_ - 1] =~ /^--bug$/ ? "/restarted" : "") } (1 .. $#ARGV)); + exec "$0", '--no-priority-upgrade', @arg; } #- this help flushing correctly by closing this file before (piped on tee). diff --git a/urpmi.addmedia b/urpmi.addmedia index 54329bc1..3eb0dc7c 100755 --- a/urpmi.addmedia +++ b/urpmi.addmedia @@ -1,5 +1,7 @@ #!/usr/bin/perl +# $Id$ + #- Copyright (C) 2000 MandrakeSoft (fpons@mandrakesoft.com) #- #- This program is free software; you can redistribute it and/or modify @@ -19,6 +21,7 @@ #- this program is based upon old urpmi.addmedia #use strict qw(subs vars refs); +use strict; use urpm; sub main { diff --git a/urpmi.removemedia b/urpmi.removemedia index 9783879c..38b6b8fe 100755 --- a/urpmi.removemedia +++ b/urpmi.removemedia @@ -1,5 +1,7 @@ #!/usr/bin/perl +# $Id$ + #- Copyright (C) 2000 MandrakeSoft (fpons@mandrakesoft.com) #- #- This program is free software; you can redistribute it and/or modify @@ -19,6 +21,7 @@ #- this program is based upon old urpmi.addmedia #use strict qw(subs vars refs); +use strict; use urpm; sub main { @@ -1,5 +1,7 @@ #!/usr/bin/perl +# $Id$ + #- Copyright (C) 2000 MandrakeSoft (fpons@mandrakesoft.com) #- #- This program is free software; you can redistribute it and/or modify |