- add repotype/runscripts options
authorMichael Schröder <mls@suse.de>
Thu, 18 Jan 2007 03:57:58 +0000 (03:57 +0000)
committerMichael Schröder <mls@suse.de>
Thu, 18 Jan 2007 03:57:58 +0000 (03:57 +0000)
- remove devs in sl10.1/10.2
- fix boolean test to make "00" false like rpm does
- add rpm_verscmp for version comparison

15 files changed:
Build.pm
configs/debian.conf
configs/sl10.0.conf
configs/sl10.1.conf
configs/sl10.2.conf
configs/sl8.1.conf
configs/sl8.2.conf
configs/sl9.0.conf
configs/sl9.1.conf
configs/sl9.2.conf
configs/sl9.3.conf
configs/sles10.conf
configs/sles8.conf
configs/sles9.conf
configs/ul1.conf

index 059ac54..00a8b00 100644 (file)
--- a/Build.pm
+++ b/Build.pm
@@ -79,6 +79,7 @@ sub read_config {
   $config->{'substitute'} = {};
   $config->{'optflags'} = {};
   $config->{'rawmacros'} = '';
+  $config->{'repotype'} = [];
   for my $l (@spec) {
     $l = $l->[1] if ref $l;
     next unless defined $l;
@@ -101,11 +102,13 @@ sub read_config {
       next unless @l;
       $ll = shift @l;
       $config->{'optflags'}->{$ll} = join(' ', @l);
+    } elsif ($l0 eq 'repotype:') {
+      $config->{'repotype'} = [ @l ];
     } elsif ($l0 !~ /^[#%]/) {
       warn("unknown keyword in config: $l0\n");
     }
   }
-  for my $l (qw{preinstall required support keep runscripts}) {
+  for my $l (qw{preinstall required support keep runscripts repotype}) {
     $config->{$l} = [ unify(@{$config->{$l}}) ];
   }
   for my $l (keys %{$config->{'substitute'}}) {
@@ -432,6 +435,8 @@ sub expr {
   } elsif ($t eq '!') {
     ($v, $expr) = expr(substr($expr, 1), 0);
     return undef unless defined $v;
+    $v = 0 if $v && $v eq '\"\"';
+    $v =~ s/^0+/0/ if $v;
     $v = !$v;
   } elsif ($t eq '-') {
     ($v, $expr) = expr(substr($expr, 1), 0);
@@ -696,6 +701,7 @@ sub read_spec {
     if ($line =~ /^\s*%if(.*)$/) {
       my ($v, $r) = expr($1);
       $v = 0 if $v && $v eq '\"\"';
+      $v =~ s/^0+/0/ if $v;
       $skip = 1 unless $v;
       $hasif = 1;
       next;
@@ -989,6 +995,69 @@ sub rpmq_add_flagsvers {
   }
 }
 
+sub rpm_verscmp_part {
+  my ($s1, $s2) = @_;
+  if (!defined($s1)) {
+    return defined($s2) ? -1 : 0;
+  }
+  return 1 if !defined $s2;
+  return 0 if $s1 eq $s2;
+  while (1) {
+    $s1 =~ s/^[^a-zA-Z0-9]+//;
+    $s2 =~ s/^[^a-zA-Z0-9]+//;
+    my ($x1, $x2, $r);
+    if ($s1 =~ /^([0-9]+)(.*?)$/) {
+      $x1 = $1;
+      $s1 = $2;
+      $s2 =~ /^([0-9]*)(.*?)$/;
+      $x2 = $1;
+      $s2 = $2;
+      return 1 if $x2 eq '';
+      $x1 =~ s/^0+//;
+      $x2 =~ s/^0+//;
+      $r = length($x1) - length($x2) || $x1 cmp $x2;
+    } elsif ($s1 ne '' && $s2 ne '') {
+      $s1 =~ /^([a-zA-Z]*)(.*?)$/;
+      $x1 = $1;
+      $s1 = $2;
+      $s2 =~ /^([a-zA-Z]*)(.*?)$/;
+      $x2 = $1;
+      $s2 = $2;
+      return -1 if $x1 eq '' || $x2 eq '';
+      $r = $x1 cmp $x2;
+    }
+    return $r if $r;
+    if ($s1 eq '') {
+      return $s2 eq '' ? 0 : -1;
+    }
+    return 1 if $s2 eq ''
+  }
+}
+
+sub rpm_verscmp {
+  my ($s1, $s2) = @_;
+
+  return 0 if $s1 eq $s2;
+  my ($e1, $v1, $r1) = $s1 =~ /^(?:(\d+):)?(.*?)(?:-([^-]*))?$/s;
+  $e1 = 0 unless defined $e1;
+  $r1 = '' unless defined $r1;
+  my ($e2, $v2, $r2) = $s2 =~ /^(?:(\d+):)?(.*?)(?:-([^-]*))?$/s;
+  $e2 = 0 unless defined $e2;
+  $r2 = '' unless defined $r2;
+  if ($e1 ne $e2) {
+    my $r = rpm_verscmp_part($e1, $e2);
+    return $r if $r;
+  }
+  if ($v1 ne $v2) {
+    my $r = rpm_verscmp_part($v1, $v2);
+    return $r if $r;
+  }
+  if ($r1 ne $r2) {
+    return rpm_verscmp_part($r1, $r2);
+  }
+  return 0;
+}
+
 ###########################################################################
 
 my $have_zlib;
index 988f9e6..ce59c2e 100644 (file)
@@ -1,8 +1,12 @@
+Repotype: debian
+
 Preinstall: bash perl-base sed grep coreutils debianutils
 Preinstall: libc6 libncurses5 libacl1 libattr1
 Preinstall: libreadline4 tar gawk dpkg
 Preinstall: sysv-rc gzip base-files
 
+Runscripts: base-files
+
 Required: autoconf automake binutils bzip2 gcc gettext libc6
 Required: libtool libncurses5 perl zlib1g dpkg
 
index 1dd4979..50f2c06 100644 (file)
@@ -1,8 +1,12 @@
+Repotype: rpm-md suse
+
 Preinstall: aaa_base acl attr bash bzip2 coreutils db devs diffutils
 Preinstall: filesystem fillup glibc grep insserv libacl libattr
 Preinstall: libgcc libnscd libselinux libxcrypt m4 ncurses pam
 Preinstall: permissions popt pwdutils readline rpm sed tar zlib
 
+Runscripts: aaa_base
+
 Required: autoconf automake binutils bzip2 db gcc gdbm gettext glibc
 Required: libtool ncurses perl rpm zlib
 
index 7bc5473..9f7e47b 100644 (file)
@@ -3,6 +3,8 @@ Preinstall: filesystem fillup glibc grep insserv libacl libattr
 Preinstall: libgcc libnscd libxcrypt m4 ncurses pam
 Preinstall: permissions popt pwdutils readline rpm sed tar zlib
 
+Runscripts: aaa_base
+
 Required: autoconf automake binutils bzip2 db gcc gdbm gettext glibc
 Required: libtool ncurses perl rpm zlib
 
@@ -181,7 +183,7 @@ Substitute: kernel-binary-packages kernel-default
 %endif
 
 Macros:
-%insserv_prereq insserv sed devs
+%insserv_prereq insserv sed
 %fillup_prereq fillup coreutils
 %suseconfig_fonts_prereq perl aaa_base
 %install_info_prereq info
index 9b0ded5..dc8fd87 100644 (file)
@@ -3,6 +3,8 @@ Preinstall: filesystem fillup glibc grep insserv libacl libattr
 Preinstall: libgcc41 libnscd libxcrypt m4 ncurses pam
 Preinstall: permissions popt pwdutils readline rpm sed tar zlib
 
+Runscripts: aaa_base
+
 Required: autoconf automake binutils bzip2 db gcc gcc41
 Required: gdbm gettext glibc libtool ncurses perl rpm zlib
 
@@ -22,10 +24,10 @@ Keep: libunwind-devel libzio make mktemp pam-devel pam-modules
 Keep: patch perl rcs timezone
 
 Prefer: xorg-x11-libs libpng fam mozilla mozilla-nss xorg-x11-Mesa
-Prefer: unixODBC libsoup glitz java-1_4_2-sun gnome-panel
+Prefer: unixODBC libsoup glitz java-1_4_2-sun java-1_4_2-sun-jdbc gnome-panel
 Prefer: desktop-data-SuSE gnome2-SuSE mono-nunit gecko-sharp2
-Prefer: apache2-prefork openmotif-libs ghostscript-mini gtk-sharp
-Prefer: glib-sharp libzypp-zmd-backend mDNSResponder
+Prefer: apache2-prefork Mesa openmotif-libs ghostscript-mini ghostscript-library gtk-sharp
+Prefer: glib-sharp libzypp-zmd-backend mDNSResponder-lib
 
 Prefer: gnome-sharp2:art-sharp2 gnome-sharp:art-sharp
 Prefer: ifolder3:gnome-sharp2 ifolder3:gconf-sharp2
@@ -34,11 +36,13 @@ Prefer: gconf-sharp2:glade-sharp2 gconf-sharp:glade-sharp
 Prefer: tomboy:gconf-sharp tomboy:gnome-sharp
 Prefer: zmd:libzypp-zmd-backend
 Prefer: yast2-packagemanager-devel:yast2-packagemanager
+Prefer: glitz-32bit:Mesa-32bit libcdio-mini faac-min
 
 Prefer: -libgcc-mainline -libstdc++-mainline -gcc-mainline-c++
 Prefer: -libgcj-mainline -viewperf -compat -compat-openssl097g
 Prefer: -zmd -OpenOffice_org -pam-laus -libgcc-tree-ssa -busybox-links
-Prefer: -crossover-office
+Prefer: -crossover-office -java-1_5_0-ibm -java-1_5_0-ibm-jdbc
+Prefer: -java-1_4_2-gcj-compat -NX
 
 Conflict: ghostscript-library:ghostscript-mini
 
@@ -63,7 +67,7 @@ Ignore: kdebase3:kdebase3-ksysguardd,OpenEXR,dbus-1,dbus-1-qt,hal,powersave,open
 Ignore: kdebase3-SuSE:release-notes
 Ignore: jack:alsa,libsndfile
 Ignore: libxml2-devel:readline-devel
-Ignore: gnome-vfs2:gnome-mime-data,desktop-file-utils,cdparanoia,dbus-1,dbus-1-glib,krb5,hal,libsmbclient,fam,file_alteration
+Ignore: gnome-vfs2:gnome-mime-data,desktop-file-utils,cdparanoia,dbus-1,dbus-1-glib,hal,libsmbclient,fam,file_alteration
 Ignore: libgda:file_alteration
 Ignore: gnutls:lzo,libopencdk
 Ignore: gnutls-devel:lzo-devel,libopencdk-devel
@@ -105,8 +109,11 @@ Ignore: openslp-devel:openssl-devel
 Ignore: java-1_4_2-sun:xorg-x11-libs
 Ignore: java-1_4_2-sun-devel:xorg-x11-libs
 Ignore: kernel-um:xorg-x11-libs
-Ignore: tetex:xorg-x11-libs,expat,fontconfig,freetype2,libjpeg,libpng,ghostscript-x11,xaw3d,gd,dialog,ed
+Ignore: tetex:xorg-x11-libs,expat,fontconfig,freetype2,libjpeg,ghostscript-x11,xaw3d,gd,dialog,ed
 Ignore: yast2-country:yast2-trans-stats
+Ignore: tpb:tpctl-kmp
+Ignore: tpctl:tpctl-kmp
+Ignore: mkinitrd:pciutils
 Ignore: libgcc:glibc-32bit
 Ignore: libstdc++:glibc-32bit
 Ignore: susehelp:susehelp_lang,suse_help_viewer
@@ -114,6 +121,7 @@ Ignore: mailx:smtp_daemon
 Ignore: cron:smtp_daemon
 Ignore: hotplug:syslog
 Ignore: pcmcia:syslog
+Ignore: openct:syslog
 Ignore: avalon-logkit:servlet
 Ignore: jython:servlet
 Ignore: ispell:ispell_dictionary,ispell_english_dictionary
@@ -186,7 +194,7 @@ Substitute: kernel-binary-packages kernel-default
 %endif
 
 Macros:
-%insserv_prereq insserv sed devs
+%insserv_prereq insserv sed
 %fillup_prereq fillup coreutils
 %suseconfig_fonts_prereq perl aaa_base
 %install_info_prereq info
index 9e305c6..ceac66e 100644 (file)
@@ -1,8 +1,12 @@
+Repotype: suse
+
 Preinstall: aaa_base acl attr bash db devs diffutils filesystem
 Preinstall: fileutils fillup glibc grep libgcc libxcrypt m4 ncurses
 Preinstall: pam permissions readline rpm sed sh-utils shadow tar
 Preinstall: textutils
 
+Runscripts: aaa_base
+
 Required: autoconf automake binutils bzip2 cracklib db gcc gdbm gettext
 Required: glibc libtool ncurses pam perl rpm zlib
 
index 1ee8ac1..5bd9c2d 100644 (file)
@@ -1,8 +1,12 @@
+Repotype: suse
+
 Preinstall: aaa_base acl attr bash coreutils db devs diffutils
 Preinstall: filesystem fillup glibc grep insserv libacl libattr
 Preinstall: libgcc libxcrypt m4 ncurses pam permissions readline
 Preinstall: rpm sed shadow tar zlib
 
+Runscripts: aaa_base
+
 Required: autoconf automake binutils bzip2 cracklib db gcc gdbm gettext
 Required: glibc libtool ncurses pam perl rpm zlib
 
index 31e928b..493e8ba 100644 (file)
@@ -1,8 +1,12 @@
+Repotype: suse
+
 Preinstall: aaa_base acl attr bash bzip2 coreutils db devs diffutils
 Preinstall: filesystem fillup glibc grep insserv libacl libattr
 Preinstall: libgcc libxcrypt m4 ncurses pam permissions popt readline
 Preinstall: rpm sed shadow tar zlib
 
+Runscripts: aaa_base
+
 Required: autoconf automake binutils bzip2 cracklib db gcc gdbm gettext
 Required: glibc libtool ncurses perl rpm zlib
 
index 7ceceba..fc2c5c0 100644 (file)
@@ -1,8 +1,12 @@
+Repotype: suse
+
 Preinstall: aaa_base acl attr bash bzip2 coreutils db devs diffutils
 Preinstall: filesystem fillup glibc grep insserv libacl libattr
 Preinstall: libgcc libselinux libxcrypt m4 ncurses pam permissions
 Preinstall: popt pwdutils readline rpm sed tar zlib
 
+Runscripts: aaa_base
+
 Required: autoconf automake binutils bzip2 db gcc gdbm gettext glibc
 Required: libtool ncurses perl rpm zlib
 
index 3b4d3b2..816705c 100644 (file)
@@ -1,8 +1,12 @@
+Repotype: suse
+
 Preinstall: aaa_base acl attr bash bzip2 coreutils db devs diffutils
 Preinstall: filesystem fillup glibc grep insserv libacl libattr
 Preinstall: libgcc libnscd libselinux libxcrypt m4 ncurses pam
 Preinstall: permissions popt pwdutils readline rpm sed tar zlib
 
+Runscripts: aaa_base
+
 Required: autoconf automake binutils bzip2 db gcc gdbm gettext glibc
 Required: libtool ncurses perl rpm zlib
 
index b17bacd..3ebc75a 100644 (file)
@@ -1,8 +1,12 @@
+Repotype: suse
+
 Preinstall: aaa_base acl attr bash bzip2 coreutils db devs diffutils
 Preinstall: filesystem fillup glibc grep insserv libacl libattr
 Preinstall: libgcc libnscd libselinux libxcrypt m4 ncurses pam
 Preinstall: permissions popt pwdutils readline rpm sed tar zlib
 
+Runscripts: aaa_base
+
 Required: autoconf automake binutils bzip2 db gcc gdbm gettext glibc
 Required: libtool ncurses perl rpm zlib
 
index 8c285a5..8783ac9 100644 (file)
@@ -3,6 +3,8 @@ Preinstall: filesystem fillup glibc grep insserv libacl libattr
 Preinstall: libgcc libnscd libxcrypt m4 ncurses pam
 Preinstall: permissions popt pwdutils readline rpm sed tar zlib
 
+Runscripts: aaa_base
+
 Required: autoconf automake binutils bzip2 db gcc gdbm gettext glibc
 Required: libtool ncurses perl rpm zlib
 
index be937b7..ef8e14f 100644 (file)
@@ -1,8 +1,12 @@
+Repotype: suse
+
 Preinstall: aaa_base acl attr bash db devs diffutils filesystem
 Preinstall: fileutils fillup glibc grep libgcc libxcrypt m4 ncurses
 Preinstall: pam permissions readline rpm sed sh-utils shadow tar
 Preinstall: textutils
 
+Runscripts: aaa_base
+
 Required: autoconf automake binutils bzip2 cracklib db gcc gdbm gettext
 Required: glibc libtool ncurses pam perl rpm zlib
 
index a98dc0e..75f4b63 100644 (file)
@@ -1,8 +1,12 @@
+Repotype: suse
+
 Preinstall: aaa_base acl attr bash bzip2 coreutils db devs diffutils
 Preinstall: filesystem fillup glibc grep insserv libacl libattr
 Preinstall: libgcc libselinux libxcrypt m4 ncurses pam permissions
 Preinstall: popt pwdutils readline rpm sed tar zlib
 
+Runscripts: aaa_base
+
 Required: autoconf automake binutils bzip2 db gcc gdbm gettext glibc
 Required: libtool ncurses perl rpm zlib
 
index 08df4bd..9f7e860 100644 (file)
@@ -1,8 +1,12 @@
+Repotype: suse
+
 Preinstall: aaa_base acl attr bash db devs diffutils filesystem
 Preinstall: fileutils fillup glibc grep libgcc libxcrypt m4 ncurses
 Preinstall: pam permissions readline rpm sed sh-utils shadow tar
 Preinstall: textutils
 
+Runscripts: aaa_base
+
 Required: autoconf automake binutils bzip2 cracklib db gcc gdbm gettext
 Required: glibc libtool ncurses pam perl rpm zlib