Changeset 6454d08


Ignore:
Timestamp:
12/09/14 09:16:26 (7 weeks ago)
Author:
Ken Moore <ken@…>
Branches:
master, releng/10.1.1
Children:
3c18969, e1b3a9e
Parents:
8eea9ee (diff), d84b9ba (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of github.com:pcbsd/pcbsd

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src-sh/pcbsd-utils/pc-updatemanager/pc-updatemanager

    r887cfab rd84b9ba  
    6464 
    6565ISOTMP="/usr/local/tmp/pcbsd-update.iso" 
     66 
     67# The default log file for output messages 
     68LOGOUT="/var/log/pc-updatemanager.log" 
    6669 
    6770###################################################################### 
     
    151154  # Now create standard pcbsd.conf file 
    152155  if [ "$PACKAGE_SET" = "CUSTOM" -a -n "$CUSTOM_URL" ] ; then 
     156     # Change %VERSION% / %ARCH% keys 
     157     CUSTOM_URL=`echo $CUSTOM_URL | sed "s|%VERSION%|$MAJORVER|g" | sed "s|%ARCH%|$ARCH|g"` 
    153158     cat << EOF >/usr/local/etc/pkg/repos/pcbsd.conf 
    154159pcbsd-major: { 
     
    163168     cat /usr/local/etc/pkg/repos/pcbsd.conf.dist \ 
    164169        | sed "s|pcbsd: |pcbsd-major: |g" \ 
     170        | sed "s|%VERSION%|$MAJORVER|g" \ 
     171        | sed "s|%ARCH%|$ARCH|g" \ 
    165172        | sed "s|VERSION|$MAJORVER|g" \ 
    166173        | sed "s|ARCH|$ARCH|g" > /usr/local/etc/pkg/repos/pcbsd.conf 
     
    677684  PKGUPGRADELOG="/tmp/.pkgUpdateLog.$$" 
    678685  PKGDLCACHE="/usr/local/pkg-cache" 
    679  
    680686} 
    681687 
     
    869875  mkdir /tmp/.updateRepo 
    870876 
    871   # Using PC-BSD CDN 
    872   cat /usr/local/etc/pkg/repos/pcbsd.conf.dist \ 
    873     | sed "s|pcbsd: |pcbsd-major: |g" \ 
    874     | sed "s|VERSION|$MAJORVER|g" \ 
    875     | sed "s|ARCH|$ARCH|g" > /tmp/.updateRepo/pkgUpdateRepo.conf 
     877  # Now create standard pcbsd.conf file 
     878  if [ "$PACKAGE_SET" = "CUSTOM" -a -n "$CUSTOM_URL" ] ; then 
     879     # Change %VERSION% / %ARCH% keys 
     880     CUSTOM_URL=`echo $CUSTOM_URL | sed "s|%VERSION%|$MAJORVER|g" | sed "s|%ARCH%|$ARCH|g"` 
     881     cat << EOF >/tmp/.updateRepo/pkgUpdateRepo.conf 
     882pcbsd-major: { 
     883               url: "$CUSTOM_URL", 
     884               signature_type: "fingerprints", 
     885               fingerprints: "/usr/local/etc/pkg/fingerprints/pcbsd", 
     886               enabled: true 
     887              } 
     888EOF 
     889  else 
     890    # Using PC-BSD CDN 
     891    cat /usr/local/etc/pkg/repos/pcbsd.conf.dist \ 
     892      | sed "s|pcbsd: |pcbsd-major: |g" \ 
     893      | sed "s|%VERSION%|$MAJORVER|g" \ 
     894      | sed "s|%ARCH%|$ARCH|g" \ 
     895      | sed "s|VERSION|$MAJORVER|g" \ 
     896      | sed "s|ARCH|$ARCH|g" > /tmp/.updateRepo/pkgUpdateRepo.conf 
     897  fi 
    876898 
    877899  # Set the new PKG_FLAG to use this repo config 
     
    12171239fi 
    12181240 
     1241echo "" > $LOGOUT 
     1242PIPEOUT="/tmp/.pc-up.pipe.$$" 
     1243mkfifo $PIPEOUT 
     1244(tee -a ${LOGOUT} < $PIPEOUT ; rm $PIPEOUT) & 
     1245TPID=$! 
     1246 
     1247 
    12191248while [ $# -gt 0 ] ; do 
    12201249 
     
    12261255                  do_fbsdcheck 
    12271256                  get_update_file 
    1228                   do_check ; break ;; 
     1257                  do_check >${PIPEOUT} 2>${PIPEOUT} 
     1258                  exit 0 
     1259                  break 
     1260                  ;; 
    12291261        branches) get_update_file 
    12301262                  list_branches ; break ;; 
    12311263        chbranch) get_update_file 
    1232                   do_branch "${2}" ; break ;; 
    1233         pkgcheck) checkup_pkgs ; break ;; 
     1264                  do_branch "${2}" >${PIPEOUT} 2>${PIPEOUT} 
     1265                  exit 0 
     1266                  break 
     1267                  ;; 
     1268        pkgcheck) checkup_pkgs >${PIPEOUT} 2>${PIPEOUT} 
     1269                  exit 0 
     1270                  break 
     1271                  ;; 
    12341272        syncconf) sync_pkgconf ; break ;; 
    12351273       confcheck) check_pkgconf ; break ;; 
    1236        pkgupdate) update_pkgs_only "$2" ; break ;; 
    1237       fbsdupdate) update_freebsd "$2" ; break ;; 
     1274       pkgupdate) update_pkgs_only "$2" >${PIPEOUT} 2>${PIPEOUT} 
     1275                  exit 0 
     1276                  break 
     1277                  ;; 
     1278      fbsdupdate) update_freebsd "$2" >${PIPEOUT} 2>${PIPEOUT} 
     1279                  exit 0 
     1280                  break 
     1281                  ;; 
    12381282         install) if [ -n "$INJAIL" ] ; then 
    12391283                     exit_err "Cannot run this inside a jail..." 
    12401284                  fi 
    12411285                  get_update_file 
    1242                   do_install "${2}" ; break ;; 
     1286                  do_install "${2}" >${PIPEOUT} 2>${PIPEOUT} 
     1287                  exit 0 
     1288                  break 
     1289                  ;; 
    12431290            cron) if [ -n "$INJAIL" ] ; then 
    12441291                     exit_err "Cannot run this inside a jail..." 
     
    12581305done 
    12591306 
     1307# If we got here, probably still have TPID waiting out there 
     1308rm ${PIPEOUT} 
     1309kill -9 $TPID 
     1310 
    12601311exit 0 
  • src-qt4/pc-systemupdatertray/TrayUI.cpp

    r56718fd r8eea9ee  
    1515  //Setup the checktimer 
    1616  chktime = new QTimer(this); 
    17         chktime->setInterval(1000 * 60 * 60 * 24); //every 24 hours 
    18         connect(chktime, SIGNAL(timeout()), this, SLOT(checkForUpdates()) ); 
     17        currentCheckInterval = settings->value("/PC-BSD/SystemUpdater/checkIntervalMin",360).toInt(); 
     18        chktime->setInterval(currentCheckInterval * 60000); //minutes->milliseconds 
     19        connect(chktime, SIGNAL(timeout()), this, SLOT(slotCheckTimer()) ); 
    1920  //Generate the Menu 
    2021  menu = new QMenu(0); 
     
    8283   
    8384  //Startup the initial checks in 1 minute 
    84   QTimer::singleShot(60000, this, SLOT(startupChecks())); 
     85  QTimer::singleShot(60000, this, SLOT(checkForUpdates())); 
    8586 
    8687  //Periodically check timer start 
    87   checkTimer=new QTimer(this); 
     88 /* checkTimer=new QTimer(this); 
    8889  checkTimer->setInterval(60000); // 1min 
    8990  connect(checkTimer, SIGNAL(timeout()), this, SLOT(slotCheckTimer())); 
    90   checkTimer->start(); 
     91  checkTimer->start();*/ 
    9192 
    9293} 
     
    131132 
    132133    currentCheckInterval = interval; 
    133     nextCheckTime = QTime::currentTime().addSecs(interval*60); 
     134    lastCheckTime = QTime::currentTime(); //temporary init value 
    134135} 
    135136 
     
    249250} 
    250251 
    251 void TrayUI::setCheckInterval(int sec) 
     252void TrayUI::setCheckInterval(int min) 
    252253{     
    253     if (!sec) 
    254     { 
    255         if (checkTimer->isActive()) 
    256         { 
    257             checkTimer->stop(); 
    258         } 
     254    if (min!=currentCheckInterval){ 
     255        settings->setValue("/PC-BSD/SystemUpdater/checkIntervalMin", min); 
    259256    } 
    260     else 
    261     { 
    262         nextCheckTime = QTime::currentTime().addSecs(sec); 
    263         if (!checkTimer->isActive()) 
    264         { 
    265             checkTimer->start(); 
    266         } 
    267     } 
    268  
    269     if (sec!=currentCheckInterval) 
    270         settings->setValue("/PC-BSD/SystemUpdater/checkIntervalMin", sec); 
    271     currentCheckInterval = sec; 
     257    currentCheckInterval = min; 
     258    //Reset the timer 
     259    if(chktime->isActive()){ chktime->stop(); } 
     260    chktime->setInterval(min*60000); 
     261    chktime->start(); 
    272262} 
    273263 
     
    282272    updateTrayIcon(); 
    283273    updateToolTip(); 
     274    lastCheckTime = QTime::currentTime(); 
    284275    //QTimer::singleShot(60000, watcher, SLOT(checkFlags()) ); //make sure to manually check 1 minute from now 
    285276} 
    286277 
    287 void TrayUI::startupChecks(){ 
     278/*void TrayUI::startupChecks(){ 
    288279  //Slot to perform startup checks as necessary 
    289280  // - This should make sure we don't re-check systems that were checked recently 
     
    293284  updateTrayIcon(); 
    294285  updateToolTip();   
     286  lastCheckTime = QTime::currentTime(); 
    295287  //QTimer::singleShot(60000, watcher, SLOT(checkFlags()) ); //make sure to manually check 1 minute from now 
    296 } 
     288}*/ 
    297289 
    298290void TrayUI::launchApp(QString app){ 
     
    321313void TrayUI::watcherMessage(SystemFlags::SYSFLAG flag, SystemFlags::SYSMESSAGE msg){ 
    322314  //reset the noInternet flag (prevent false positives, since something obviously just changed) 
     315  //qDebug() << "Watcher Message:" << flag << msg; 
    323316  bool oldstat = noInternet; 
    324317  if(flag != SystemFlags::NetRestart){ noInternet = false; } 
     
    405398void TrayUI::slotCheckTimer() 
    406399{     
    407     int secsTo = QTime::currentTime().secsTo(nextCheckTime); 
     400    int secsTo = QTime::currentTime().secsTo( lastCheckTime.addSecs(currentCheckInterval*60) ); 
    408401    //qDebug()<<secsTo; 
    409     if (secsTo <= 0) 
    410     { 
     402    if (secsTo <= 0){ 
    411403        //It is time to check updates 
    412         if ((PKGSTATUS == 3) || (PKGSTATUS==1) 
    413           ||(WARDENSTATUS == 3) || (WARDENSTATUS == 1) 
    414           ||(SYSSTATUS == 3) || (SYSSTATUS == 1)) 
    415         { 
    416             //if busy now check after a minute 
    417             nextCheckTime.addSecs(60); 
    418             return; 
    419         } 
    420404        qDebug()<<"Checking updates by schedule"; 
    421405        checkForUpdates(); 
    422         nextCheckTime = QTime::currentTime().addSecs(currentCheckInterval * 60); 
     406        //Reset the timer            
     407        if(chktime->isActive()){ chktime->stop(); } 
     408        chktime->setInterval(currentCheckInterval*60000); 
     409        chktime->start(); 
     410    }else{ 
     411        //Re-launch this function at the appropriate time 
     412        if(chktime->isActive()){ chktime->stop(); } 
     413        chktime->setInterval(secsTo*60000); 
     414        chktime->start(); 
    423415    } 
    424416} 
     
    426418void TrayUI::slotParsePeriodControls() 
    427419{ 
    428     int interval=0; 
     420    int interval=0; //minutes 
    429421    if (checkEveryHour->isChecked()) 
    430422        interval= 60; 
     
    434426        interval = 60 * 24; 
    435427    setCheckInterval(interval); 
    436 } 
     428    slotCheckTimer(); //Make sure we don't need to run a check now 
     429} 
  • src-qt4/pc-systemupdatertray/TrayUI.h

    r7964857 r8eea9ee  
    3737        bool wasworking; //internal status for determining when to show messages 
    3838 
    39     QTime  nextCheckTime; 
    40     QTimer* checkTimer; 
     39    QTime  lastCheckTime; 
     40    //QTimer* checkTimer; 
    4141    int currentCheckInterval; 
    4242 
     
    5757private slots: 
    5858        void checkForUpdates(); //simplification to start all checks 
    59         void startupChecks(); //initial checks after app startup 
     59        //void startupChecks(); //initial checks after app startup 
    6060        void launchApp(QString cmd = ""); //if empty it will launch the top-level app requiring attention 
    6161 
  • src-qt5/pc-systemupdatertray/TrayUI.cpp

    r3667cdb r8eea9ee  
    1515  //Setup the checktimer 
    1616  chktime = new QTimer(this); 
    17         chktime->setInterval(1000 * 60 * 60 * 24); //every 24 hours 
    18         connect(chktime, SIGNAL(timeout()), this, SLOT(checkForUpdates()) ); 
     17        currentCheckInterval = settings->value("/PC-BSD/SystemUpdater/checkIntervalMin",360).toInt(); 
     18        chktime->setInterval(currentCheckInterval * 60000); //minutes->milliseconds 
     19        connect(chktime, SIGNAL(timeout()), this, SLOT(slotCheckTimer()) ); 
    1920  //Generate the Menu 
    2021  menu = new QMenu(0); 
     
    8283   
    8384  //Startup the initial checks in 1 minute 
    84   QTimer::singleShot(60000, this, SLOT(startupChecks())); 
     85  QTimer::singleShot(60000, this, SLOT(checkForUpdates())); 
    8586 
    8687  //Periodically check timer start 
    87   checkTimer=new QTimer(this); 
     88 /* checkTimer=new QTimer(this); 
    8889  checkTimer->setInterval(60000); // 1min 
    8990  connect(checkTimer, SIGNAL(timeout()), this, SLOT(slotCheckTimer())); 
    90   checkTimer->start(); 
     91  checkTimer->start();*/ 
    9192 
    9293} 
     
    131132 
    132133    currentCheckInterval = interval; 
    133     nextCheckTime = QTime::currentTime().addSecs(interval*60); 
     134    lastCheckTime = QTime::currentTime(); //temporary init value 
    134135} 
    135136 
     
    249250} 
    250251 
    251 void TrayUI::setCheckInterval(int sec) 
     252void TrayUI::setCheckInterval(int min) 
    252253{     
    253     if (!sec) 
    254     { 
    255         if (checkTimer->isActive()) 
    256         { 
    257             checkTimer->stop(); 
    258         } 
     254    if (min!=currentCheckInterval){ 
     255        settings->setValue("/PC-BSD/SystemUpdater/checkIntervalMin", min); 
    259256    } 
    260     else 
    261     { 
    262         nextCheckTime = QTime::currentTime().addSecs(sec); 
    263         if (!checkTimer->isActive()) 
    264         { 
    265             checkTimer->start(); 
    266         } 
    267     } 
    268  
    269     if (sec!=currentCheckInterval) 
    270         settings->setValue("/PC-BSD/SystemUpdater/checkIntervalMin", sec); 
    271     currentCheckInterval = sec; 
     257    currentCheckInterval = min; 
     258    //Reset the timer 
     259    if(chktime->isActive()){ chktime->stop(); } 
     260    chktime->setInterval(min*60000); 
     261    chktime->start(); 
    272262} 
    273263 
     
    282272    updateTrayIcon(); 
    283273    updateToolTip(); 
     274    lastCheckTime = QTime::currentTime(); 
    284275    //QTimer::singleShot(60000, watcher, SLOT(checkFlags()) ); //make sure to manually check 1 minute from now 
    285276} 
    286277 
    287 void TrayUI::startupChecks(){ 
     278/*void TrayUI::startupChecks(){ 
    288279  //Slot to perform startup checks as necessary 
    289280  // - This should make sure we don't re-check systems that were checked recently 
     
    293284  updateTrayIcon(); 
    294285  updateToolTip();   
     286  lastCheckTime = QTime::currentTime(); 
    295287  //QTimer::singleShot(60000, watcher, SLOT(checkFlags()) ); //make sure to manually check 1 minute from now 
    296 } 
     288}*/ 
    297289 
    298290void TrayUI::launchApp(QString app){ 
     
    321313void TrayUI::watcherMessage(SystemFlags::SYSFLAG flag, SystemFlags::SYSMESSAGE msg){ 
    322314  //reset the noInternet flag (prevent false positives, since something obviously just changed) 
     315  //qDebug() << "Watcher Message:" << flag << msg; 
    323316  bool oldstat = noInternet; 
    324317  if(flag != SystemFlags::NetRestart){ noInternet = false; } 
     
    405398void TrayUI::slotCheckTimer() 
    406399{     
    407     int secsTo = QTime::currentTime().secsTo(nextCheckTime); 
     400    int secsTo = QTime::currentTime().secsTo( lastCheckTime.addSecs(currentCheckInterval*60) ); 
    408401    //qDebug()<<secsTo; 
    409     if (secsTo <= 0) 
    410     { 
     402    if (secsTo <= 0){ 
    411403        //It is time to check updates 
    412         if ((PKGSTATUS == 3) || (PKGSTATUS==1) 
    413           ||(WARDENSTATUS == 3) || (WARDENSTATUS == 1) 
    414           ||(SYSSTATUS == 3) || (SYSSTATUS == 1)) 
    415         { 
    416             //if busy now check after a minute 
    417             nextCheckTime.addSecs(60); 
    418             return; 
    419         } 
    420404        qDebug()<<"Checking updates by schedule"; 
    421405        checkForUpdates(); 
    422         nextCheckTime = QTime::currentTime().addSecs(currentCheckInterval * 60); 
     406        //Reset the timer            
     407        if(chktime->isActive()){ chktime->stop(); } 
     408        chktime->setInterval(currentCheckInterval*60000); 
     409        chktime->start(); 
     410    }else{ 
     411        //Re-launch this function at the appropriate time 
     412        if(chktime->isActive()){ chktime->stop(); } 
     413        chktime->setInterval(secsTo*60000); 
     414        chktime->start(); 
    423415    } 
    424416} 
     
    426418void TrayUI::slotParsePeriodControls() 
    427419{ 
    428     int interval=0; 
     420    int interval=0; //minutes 
    429421    if (checkEveryHour->isChecked()) 
    430422        interval= 60; 
     
    434426        interval = 60 * 24; 
    435427    setCheckInterval(interval); 
    436 } 
     428    slotCheckTimer(); //Make sure we don't need to run a check now 
     429} 
  • src-qt5/pc-systemupdatertray/TrayUI.h

    r3667cdb r8eea9ee  
    3737        bool wasworking; //internal status for determining when to show messages 
    3838 
    39     QTime  nextCheckTime; 
    40     QTimer* checkTimer; 
     39    QTime  lastCheckTime; 
     40    //QTimer* checkTimer; 
    4141    int currentCheckInterval; 
    4242 
     
    5757private slots: 
    5858        void checkForUpdates(); //simplification to start all checks 
    59         void startupChecks(); //initial checks after app startup 
     59        //void startupChecks(); //initial checks after app startup 
    6060        void launchApp(QString cmd = ""); //if empty it will launch the top-level app requiring attention 
    6161 
Note: See TracChangeset for help on using the changeset viewer.