summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2003-06-04 15:11:37 +0000
committerFrancois Pons <fpons@mandriva.com>2003-06-04 15:11:37 +0000
commitff2188c17c74cefee201a2e2e32bad0fc267c4b2 (patch)
treecbdd0329ce43fdb0b6c92925b04c5f1069439262 /tools
parentc7ef06f50287c09d56db57657e976043a8e771dc (diff)
downloaddrakx-ff2188c17c74cefee201a2e2e32bad0fc267c4b2.tar
drakx-ff2188c17c74cefee201a2e2e32bad0fc267c4b2.tar.gz
drakx-ff2188c17c74cefee201a2e2e32bad0fc267c4b2.tar.bz2
drakx-ff2188c17c74cefee201a2e2e32bad0fc267c4b2.tar.xz
drakx-ff2188c17c74cefee201a2e2e32bad0fc267c4b2.zip
avoid updating kernel-BOOT (as kernel-BOOT of cooker is pure shit).
Diffstat (limited to 'tools')
-rwxr-xr-xtools/syncrpms34
1 files changed, 20 insertions, 14 deletions
diff --git a/tools/syncrpms b/tools/syncrpms
index df3ddfaed..9537d72d0 100755
--- a/tools/syncrpms
+++ b/tools/syncrpms
@@ -23,6 +23,9 @@ use strict qw(subs vars refs);
#- compare a version string.
use URPM;
+#- keep some packages...
+my $keep = 'kernel-BOOT';
+
#- get basename for a file.
sub basename { $_[0] =~ /([^\/]*)$/ ? $1 : $_[0]; }
@@ -149,21 +152,23 @@ sub sync_medium {
sub sync_rpms {
my ($source, $target, $flag) = @_;
- #- search in source part.
- foreach (keys %$source) {
- unless ($target->{$_}) {
+ #- search in target part.
+ foreach (keys %$target) {
+ /$keep/ and next;
+ unless ($source->{$_}) {
if ($flag->{verbose}) {
- print "adding $source->{$_}{file}" . (-d $flag->{add} ? " to $flag->{add}\n" : " is neccessary!\n");
+ print "removing $target->{$_}{file}" . ($flag->{remove} ? " from $target->{$_}{dir}\n" : " is neccessary!\n");
+ my $k = $_;
}
- if (-d $flag->{add}) {
- cp("$source->{$_}{dir}/$source->{$_}{file}", $flag->{add});
- chmod 0644, "$flag->{add}/$source->{$_}{file}";
+ if ($flag->{remove}) {
+ rm("$target->{$_}{dir}/$target->{$_}{file}");
}
}
}
#- search in both part.
foreach (keys %$source) {
+ /$keep/ and next;
if ($target->{$_}) {
if (URPM::ranges_overlap("== $source->{$_}{version}-$source->{$_}{release}",
">= $target->{$_}{version}-$target->{$_}{release}")) {
@@ -189,15 +194,16 @@ sub sync_rpms {
}
}
- #- search in target part.
- foreach (keys %$target) {
- unless ($source->{$_}) {
+ #- search in source part.
+ foreach (keys %$source) {
+ /$keep/ and next;
+ unless ($target->{$_}) {
if ($flag->{verbose}) {
- print "removing $target->{$_}{file}" . ($flag->{remove} ? " from $target->{$_}{dir}\n" : " is neccessary!\n");
- my $k = $_;
+ print "adding $source->{$_}{file}" . (-d $flag->{add} ? " to $flag->{add}\n" : " is neccessary!\n");
}
- if ($flag->{remove}) {
- rm("$target->{$_}{dir}/$target->{$_}{file}");
+ if (-d $flag->{add}) {
+ cp("$source->{$_}{dir}/$source->{$_}{file}", $flag->{add});
+ chmod 0644, "$flag->{add}/$source->{$_}{file}";
}
}
}