Commits

Christos Nouskas  committed 9978165

3.2.7-2
Fixed bug that created a bogus depends array on optimized packages
The linux-headers package now follows the kernel cpu
Added depends and conflicts arrays to linux-pf-headers

  • Participants
  • Parent commits d78c502

Comments (0)

Files changed (1)

 pkgname=('linux-pf')
 true && pkgname=('linux-pf' 'linux-pf-headers')
 pkgver=${_basekernel}.${_pfrel}
-pkgrel=1
+pkgrel=2
 arch=('i686' 'x86_64')
 url="http://pf.natalenko.name/"
 license=('GPL2')
 
 _aufs3git="git://aufs.git.sourceforge.net/gitroot/aufs/aufs3-standalone.git"
 _aufs3name=aufs3
-
 # '
 
 build() {
   echo
   if [[ "$CPU" != "GENERIC" ]]; then
     echo "=============================================================="
-    msg "Hit <ENTER>: to create a package named linux-pf"
-    echo "             regardless of the CPU selected in config (recommended)"
-    msg "Hit <P>    : to create a package named after the selected CPU"
-    echo "             (e.g. linux-pf-core2 - for advanced users)"
+    msg "An non-generic CPU was selected for this kernel."
+    echo
+    msg "Hit <G>     :  to create a generic package named linux-pf"
+    msg "Hit <ENTER> :  to create a package named after the selected CPU"
+    echo "                   (e.g. linux-pf-core2 - recommended)"
     echo
     msg "This option affects ONLY the package name. Whether or not the"
     msg "kernel is optimized was determined at the previous config step."
     echo "=============================================================="
     read answer
     shopt -s nocasematch
-    if [[ "$answer" = "p" ]]; then
+    if [[ "$answer" != "g" ]]; then
        export _PKGOPT=y
     fi
   fi
 }
 
 package_linux-pf() {
- _pkgdesc="Linux kernel and modules with pf-kernel patch [-ck patchset (BFS included), TuxOnIce, BFQ] and aufs3"
+ _pkgdesc="Linux kernel and modules with the pf-kernel patch [-ck patchset (BFS included), TuxOnIce, BFQ] and aufs3."
  pkgdesc=${_pkgdesc}
  groups=('base')
  backup=(etc/mkinitcpio.d/${_pkgname}.preset)
  #conflicts=(linux-pf-core2 linux-pf-k8 linux-pf-psc linux-pf-atom linux-pf-k7 linux-pf-p3 linux-pf-pm linux-pf-p4)
  #conflicts=('kernel26-pf')
  # If generic build, then conflict with all optimized ones
- conflicts=('linux-pf-core2' 'linux-pf-k8' 'linux-pf-psc' 'linux-pf-atom' 'linux-pf-k7'
-	    'linux-pf-p3' 'linux-pf-pm' 'linux-pf-p4' 'kernel26-pf-core2' 'kernel26-pf-k8'
-	    'kernel26-pf-psc' 'kernel26-pf-atom' 'kernel26-pf-k7' 'kernel26-pf-p3'
-	    'kernel26-pf-pm' 'kernel26-pf-p4')
+ conflicts=('linux-pf-core2' 'linux-pf-k8' 'linux-pf-psc' 'linux-pf-atom'
+	    'linux-pf-k7' 'linux-pf-p3' 'linux-pf-pm' 'linux-pf-p4'
+	    'linux-pf-headers-core2' 'linux-pf-headers-k8' 'linux-pf-headers-psc'
+	    'linux-pf-headers-atom' 'linux-pf-headers-k7' 'linux-pf-headers-p3'
+	    'linux-pf-headers-pm' 'linux-pf-headers-p4'
+	    'kernel26-pf-core2' 'kernel26-pf-k8' 'kernel26-pf-psc' 'kernel26-pf-atom'
+	    'kernel26-pf-k7' 'kernel26-pf-p3' 'kernel26-pf-pm' 'kernel26-pf-p4')
  replaces=('kernel26-pf' 'aufs3')
  install='linux-pf.install'
 
   # work around the AUR parser
   # This allows building cpu-optimized packages with according package names.
   # Useful for repo maintainers.
-  pkgnameopt="${_pkgname}"	# this MUST outside the following 'if'
+
+  headers="headers"
+  pkgnameopt="${_pkgname}"		# this MUST be outside the following 'if'
   if [[ "$_PKGOPT" = "y" ]]; then	# package naming according to optimization
     case $CPU in
      CORE2)
-	 pkgname="${_pkgname}-core2"
+         pkgname="${_pkgname}-core2"
          pkgdesc="${_pkgdesc} Intel Core2 optimized."
          ;;
      K8)
      default)
   # Note to me: DO NOT EVER REMOVE THIS. It's for the AUR PKGBUILD parser.
          pkgname="${_pkgname}"
-         pkgdesc="Linux kernel and modules with pf-kernel patch [-ck patchset (BFS included), TuxOnIce, BFQ] and aufs3"
+         pkgdesc="Linux kernel and modules with the pf-kernel patch [-ck patchset (BFS included), TuxOnIce, BFQ] and aufs3"
          ;;
     esac
 
+
   # If optimized build, conflict with generic and other optimized ones
 
   if [[ "$pkgname" != "$_pkgname" ]]; then
-	pkgnameopt="${pkgname}"	# this MUST outside the following 'if'
+	pkgnameopt="${pkgname}"		# this MUST be inside this if-fi
 	pkgname="${_pkgname}"
-	suffix=`sed -e "s/linux-pf-//" <<<$pkgname`		# get suffix
+	echo pkgname $pkgname
+	cpuopt=`sed -e "s/linux-pf-//" <<<$pkgnameopt`		# get suffix
+	cpuoptdesc=`sed -e "s/${_pkgdesc}//" <<<$pkgdesc`	# get description
 	conflicts=('linux-pf' 'kernel26-pf' ${conflicts[@]})	# add generic packages
-	conflicts=({conflicts[@]/linux-pf-$suffix/})		# remove current
+	conflicts=(${conflicts[@]/linux-pf-${cpuopt}/})		# remove current
+	conflicts=(${conflicts[@]/linux-pf-headers-${cpuopt}/})		# remove current's headers
+	export cpuopt cpuoptdesc
+	echo headers: $headers cpuopt: $cpuopt
+	headers="${headers}-${cpuopt}"
+	echo headers: $headers cpuopt: $cpuopt
   fi
 
-    echo
-    echo "======================================="
-    msg  "The package will be named ${pkgnameopt}"
-    msg  "${pkgdesc}"
-    echo "======================================="
-    echo
-
   # second batch check ends here
  fi
 
+ # Pass conflicts array to linux-pf-headers()
+ export _conflicts=${conflicts[@]}
+
+  echo
+  echo "    ======================================="
+  msg  "The packages will be named ${pkgnameopt}"
+  msg  "and ${pkgname}-${headers}"
+  msg  "${pkgdesc}"
+  echo "    ======================================="
+  echo
+
  ### package_linux-pf
  ###
   KARCH=x86
 
 ### package_linux-pf-headers
 package_linux-pf-headers() {
-  pkgdesc="Header files and scripts for building modules for linux-f kernel"
+  pkgdesc="Header files and scripts for building modules for linux-pf kernel."
+  depends=('linux-pf')
+  IFS=' ' read -a conflicts <<<${_conflicts}
+  [[ ${cpuopt} ]] && pkgname=${pkgname}-${cpuopt} && depends=${depends}-${cpuopt}
+  [[ ${cpuoptdesc} ]] && pkgdesc=${pkgdesc}${cpuoptdesc}
+
   provides=('linux-pf-headers')
 
   mkdir -p "${pkgdir}/lib/modules/${_kernver}"
 }
 
 # Work around the AUR parser
-pkgdesc="Linux kernel and modules with pf-kernel patch [-ck patchset (BFS included), TuxOnIce, BFQ] and aufs3"
+pkgdesc="Linux kernel and modules with the pf-kernel patch [-ck patchset (BFS included), TuxOnIce, BFQ] and aufs3"
 
 # makepkg -g >>PKGBUILD