[PC-BSD Commits] r7897 - in pcbsd/current: src-qt4/pc-sysmanager system-overlay/usr/PCBSD/SystemUpdater/bin
svn at pcbsd.org
svn at pcbsd.org
Mon Oct 25 12:49:41 PDT 2010
Author: kris
Date: 2010-10-25 12:49:41 -0700 (Mon, 25 Oct 2010)
New Revision: 7897
Modified:
pcbsd/current/src-qt4/pc-sysmanager/systemupdates.cpp
pcbsd/current/system-overlay/usr/PCBSD/SystemUpdater/bin/downloadSysUpdates.sh
pcbsd/current/system-overlay/usr/PCBSD/SystemUpdater/bin/installSysUpdates.sh
pcbsd/current/system-overlay/usr/PCBSD/SystemUpdater/bin/readSysUpdates.sh
pcbsd/current/system-overlay/usr/PCBSD/SystemUpdater/bin/readSysUpdatesUser.sh
Log:
Fixed system updates to keep meta-data in /var/db now
Modified: pcbsd/current/src-qt4/pc-sysmanager/systemupdates.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-sysmanager/systemupdates.cpp 2010-10-25 18:39:33 UTC (rev 7896)
+++ pcbsd/current/src-qt4/pc-sysmanager/systemupdates.cpp 2010-10-25 19:49:41 UTC (rev 7897)
@@ -70,7 +70,7 @@
workingPopupItem = idnum;
// Check if this patch is ignored or not
- QFile file( "/PCBSD/SystemUpdater/system-updates/ignored/" + SysUpdatePatchFile[idnum] );
+ QFile file( "/var/db/pc-sysupdates/ignored/" + SysUpdatePatchFile[idnum] );
if ( ! file.exists() ) {
popup = new QMenu();
popup->addAction( tr("Ignore this update") , this, SLOT(slotIgnoreSysUpdate() ) );
@@ -162,9 +162,9 @@
{
int idnum = workingPopupItem;
- QFile file( "/PCBSD/SystemUpdater/system-updates/available/" + SysUpdatePatchFile[idnum] );
+ QFile file( "/var/db/pc-sysupdates/available/" + SysUpdatePatchFile[idnum] );
if ( file.exists() ) {
- system("cp /PCBSD/SystemUpdater/system-updates/available/" + SysUpdatePatchFile[idnum].toLatin1() + " /PCBSD/SystemUpdater/system-updates/ignored/" + SysUpdatePatchFile[idnum].toLatin1());
+ system("cp /var/db/pc-sysupdates/available/" + SysUpdatePatchFile[idnum].toLatin1() + " /var/db/pc-sysupdates/ignored/" + SysUpdatePatchFile[idnum].toLatin1());
}
SysUpdateIgnore[idnum] = "YES";
@@ -194,9 +194,9 @@
{
int idnum = workingPopupItem;
- QFile file( "/PCBSD/SystemUpdater/system-updates/ignored/" + SysUpdatePatchFile[idnum] );
+ QFile file( "/var/db/pc-sysupdates/ignored/" + SysUpdatePatchFile[idnum] );
if ( file.exists() ) {
- system("rm /PCBSD/SystemUpdater/system-updates/ignored/" + SysUpdatePatchFile[idnum].toLatin1());
+ system("rm /var/db/pc-sysupdates/ignored/" + SysUpdatePatchFile[idnum].toLatin1());
}
SysUpdateIgnore[idnum] = "NO";
@@ -416,7 +416,7 @@
SysUpdatePatchFile[patchNum]=patchFile;
// Open our config file, and read in the data
- QFile file( "/PCBSD/SystemUpdater/system-updates/available/" + patchFile );
+ QFile file( "/var/db/pc-sysupdates/available/" + patchFile );
if ( file.open( QIODevice::ReadOnly ) ) {
QTextStream stream( &file );
@@ -1057,7 +1057,7 @@
stream4 << "sh update.sh >&1 2>&1\n";
stream4 << "if [ \"$?\" = \"0\" ]\n";
stream4 << "then\n";
- stream4 << " cp /PCBSD/SystemUpdater/system-updates/available/" + SysUpdatePatchFile[currentSysWorkingItem] + " /PCBSD/SystemUpdater/system-updates/installed/" + SysUpdatePatchFile[currentSysWorkingItem] + "\n";
+ stream4 << " cp /var/db/pc-sysupdates/available/" + SysUpdatePatchFile[currentSysWorkingItem] + " /var/db/pc-sysupdates/installed/" + SysUpdatePatchFile[currentSysWorkingItem] + "\n";
stream4 << " rm -rf '" + customTmpDir + "/patch" + tmp.setNum(currentSysWorkingItem) + "'\n";
stream4 << " rm '" + customTmpDir + "/.extractsys.sh'\n";
stream4 << " rm '" + customTmpDir + "/.installsys.sh'\n";
Modified: pcbsd/current/system-overlay/usr/PCBSD/SystemUpdater/bin/downloadSysUpdates.sh
===================================================================
--- pcbsd/current/system-overlay/usr/PCBSD/SystemUpdater/bin/downloadSysUpdates.sh 2010-10-25 18:39:33 UTC (rev 7896)
+++ pcbsd/current/system-overlay/usr/PCBSD/SystemUpdater/bin/downloadSysUpdates.sh 2010-10-25 19:49:41 UTC (rev 7897)
@@ -52,18 +52,23 @@
# Done with config values
###########################################################################################
+AVAILDIR="/var/db/pc-sysupdates/available"
+INSDIR="/var/db/pc-sysupdates/installed"
+IGNDIR="/var/db/pc-sysupdates/ignored"
+
# Check if we have an update folder for the version we are on
-if [ ! -d "${PROGDIR}/system-updates/available/${SYSVER}" ]
-then
- mkdir -p ${PROGDIR}/system-updates/available/${SYSVER}
-fi
+if [ ! -d "${AVAILDIR}/${SYSVER}" ] ; then mkdir -p ${AVAILDIR}/${SYSVER} ; fi
+# Make the installed directory for this version
+if [ ! -d "${INSDIR}/${SYSVER}" ] ; then mkdir -p ${INSDIR}/${SYSVER} ; fi
+# Make the ignore directory for this version
+if [ ! -d "${IGNDIR}/${SYSVER}" ] ; then mkdir -p ${IGNDIR}/${SYSVER} ; fi
# Now fetch the update file
fetch -o ${PATCHTMPFILE} ${PATCHURL} >/dev/null 2>/dev/null
if [ "$?" = "0" ]
then
# If we have new update-data file, extract it
- cd ${PROGDIR}/system-updates/available/${SYSVER}
+ cd ${AVAILDIR}/${SYSVER}
# Remove old .upd data files
rm *.upd
@@ -76,32 +81,18 @@
rmdir ${PATCHTMPDIR}
fi
-
-# Make the installed directory for this version
-if [ ! -d "${PROGDIR}/system-updates/installed/${SYSVER}" ]
-then
- mkdir -p ${PROGDIR}/system-updates/installed/${SYSVER}
-fi
-
-# Make the ignore directory for this version
-if [ ! -d "${PROGDIR}/system-updates/ignored/${SYSVER}" ]
-then
- mkdir -p ${PROGDIR}/system-updates/ignored/${SYSVER}
-fi
-
# CD to the patch directory for this version
-cd ${PROGDIR}/system-updates/available/${SYSVER}
+cd ${AVAILDIR}/${SYSVER}
-
# Now check which updates are available, and begin to download them
for i in `ls *.upd`
do
- if [ ! -e "${PROGDIR}/system-updates/installed/${SYSVER}/${i}" ]
+ if [ ! -e "${INSDIR}/${SYSVER}/${i}" ]
then
- if [ ! -e "${PROGDIR}/system-updates/ignored/${SYSVER}/${i}" ]
+ if [ ! -e "${IGNDIR}/${SYSVER}/${i}" ]
then
# Start downloading the patch
- UPDFILE="${PROGDIR}/system-updates/available/${SYSVER}/${i}"
+ UPDFILE="${AVAILDIR}/${SYSVER}/${i}"
case $MIRRORTYPE in
${SELECTMIRROR}|${CUSTOMMIRROR}) FILEURL="$MIRRORURL" ;;
Modified: pcbsd/current/system-overlay/usr/PCBSD/SystemUpdater/bin/installSysUpdates.sh
===================================================================
--- pcbsd/current/system-overlay/usr/PCBSD/SystemUpdater/bin/installSysUpdates.sh 2010-10-25 18:39:33 UTC (rev 7896)
+++ pcbsd/current/system-overlay/usr/PCBSD/SystemUpdater/bin/installSysUpdates.sh 2010-10-25 19:49:41 UTC (rev 7897)
@@ -30,37 +30,29 @@
# Done with config values
###########################################################################################
-# Check if we have an update folder for the version we are on
-if [ ! -d "${PROGDIR}/system-updates/available/${SYSVER}" ]
-then
- mkdir -p ${PROGDIR}/system-updates/available/${SYSVER}
-fi
+AVAILDIR="/var/db/pc-sysupdates/available"
+INSDIR="/var/db/pc-sysupdates/installed"
+IGNDIR="/var/db/pc-sysupdates/ignored"
+# Check if we have an update folder for the version we are on
+if [ ! -d "${AVAILDIR}/${SYSVER}" ] ; then mkdir -p ${AVAILDIR}/${SYSVER} ; fi
# Make the installed directory for this version
-if [ ! -d "${PROGDIR}/system-updates/installed/${SYSVER}" ]
-then
- mkdir -p ${PROGDIR}/system-updates/installed/${SYSVER}
-fi
-
+if [ ! -d "${INSDIR}/${SYSVER}" ] ; then mkdir -p ${INSDIR}/${SYSVER} ; fi
# Make the ignore directory for this version
-if [ ! -d "${PROGDIR}/system-updates/ignored/${SYSVER}" ]
-then
- mkdir -p ${PROGDIR}/system-updates/ignored/${SYSVER}
-fi
+if [ ! -d "${IGNDIR}/${SYSVER}" ] ; then mkdir -p ${IGNDIR}/${SYSVER} ; fi
# CD to the patch directory for this version
-cd ${PROGDIR}/system-updates/available/${SYSVER}
+cd ${AVAILDIR}/${SYSVER}
-
# Now check which updates are available, and start installing them
for i in `ls *.upd`
do
- if [ ! -e "${PROGDIR}/system-updates/installed/${SYSVER}/${i}" ]
+ if [ ! -e "${INSDIR}/${SYSVER}/${i}" ]
then
- if [ ! -e "${PROGDIR}/system-updates/ignored/${SYSVER}/${i}" ]
+ if [ ! -e "${IGNDIR}/${SYSVER}/${i}" ]
then
# Start downloading the patch
- UPDFILE="${PROGDIR}/system-updates/available/${SYSVER}/${i}"
+ UPDFILE="${AVAILDIR}/${SYSVER}/${i}"
# Set the URL based on file / mirror
@@ -85,7 +77,7 @@
sh update.sh
if [ "$?" = "0" ]
then
- cp $UPDFILE ${PROGDIR}/system-updates/installed/${SYSVER}/
+ cp $UPDFILE ${INSDIR}/${SYSVER}/
if [ "${PATCHREBOOT}" = "YES" ]
then
echo "REQUIRESREBOOT: ${PATCHNAME}" >${TRIGGERFILE}
@@ -103,7 +95,7 @@
sleep 4
fi
- cd ${PROGDIR}/system-updates/available/${SYSVER}
+ cd ${AVAILDIR}/${SYSVER}
rm -rf ${PATCHTMPDIR}
else
Modified: pcbsd/current/system-overlay/usr/PCBSD/SystemUpdater/bin/readSysUpdates.sh
===================================================================
--- pcbsd/current/system-overlay/usr/PCBSD/SystemUpdater/bin/readSysUpdates.sh 2010-10-25 18:39:33 UTC (rev 7896)
+++ pcbsd/current/system-overlay/usr/PCBSD/SystemUpdater/bin/readSysUpdates.sh 2010-10-25 19:49:41 UTC (rev 7897)
@@ -18,16 +18,21 @@
# Patch data location
PDATALOC="${2}"
+AVAILDIR="/var/db/pc-sysupdates/available"
+INSDIR="/var/db/pc-sysupdates/installed"
+IGNDIR="/var/db/pc-sysupdates/ignored"
+
# Check if we have an update folder for the version we are on
-if [ ! -d "${PROGDIR}/system-updates/available/${SYSVER}" ]
-then
- mkdir -p ${PROGDIR}/system-updates/available/${SYSVER}
-fi
+if [ ! -d "${AVAILDIR}/${SYSVER}" ] ; then mkdir -p ${AVAILDIR}/${SYSVER} ; fi
+# Make the installed directory for this version
+if [ ! -d "${INSDIR}/${SYSVER}" ] ; then mkdir -p ${INSDIR}/${SYSVER} ; fi
+# Make the ignore directory for this version
+if [ ! -d "${IGNDIR}/${SYSVER}" ] ; then mkdir -p ${IGNDIR}/${SYSVER} ; fi
# If we have new update-data file, extract it
if [ "${PDATALOC}" != "NONE" ]
then
- cd ${PROGDIR}/system-updates/available/${SYSVER}
+ cd ${AVAILDIR}/${SYSVER}
# Remove old .upd data files
rm *.upd
@@ -45,20 +50,8 @@
gpg --import ${PROGDIR}/conf/security.key >/dev/null 2>/dev/null
fi
-# Make the installed directory for this version
-if [ ! -d "${PROGDIR}/system-updates/installed/${SYSVER}" ]
-then
- mkdir -p ${PROGDIR}/system-updates/installed/${SYSVER}
-fi
-
-# Make the ignore directory for this version
-if [ ! -d "${PROGDIR}/system-updates/ignored/${SYSVER}" ]
-then
- mkdir -p ${PROGDIR}/system-updates/ignored/${SYSVER}
-fi
-
# CD to the patch directory for this version
-cd ${PROGDIR}/system-updates/available/${SYSVER}
+cd ${AVAILDIR}/${SYSVER}
# Setup our variable, we have no patches so far
PATCHFOUND="0"
@@ -69,14 +62,14 @@
# Now check which updates are available, and make a list of ones not installed
for i in `ls *.upd`
do
- if [ ! -e "${PROGDIR}/system-updates/installed/${SYSVER}/${i}" ]
+ if [ ! -e "${INSDIR}/${SYSVER}/${i}" ]
then
# Now lets check if this .upd file is valid via the .sig file
gpg --verify ${i}.sig >/dev/null 2>/dev/null
if [ "$?" = "0" ]
then
PATCHFOUND="`expr ${PATCHFOUND} + 1`"
- if [ -e "${PROGDIR}/system-updates/ignored/${SYSVER}/${i}" ]
+ if [ -e "${IGNDIR}/${SYSVER}/${i}" ]
then
echo "PATCHIGNORE: ${SYSVER}/${i}" >> /tmp/.pcbsdavailupdates
else
Modified: pcbsd/current/system-overlay/usr/PCBSD/SystemUpdater/bin/readSysUpdatesUser.sh
===================================================================
--- pcbsd/current/system-overlay/usr/PCBSD/SystemUpdater/bin/readSysUpdatesUser.sh 2010-10-25 18:39:33 UTC (rev 7896)
+++ pcbsd/current/system-overlay/usr/PCBSD/SystemUpdater/bin/readSysUpdatesUser.sh 2010-10-25 19:49:41 UTC (rev 7897)
@@ -43,10 +43,14 @@
# Setup our variable, we have no patches so far
PATCHFOUND="0"
+AVAILDIR="/var/db/pc-sysupdates/available"
+INSDIR="/var/db/pc-sysupdates/installed"
+IGNDIR="/var/db/pc-sysupdates/ignored"
+
# Now check which updates are available, and make a list of ones not installed
for i in `ls *.upd`
do
- if [ ! -e "${PROGDIR}/system-updates/installed/${SYSVER}/${i}" -a ! -e "${PROGDIR}/system-updates/ignored/${SYSVER}/${i}" ]
+ if [ ! -e "${INSDIR}/${SYSVER}/${i}" -a ! -e "${IGNDIR}/${SYSVER}/${i}" ]
then
# Now lets check if this .upd file is valid via the .sig file
gpg --verify ${i}.sig >/dev/null 2>/dev/null
More information about the Commits
mailing list