diff -ur slackware64-current.5/source/kde/kde/kde.SlackBuild slackware64-current.1b/source/kde/kde/kde.SlackBuild
--- slackware64-current.5/source/kde/kde/kde.SlackBuild	2021-01-08 01:59:19.329008936 +0100
+++ slackware64-current.1b/source/kde/kde/kde.SlackBuild	2023-08-05 12:32:36.412235349 +0200
@@ -69,6 +69,156 @@
   echo $PKGRETURN
 }
 
+pkgnodir() {
+  PKGRETURN=${1##*/}
+  case "$PKGRETURN" in *.t[gblx][zt])
+    PKGRETURN=${PKGRETURN%.*}
+  esac
+  echo "$PKGRETURN"
+}
+
+package_name() {
+  STRING=$(pkgnodir "$1")
+  case "$STRING" in
+  *-*-*-*)
+    # At least four segments, strip version arch and build and return name:
+    echo "${STRING%-*-*-*}"
+    # cruft for later ;)
+    # BUILD=${STRING##*-}
+    # STRING=${STRING%*-}
+    # ARCH=${STRING##*-}
+    # STRING=${STRING%*-}
+    # VER=${STRING%*-}
+    ;;
+  *)
+    # Old style package name with one segment or we don't have four
+    # segments: return the old-style (or out of spec) package name.
+    echo $STRING
+  esac
+}
+
+getold() {
+  SHORT=$1
+  OLD=""
+    if ls /var/log/packages/$SHORT* 1> /dev/null 2> /dev/null ; then
+      for installed_package in /var/log/packages/$SHORT* ; do
+        if [ "$(package_name $installed_package)" = "$SHORT" ]; then # found one
+          OLD="${installed_package##*/}"
+          break
+        fi
+      done
+    fi
+  echo "$OLD"
+}
+
+getoldpack() {
+  SHORT=$1
+  OLD=""
+    if ls /root/packages/*/$SHORT* 1> /dev/null 2> /dev/null ; then
+      for installed_package in /root/packages/*/$SHORT* ; do
+        if [ "$(package_name $installed_package)" = "$SHORT" ]; then # found one
+          OLD=$(pkgnodir ${installed_package})
+          break
+        fi
+      done
+    fi
+  echo "$OLD"
+}
+
+rl_loop()
+{
+  perl -e '
+  $lo=$l=shift;
+  do {
+    $ltmp=$l;
+    $l=readlink($l);
+    if(length($l)>0) {
+      $lo=$l;
+      if(!($l=~m|^/|)) {
+        $l=substr($ltmp,0,rindex($ltmp,"/")+1).$l;
+      }
+    }
+  } 
+  while(length($l)>0);
+  print "$lo";
+' "$1"
+}
+
+checkinstallpack() {
+  FULL=$1
+  checkout=$TMP/checkver_$$.txt
+  checkver.pl - $FULL 2>$checkout
+  err=$?
+  if [[ $err -eq 100 ]]
+  then
+    # Package found in architecture packages dir, install it.
+    upgradepkg --install-new `cat $checkout`
+    if [[ $? -ne 0 ]]
+    then
+      echo "ERROR INSTALLING common PACKAGE $i (`cat $checkout`). Aborting."
+      exit 4
+    else
+      err=0
+    fi
+  elif [[ $err -eq 99 ]]
+  then
+    # Package found in common packages dir. Install it and then make link.
+    upgradepkg --install-new `cat $checkout`
+    if [[ $? -ne 0 ]]
+    then
+      echo "ERROR INSTALLING common PACKAGE $i (`cat $checkout`). Aborting."
+      exit 4
+    else
+      err=0
+      # Get the commonpkgs dir name
+      pfile=`cat $checkout|sed "s|$pc/||"`
+      commondir=`rl_loop $pc | sed 's|.*/commonpkgs|../../../commonpkgs|'`
+      echo "LINK ln -s $commondir/$pfile $p/$pfile"
+      ln -s $commondir/$pfile $p/$pfile
+      if [[ ! -z "$PACKUSER" ]]; then
+	chown -h $PACKUSER $p/$pfile 2>/dev/null
+      fi
+    fi
+  fi
+  \rm $checkout
+  return $err
+}
+
+packdir="kde"
+
+movepack() {
+  PACKDIR=$1
+  PACKFILE=$2
+  if [ ! -z "$PACKUSER" ]; then
+    # If $PACKUSER is defined, move directly the package into destination directory
+    chown $PACKUSER $PACKDIR/$PACKFILE
+    destdir="$p"
+    if [ $err -eq 10 ]; then
+      destdir="$pc"
+    fi
+    if [ ! -z "$destdir" ]; then
+      destdir="$destdir/$packdir"
+      if [ ! -d "$destdir" ]; then
+	mkdir -p $destdir
+	chown $PACKUSER $destdir
+      fi
+      if [ ! -f "$destdir/${PACKFILE}" ]; then
+	\mv $PACKDIR/$PACKFILE $destdir
+      fi
+      if [ $err -eq 10 ]; then
+        if [ ! -d "$p/$packdir" ]; then
+	  mkdir -p $p/$packdir
+	  chown $PACKUSER $p/$packdir
+        fi
+	commondir=`rl_loop $pc | sed 's|.*/commonpkgs|../../../commonpkgs|'`
+	echo "LINK ln -s $commondir/$packdir/$PACKFILE $p/$packdir/$PACKFILE"
+	ln -s $commondir/$packdir/$PACKFILE $p/$packdir/$PACKFILE
+        chown -h $PACKUSER $p/$packdir/$PACKFILE 2>/dev/null
+      fi
+    fi
+  fi
+}
+
 # Set initial variables:
 cd $(dirname $0) ; CWD=$(pwd)
 
@@ -293,9 +349,45 @@
         PKGARCH=noarch
       fi 
       cd $SLACK_KDE_BUILD_DIR/${kde_module}
+
+      # Let's figure out the version number on the modular package:
+      MODULAR_PACKAGE_VERSION=$(echo $kde_src | rev | cut -f 3- -d . | cut -f 1 -d - | rev)
+
+      if [ -r $CWD/build/${PKGNAME} ]; then
+	MODBUILD=$(cat $CWD/build/${PKGNAME})
+      else
+	MODBUILD=$BUILD
+      fi
+
+      FULLPKG=${PKGNAME}-$(echo $MODULAR_PACKAGE_VERSION |tr - _)-${PKGARCH}-${MODBUILD}
+      if [[ `echo $0 | grep -c onlynew-pack` -gt 0 ]]
+      then
+	OLD=$(getoldpack "${PKGNAME}")
+      else
+	OLD=$(getold "${PKGNAME}")
+      fi
+
+      err=0
       # If $kde_pkg is set, we only want to build one package:
       if [ ! -z "$kde_pkg" ]; then
         if [ "$kde_pkg" = "$PKGNAME" ]; then
+	  if [ "$OLD" = "$FULLPKG" ]
+	  then
+	    echo "Package $FULLPKG is already OK"
+	    continue
+	  elif [[ `echo $0 | grep -c onlynew-pack` -eq 0 ]]
+	  then
+	    if checkinstallpack $FULLPKG
+	    then
+	      echo "Package $FULLPKG installed"
+	      continue
+	    fi
+	  fi
+
+	  echo ""
+	  echo "Building new package $FULLPKG ($OLD)"
+	  echo ""
+
           # Set $PKG to a private dir for the modular package build:
           PKG=$SLACK_KDE_BUILD_DIR/${kde_module}/package-$PKGNAME
           rm -rf $PKG
@@ -304,6 +387,15 @@
           continue
         fi
       else
+	if [ "$OLD" = "$FULLPKG" ]
+	then
+	  echo "Package $FULLPKG is already OK"
+	  continue
+	elif checkinstallpack $FULLPKG
+	then
+	  echo "Package $FULLPKG installed"
+	  continue
+	fi
         if [ -z "$PRINT_PACKAGE_NAME" ]; then
           echo
           echo "Building from source ${kde_src}"
@@ -316,17 +404,9 @@
       rm -rf $PKG
       mkdir -p $PKG
 
-      # Let's figure out the version number on the modular package:
-      MODULAR_PACKAGE_VERSION=$(echo $kde_src | rev | cut -f 3- -d . | cut -f 1 -d - | rev)
-
       # If this variable is passed to the script, nothing will be built.
       # Instead, a list of packages to be built will be output.
       if [ ! -z "$PRINT_PACKAGE_NAME" ]; then
-        if [ -r $CWD/build/${PKGNAME} ]; then
-          MODBUILD=$(cat $CWD/build/${PKGNAME})
-        else
-          MODBUILD=$BUILD
-        fi
         echo "${PKGNAME}-${MODULAR_PACKAGE_VERSION}-${PKGARCH}-${MODBUILD}.txz"
         continue
       fi
@@ -441,11 +521,6 @@
         else
           touch $PKG/install/slack-desc-missing
         fi
-        if [ -r $CWD/build/${PKGNAME} ]; then
-          MODBUILD=$(cat $CWD/build/${PKGNAME})
-        else
-          MODBUILD=$BUILD
-        fi
         if [ -r $CWD/makepkg/${PKGNAME} ]; then
           BUILD=$MODBUILD . $CWD/makepkg/${PKGNAME}
         else
@@ -540,6 +609,7 @@
           # Keep MIME database current:
           /usr/bin/update-mime-database /usr/share/mime 1>/dev/null 2>/dev/null &
         fi
+	movepack ${SLACK_KDE_BUILD_DIR}/${kde_module} ${PKGNAME}-${MODULAR_PACKAGE_VERSION}-${PKGARCH}-${MODBUILD}.txz
       fi
 
     done
diff -ur slackware64-current.1/source/kde/kde/kde.SlackBuild slackware64-current.continue/source/kde/kde/kde.SlackBuild
--- slackware64-current.1/source/kde/kde/kde.SlackBuild	2021-01-08 01:59:19.329008936 +0100
+++ slackware64-current.continue/source/kde/kde/kde.SlackBuild	2022-09-18 14:17:19.010510445 +0200
@@ -460,7 +460,16 @@
           . $CWD/make/${kde_module}
         else
           # This is the default make && make install routine:
-          make $NUMJOBS || make || exit 1
+          make $NUMJOBS || make
+          if [ $? -ne 0 ]; then
+            if [ "$KDEFAILS" != "" -a -f $KDEFAILS/${PKGNAME}.failed ]; then
+              touch $KDEFAILS/${PKGNAME}.failed
+              continue
+            else
+              date > $TMP/${PKGNAME}.failed
+              exit 1
+            fi
+ 	  fi
           make install DESTDIR=$PKG || exit 1
         fi
       fi
diff -ur slackware64-current.5/source/x/x11/x11.SlackBuild slackware64-current.1b/source/x/x11/x11.SlackBuild
--- slackware64-current.5/source/x/x11/x11.SlackBuild	2021-09-18 13:56:11.967206049 +0200
+++ slackware64-current.1b/source/x/x11/x11.SlackBuild	2023-08-31 11:09:58.320322705 +0200
@@ -47,6 +47,9 @@
   'xz' )
     PKGRETURN=$(basename $1 .tar.xz)
     ;;
+  'lz' )
+    PKGRETURN=$(basename $1 .tar.lz)
+    ;;
   *)
     PKGRETURN=$(basename $1)
     ;;
@@ -54,6 +57,156 @@
   echo $PKGRETURN
 }
 
+pkgnodir() {
+  PKGRETURN=${1##*/}
+  case "$PKGRETURN" in *.t[gblx][zt])
+    PKGRETURN=${PKGRETURN%.*}
+  esac
+  echo "$PKGRETURN"
+}
+
+package_name() {
+  STRING=$(pkgnodir "$1")
+  case "$STRING" in
+  *-*-*-*)
+    # At least four segments, strip version arch and build and return name:
+    echo "${STRING%-*-*-*}"
+    # cruft for later ;)
+    # BUILD=${STRING##*-}
+    # STRING=${STRING%*-}
+    # ARCH=${STRING##*-}
+    # STRING=${STRING%*-}
+    # VER=${STRING%*-}
+    ;;
+  *)
+    # Old style package name with one segment or we don't have four
+    # segments: return the old-style (or out of spec) package name.
+    echo $STRING
+  esac
+}
+
+getold() {
+  SHORT=$1
+  OLD=""
+    if ls /var/log/packages/$SHORT* 1> /dev/null 2> /dev/null ; then
+      for installed_package in /var/log/packages/$SHORT* ; do
+        if [ "$(package_name $installed_package)" = "$SHORT" ]; then # found one
+          OLD="${installed_package##*/}"
+          break
+        fi
+      done
+    fi
+  echo "$OLD"
+}
+
+getoldpack() {
+  SHORT=$1
+  OLD=""
+    if ls /root/packages/*/$SHORT* 1> /dev/null 2> /dev/null ; then
+      for installed_package in /root/packages/*/$SHORT* ; do
+        if [ "$(package_name $installed_package)" = "$SHORT" ]; then # found one
+          OLD=$(pkgnodir ${installed_package})
+          break
+        fi
+      done
+    fi
+  echo "$OLD"
+}
+
+rl_loop()
+{
+  perl -e '
+  $lo=$l=shift;
+  do {
+    $ltmp=$l;
+    $l=readlink($l);
+    if(length($l)>0) {
+      $lo=$l;
+      if(!($l=~m|^/|)) {
+        $l=substr($ltmp,0,rindex($ltmp,"/")+1).$l;
+      }
+    }
+  } 
+  while(length($l)>0);
+  print "$lo";
+' "$1"
+}
+
+checkinstallpack() {
+  FULL=$1
+  checkout=$TMP/checkver_$$.txt
+  checkver.pl - $FULL 2>$checkout
+  err=$?
+  if [[ $err -eq 100 ]]
+  then
+    # Package found in architecture packages dir, install it.
+    upgradepkg --install-new `cat $checkout`
+    if [[ $? -ne 0 ]]
+    then
+      echo "ERROR INSTALLING common PACKAGE $i (`cat $checkout`). Aborting."
+      exit 4
+    else
+      err=0
+    fi
+  elif [[ $err -eq 99 ]]
+  then
+    # Package found in common packages dir. Install it and then make link.
+    upgradepkg --install-new `cat $checkout`
+    if [[ $? -ne 0 ]]
+    then
+      echo "ERROR INSTALLING common PACKAGE $i (`cat $checkout`). Aborting."
+      exit 4
+    else
+      err=0
+      # Get the commonpkgs dir name
+      pfile=`cat $checkout|sed "s|$pc/||"`
+      commondir=`rl_loop $pc | sed 's|.*/commonpkgs|../../../commonpkgs|'`
+      echo "LINK ln -s $commondir/$pfile $p/$pfile"
+      ln -s $commondir/$pfile $p/$pfile
+      if [[ ! -z "$PACKUSER" ]]; then
+	chown -h $PACKUSER $p/$pfile 2>/dev/null
+      fi
+    fi
+  fi
+  \rm $checkout
+  return $err
+}
+
+packdir="x"
+
+movepack() {
+  PACKDIR=$1
+  PACKFILE=$2
+  if [ ! -z "$PACKUSER" ]; then
+    # If $PACKUSER is defined, move directly the package into destination directory
+    chown $PACKUSER $PACKDIR/$PACKFILE
+    destdir="$p"
+    if [ $err -eq 10 ]; then
+      destdir="$pc"
+    fi
+    if [ ! -z "$destdir" ]; then
+      destdir="$destdir/$packdir"
+      if [ ! -d "$destdir" ]; then
+	mkdir -p $destdir
+	chown $PACKUSER $destdir
+      fi
+      if [ ! -f "$destdir/${PACKFILE}" ]; then
+	\mv $PACKDIR/$PACKFILE $destdir
+      fi
+      if [ $err -eq 10 ]; then
+        if [ ! -d "$p/$packdir" ]; then
+	  mkdir -p $p/$packdir
+	  chown $PACKUSER $p/$packdir
+        fi
+	commondir=`rl_loop $pc | sed 's|.*/commonpkgs|../../../commonpkgs|'`
+	echo "LINK ln -s $commondir/$packdir/$PACKFILE $p/$packdir/$PACKFILE"
+	ln -s $commondir/$packdir/$PACKFILE $p/$packdir/$PACKFILE
+        chown -h $PACKUSER $p/$packdir/$PACKFILE 2>/dev/null
+      fi
+    fi
+  fi
+}
+
 # Set initial variables:
 cd $(dirname $0) ; CWD=$(pwd)
 if [ -z "$TMP" ]; then
@@ -153,7 +212,7 @@
     fi
     PKG=${SLACK_X_BUILD_DIR}/package-${x_source_dir}
     rm -rf $PKG
-    mkdir -p $PKG
+    #mkdir -p $PKG
     ( cd $x_source_dir
       for x_pkg in *.tar.?z* ; do
         # Reset $PKGARCH to its initial value:
@@ -173,35 +237,36 @@
             # Set $PKG to a private dir for the modular package build:
             PKG=$SLACK_X_BUILD_DIR/package-$PKGNAME
             rm -rf $PKG
-            mkdir -p $PKG
+            #mkdir -p $PKG
           else
             continue
           fi
         else
           if [ -z "$PRINT_PACKAGE_NAME" ]; then
-            echo
-            echo "Building from source ${x_pkg}"
-            echo
+            echo > /dev/null
+            echo "Building from source ${x_pkg}" > /dev/null
+            echo > /dev/null
           fi
         fi
         if grep -wq "^$PKGNAME" ${CWD}/modularize ; then
           # Set $PKG to a private dir for the modular package build:
           PKG=$SLACK_X_BUILD_DIR/package-$PKGNAME
           rm -rf $PKG
-          mkdir -p $PKG
+          #mkdir -p $PKG
         fi
 
         # Let's figure out the version number on the modular package:
         MODULAR_PACKAGE_VERSION=$(echo $x_pkg | rev | cut -f 3- -d . | cut -f 1 -d - | rev)
 
-        # If this variable is passed to the script, nothing will be built.
-        # Instead, a list of packages to be built will be output.
-        if [ ! -z "$PRINT_PACKAGE_NAME" ]; then
           if [ -r $CWD/build/${PKGNAME} ]; then
             MODBUILD=$(cat $CWD/build/${PKGNAME})
           else
             MODBUILD=$BUILD
           fi
+
+        # If this variable is passed to the script, nothing will be built.
+        # Instead, a list of packages to be built will be output.
+        if [ ! -z "$PRINT_PACKAGE_NAME" ]; then
           if [ ! "${PKGNAME}" = "xorg-server" ]; then
             echo "${PKGNAME}-${MODULAR_PACKAGE_VERSION}-${PKGARCH}-${MODBUILD}.txz"
           else
@@ -214,6 +354,39 @@
           continue
         fi
 
+	# Check if new
+	if [ -f $CWD/configure/${PKGNAME} ] ; then
+	  cat $CWD/configure/${PKGNAME} | grep -v exit > /dev/shm/tmp.sh
+	  . /dev/shm/tmp.sh
+	  cd $SLACK_X_BUILD_DIR
+	fi
+	FULLPKG=${PKGNAME}-${MODULAR_PACKAGE_VERSION}-${PKGARCH}-${MODBUILD}
+	if [[ `echo $0 | grep -c onlynew-pack` -gt 0 ]]
+	then
+	  OLD=$(getoldpack "${PKGNAME}")
+	else
+	  OLD=$(getold "${PKGNAME}")
+	fi
+
+	err=0
+	if [ "$OLD" = "$FULLPKG" ]
+	then
+	  echo "Package $FULLPKG is already OK"
+	  continue
+	elif [[ `echo $0 | grep -c onlynew-pack` -eq 0 ]]
+	then
+	  if checkinstallpack $FULLPKG
+	  then
+	    echo "Package $FULLPKG installed"
+	    continue
+	  fi
+	fi
+
+	echo ""
+	echo "Building new package $FULLPKG ($OLD)"
+	echo ""
+	mkdir -p $PKG
+
         rm -rf $(pkgbase $x_pkg)
         tar xf $CWD/src/${x_source_dir}/${x_pkg} || exit 1
         cd $(pkgbase $x_pkg) || exit 1
@@ -230,7 +413,18 @@
 
         # ./configure, using custom configure script if needed:
         if [ -r $CWD/configure/${PKGNAME} ]; then
-          . $CWD/configure/${PKGNAME}
+	  if [ `grep -c 'exit ' $CWD/configure/${PKGNAME}` -gt 0 ]; then
+	    if ! (. $CWD/configure/${PKGNAME}) ; then
+              touch ${SLACK_X_BUILD_DIR}/${PKGNAME}.failed
+              continue
+	    fi
+	    if [ `grep -c '^cd ' $CWD/configure/${PKGNAME}` -gt 0 ]; then
+              cat $CWD/configure/${PKGNAME} | grep '^cd ' > /dev/shm/tmp.sh
+	      . /dev/shm/tmp.sh
+	    fi
+	  else
+	    . $CWD/configure/${PKGNAME}
+	  fi
         else
           # This is the default configure script:
           . $CWD/configure/configure
@@ -238,7 +428,14 @@
 
         # Run make, using custom make script if needed:
         if [ -r $CWD/make/${PKGNAME} ]; then
-          . $CWD/make/${PKGNAME}
+	  if [ `grep -c 'exit ' $CWD/make/${PKGNAME}` -gt 0 ]; then
+	    if ! (. $CWD/make/${PKGNAME}) ; then
+              touch ${SLACK_X_BUILD_DIR}/${PKGNAME}.failed
+              continue
+	    fi
+	  else
+	    . $CWD/make/${PKGNAME}
+	  fi
         else
           # This is the default make && make install routine:
           if ! make $NUMJOBS ; then
@@ -418,6 +483,7 @@
             elif [ "$UPGRADE_PACKAGES" = "always" ]; then
               /sbin/upgradepkg --install-new --reinstall ${SLACK_X_BUILD_DIR}/${PKGNAME}-${MODULAR_PACKAGE_VERSION}-${PKGARCH}-${MODBUILD}.txz
             fi
+	    movepack ${SLACK_X_BUILD_DIR} ${PKGNAME}-${MODULAR_PACKAGE_VERSION}-${PKGARCH}-${MODBUILD}.txz
           fi
         fi
 
@@ -474,6 +540,7 @@
           elif [ "$UPGRADE_PACKAGES" = "always" ]; then
             /sbin/upgradepkg --install-new --reinstall ${SLACK_X_BUILD_DIR}/x11-${x_source_dir}-${VERSION}-${PKGARCH}-${SRCDIRBUILD}.txz
           fi
+	  movepack ${SLACK_X_BUILD_DIR} x11-${x_source_dir}-${VERSION}-${PKGARCH}-${SRCDIRBUILD}.txz
         fi
 
       fi # build x11-<sourcedir> package
