- autodetect arch build type
authorMichael Schroeder <mls@suse.de>
Tue, 3 Apr 2012 10:19:08 +0000 (12:19 +0200)
committerMichael Schroeder <mls@suse.de>
Tue, 3 Apr 2012 10:19:08 +0000 (12:19 +0200)
Build.pm
init_buildsystem

index 8e1c203..6f69372 100644 (file)
--- a/Build.pm
+++ b/Build.pm
@@ -294,12 +294,14 @@ sub read_config {
     s/=$// for @{$config->{'substitute'}->{$l}};
   }
   init_helper_hashes($config);
-  if ( ! $config->{'type'}) {
+  if (!$config->{'type'}) {
     # Fallback to old guessing method if no type (spec, dsc or kiwi) is defined
     if (grep {$_ eq 'rpm'} @{$config->{'preinstall'} || []}) {
       $config->{'type'} = 'spec';
     } elsif (grep {$_ eq 'debianutils'} @{$config->{'preinstall'} || []}) {
       $config->{'type'} = 'dsc';
+    } elsif (grep {$_ eq 'pacman'} @{$config->{'preinstall'} || []}) {
+      $config->{'type'} = 'arch';
     } else {
       $config->{'type'} = 'UNDEFINED';
     }
index d31a839..1a882e6 100755 (executable)
@@ -239,6 +239,11 @@ init_db()
            cp $BUILD_ROOT/.init_b_cache/rpms/dpkg.deb $BUILD_ROOT/.init_b_cache/dpkg.deb || cleanup_and_exit 1
        fi
        chroot $BUILD_ROOT dpkg -i --force all .init_b_cache/dpkg.deb >/dev/null 2>&1
+    elif test $PSUF = arch ; then
+       mkdir -p $BUILD_ROOT/var/lib/pacman/sync
+       touch $BUILD_ROOT/var/lib/pacman/sync/core.db
+       touch $BUILD_ROOT/var/lib/pacman/sync/extra.db
+       touch $BUILD_ROOT/var/lib/pacman/sync/community.db
     fi
 }
 
@@ -955,7 +960,7 @@ for PKG in $PACKAGES_TO_INSTALL_FIRST RUN_LDCONFIG $PACKAGES_TO_INSTALL $PACKAGE
         echo "installing ${PKGID%_*}"
        # -d -d disables deps checking
        ( chroot $BUILD_ROOT pacman -Uf -d -d --noconfirm .init_b_cache/$PKG.$PSUF 2>&1 || touch $BUILD_ROOT/exit ) | \
-           perl -ne '$|=1;/^(warning: could not get filesystem information for |loading packages|looking for inter-conflicts|Targets |Total Installed Size: |Net Upgrade Size: |Proceed with installation|checking package integrity|loading package files|checking available disk space|installing |upgrading |warning: database file for |warning:.*is up to date -- reinstalling|Optional dependencies for|    )/||/^$/||print'
+           perl -ne '$|=1;/^(warning: could not get filesystem information for |loading packages|looking for inter-conflicts|Targets |Total Installed Size: |Net Upgrade Size: |Proceed with installation|checking package integrity|loading package files|checking available disk space|installing |upgrading |warning:.*is up to date -- reinstalling|Optional dependencies for|    )/||/^$/||print'
        check_exit
         echo "$PKGID $PSUF" > $BUILD_ROOT/installed-pkg/$PKG
        continue