tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Switching default Python to 3.13



Let me know when you arrive in the perfect world, but in the real world
with real pkgsrc, this more or less works for me.

I first do pkg_rolling-replace -uvk and resolve anything other than
python version changes.

Obviously you need backups first.

----------------------------------------
#!/bin/sh

echo "WARNING: will call pkgin ar!"

rm -f PKG.python-upgrade
LOG=PKG.python-upgrade

# Determine list of old-version keepable packages, and log/print.
OLD=`pkgin sk | egrep ^py312 | awk '{print $1}'`
for old in $OLD; do
  echo TODO ${old} > ${LOG}
  echo "Will replace: ${old}"
done
echo "Continuing in 10s; ^C to abort."
sleep 10;

echo "Autoremoving before iteration:"
sudo pkgin -y ar
echo "Autoremoving before iteration [DONE]"

# Iterate over packages to be upgraded.
for old in ${OLD}; do
    oldpath=`pkg_info -B ${old} | awk -F= '/PKGPATH/ {print $2}'`
 
    echo "Converting ${old} at ${oldpath}:"

    echo "  deleting:"
    sudo pkg_delete ${old}

    echo "  autoremoving:"
    sudo pkgin -y ar

    echo "  building:"
    if (cd $oldpath && make package-install clean); then
	echo "SUCCESS $oldpath" >> ${LOG}
    else
	echo "FAIL $oldpath" >> ${LOG}
	FAILED="$FAILED $oldpath"
    fi
done

if [ "${FAILED}" != "" ]; then
    echo "FAILED TO REBUILD SOME PACKAGES:"
    echo "    " ${FAILED}
    exit 1
else
    exit 0
fi


Home | Main Index | Thread Index | Old Index