Changeset 5119a91


Ignore:
Timestamp:
Sep 27, 2013 12:44:15 PM (10 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2
Children:
ae23d60
Parents:
393790b (diff), eb70a80 (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:
3 added
7 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/life-preserver/LPTray.cpp

    r8c6a630 re0c368d  
    99  //Setup the context menu 
    1010  menu = new QMenu; 
    11         menu->addAction(new QAction(QIcon(":/images/application-exit.png"),tr("Close Life Preserver Tray"),this) ); 
    12         connect(menu, SIGNAL(triggered(QAction*)), this, SLOT(slotClose()) ); 
     11        menu->addAction(QIcon(":/images/backup-failed.png"),tr("View Messages"),this,SLOT(startMessageDialog()) ); 
     12        menu->addAction(QIcon(":/images/tray-icon-idle.png"),tr("Start Application UI"),this,SLOT(startGUI()) ); 
     13        menu->addSeparator(); 
     14        menu->addAction(QIcon(":/images/application-exit.png"),tr("Close Life Preserver Tray"),this,SLOT(slotClose()) ); 
    1315  this->setContextMenu(menu); 
    1416  //Setup initial icon for the tray 
     
    1618  //Create the configuration GUI 
    1719  GUI = new mainUI(); 
     20  msgdlg = new LPMessages(); 
    1821  //connect other signals/slots 
    1922  connect(this, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(slotTrayClicked(QSystemTrayIcon::ActivationReason)) ); 
     
    2730  watcher->stop(); 
    2831  delete watcher; 
     32  delete GUI; 
     33  delete msgdlg; 
    2934} 
    3035 
     
    137142    GUI->show(); 
    138143} 
     144 
     145void LPTray::startMessageDialog(){ 
     146  //Get all the available messages from the watcher 
     147  QStringList msgs, errs, logs; //message variables to fill 
     148  //Cycle through the watcher types and get any messages 
     149  QStringList types; types << "message" << "replication" << "critical" << "mirror" << "resilver" << "scrub"; 
     150  QStringList infoL; infoL << "id" << "timestamp" << "device" << "message" << "files"; 
     151  for(int i=0; i<types.length(); i++){ 
     152    QStringList info = watcher->getMessages(types[i], infoL); 
     153    if(info.isEmpty()){continue;} 
     154    if(info[0] == "ERROR"){ 
     155      errs << info[1] + " (" + info[2] + "): " + info[3]; 
     156    }else if(!info[0].isEmpty()){ 
     157      msgs << info[1] + " (" + info[2] + "): " + info[3]; 
     158    } 
     159    if(!info[4].isEmpty()){ 
     160      logs << info[4]; // In format:  "example logfile </var/logs/example.log>" 
     161    } 
     162  } 
     163  //Now start up the dialog 
     164  msgdlg->setMessages( msgs.join("\n") ); 
     165  msgdlg->setErrors( errs.join("\n") ); 
     166  msgdlg->setLogFiles(logs); 
     167  msgdlg->raise(); 
     168  msgdlg->show(); 
     169} 
  • src-qt4/life-preserver/LPTray.h

    re9760d0 re0c368d  
    99#include "mainUI.h" 
    1010#include "LPWatcher.h" 
     11#include "LPMessages.h" 
    1112 
    1213class LPTray : public QSystemTrayIcon{ 
     
    1819private: 
    1920        LPWatcher *watcher; 
     21        LPMessages *msgdlg; 
    2022        QMenu *menu; 
    2123        mainUI *GUI; 
    22  
    2324 
    2425        void updateTrayIcon(); 
     
    3233        void slotSingleInstance(); 
    3334        void startGUI(); 
     35        void startMessageDialog(); 
    3436 
    3537}; 
  • src-qt4/life-preserver/LPWatcher.cpp

    r565dbe4 re0c368d  
    1616    *4 = timestamp (full date/time timestamp in readable format) 
    1717    *5 = short timestamp (just time in readable format) 
     18    *6 = description and path of a log file (FORMAT: "example file </path/to/file.log>") 
    1819 
    1920  Valid Internal ID's: 
     
    101102    else if(msgList[i]=="timestamp" && LOGS.contains(base+4)){ output << LOGS[base+4]; } 
    102103    else if(msgList[i]=="time" && LOGS.contains(base+5)){ output << LOGS[base+5]; } 
     104    else if(msgList[i]=="files" && LOGS.contains(base+6)){ output << LOGS[base+6]; } 
    103105    else{ output << ""; } 
    104106  } 
     
    167169      LOGS.insert(24, timestamp); //full timestamp 
    168170      LOGS.insert(25, time); // time only 
     171      LOGS.insert(26,tr("Replication Log")+" <"+FILE_REPLICATION+">"); //log file 
    169172      if(!quiet){ emit MessageAvailable("replication"); } 
    170173    }else if(message.contains("finished replication")){ 
     
    177180      LOGS.insert(23, QString(tr("Finished replication for %1")).arg(dev) ); 
    178181      LOGS.insert(24, timestamp); //full timestamp 
    179       LOGS.insert(25, time); // time only       
     182      LOGS.insert(25, time); // time only 
     183      LOGS.insert(26, ""); //clear the log file entry 
    180184      if(!quiet){ emit MessageAvailable("replication"); } 
    181185    }else if( message.contains("failed replication") ){ 
     
    191195      LOGS.insert(24, timestamp); //full timestamp 
    192196      LOGS.insert(25, time); // time only       
     197      LOGS.insert(26, tr("Replication Error Log")+" <"+file+">" ); 
    193198      if(!quiet){ emit MessageAvailable("replication"); } 
    194199    } 
     
    313318    QString pool, state, timestamp; 
    314319    QStringList cDev, cStat, cMsg, cSummary; 
    315     //qDebug() << "-----zpool status------"; 
     320    qDebug() << "-----zpool status------\n" << zstat.join("\n"); 
    316321    bool newresilver = false; bool newscrub = false; bool newerror = false; 
    317322    for(int i=0; i<zstat.length(); i++){ 
  • src-qt4/life-preserver/life-preserver.pro

    r1b89eeb reb70a80  
    1111                LPContainers.h \ 
    1212                LPConfig.h \ 
    13                 LPWatcher.h 
     13                LPWatcher.h \ 
     14                LPMessages.h 
    1415                 
    1516SOURCES += main.cpp \ 
     
    1920                LPWizard.cpp \ 
    2021                LPConfig.cpp \ 
    21                 LPWatcher.cpp 
     22                LPWatcher.cpp \ 
     23                LPMessages.cpp 
    2224 
    2325RESOURCES += lPreserve.qrc 
     
    2527FORMS   = mainUI.ui \ 
    2628        LPWizard.ui \ 
    27         LPConfig.ui 
     29        LPConfig.ui \ 
     30        LPMessages.ui 
    2831 
    2932TARGET=life-preserver 
  • src-sh/pbi-manager10/install.sh

    r651bd28 r393790b  
    66if [ $verCheck -lt 1000000 ] ; then 
    77  # This version is for FreeBSD >= 10 
    8   exit 0 
     8  #exit 0 
    99fi 
    1010 
     
    5353do 
    5454  rm ${LB}/man/man1/${i}.gz >/dev/null 2>/dev/null 
    55   cp man1/${i} ${LB}/man/man1/${i} 
     55  gzip -c man1/${i} > ${LB}/man/man1/${i}.gz 
    5656done 
    5757 
     
    6060do 
    6161  rm ${LB}/man/man5/${i}.gz >/dev/null 2>/dev/null 
    62   cp man5/${i} ${LB}/man/man5/${i} 
     62  gzip -c man5/${i} > ${LB}/man/man5/${i}.gz 
    6363done 
    6464 
     
    6868do 
    6969  rm ${LB}/man/man8/${i}.gz >/dev/null 2>/dev/null 
    70   cp man8/${i} ${LB}/man/man8/${i} 
     70  gzip -c man8/${i} > ${LB}/man/man8/${i}.gz 
    7171done 
    7272 
     
    8383 
    8484# If this is a new install, add the PC-BSD master repo 
    85 if [ ! -d "/var/db/pbi/keys" ] ; then 
    86         pbi_addrepo ${DIR}/repo/pcbsd.rpo 
    87 fi 
     85#if [ ! -d "/var/db/pbi/keys" ] ; then 
     86#       pbi_addrepo ${DIR}/repo/pcbsd.rpo 
     87#fi 
    8888 
    8989# Copy the default PC-BSD repo file 
     
    9797cp ${DIR}/etc/pbi.conf ${LB}/etc/pbi.conf 
    9898 
    99 if [ ! -d "/usr/pbi" ] ; then mkdir /usr/pbi ; fi 
    100  
    10199# Create the wrapper binary 
    102100cd ${DIR}/wrapper 
     
    104102  # Build 32bit wrapper 
    105103  echo "Building i386 wrapper..." 
    106   rm .pbiwrapper >/dev/null 2>/dev/null 
     104  rm pbiwrapper >/dev/null 2>/dev/null 
    107105  make clean 
    108106  make DEFINES="-mtune=i386 -march=i386 -m32" 
    109107  make install 
    110   chown root:wheel /usr/pbi/.pbiwrapper  
    111   chmod 644 /usr/pbi/.pbiwrapper 
    112   mv /usr/pbi/.pbiwrapper ${LB}/share/pbi-manager/.pbiwrapper-i386 
     108  chown root:wheel pbiwrapper  
     109  chmod 644 pbiwrapper 
     110  mv pbiwrapper ${LB}/share/pbi-manager/.pbiwrapper-i386 
    113111else 
    114112  touch ${LB}/share/pbi-manager/.pbiwrapper-i386 
     
    119117DEFINES="" 
    120118export DEFINES 
    121 rm .pbiwrapper >/dev/null 2>/dev/null 
     119rm pbiwrapper >/dev/null 2>/dev/null 
    122120make clean 
    123121make DEFINES="" 
    124122make install DEFINES="" 
    125 chown root:wheel /usr/pbi/.pbiwrapper  
    126 chmod 644 /usr/pbi/.pbiwrapper 
    127 mv /usr/pbi/.pbiwrapper ${LB}/share/pbi-manager/.pbiwrapper-`uname -m` 
     123chown root:wheel pbiwrapper  
     124chmod 644 pbiwrapper 
     125mv pbiwrapper ${LB}/share/pbi-manager/.pbiwrapper-`uname -m` 
     126cp ldconfig ${LB}/share/pbi-manager/ldconfig-pbi 
  • src-sh/pbi-manager10/pbi-manager

    r52c32d9 r393790b  
    16581658        chroot_make_cleanup 
    16591659        clean_remote_dl 
     1660        umount_md_devices ${DEVICES} 
    16601661        exit 255 
    16611662} 
     
    35523553 
    35533554        if [ "`basename $0`" = "pbi_makeport" -o "`basename $0`" = "pbi_makeport_chroot" ] ; then 
    3554           PBI_STAGEDIR="/usr/local" 
     3555          #PBI_STAGEDIR="/usr/local" 
     3556          # KPM REMOVE ME 
     3557          mk_stage_dir "/usr/local" 
    35553558        else 
    35563559          mk_stage_dir 
     
    35713574        mk_hash_list 
    35723575 
    3573         mk_archive_file 
     3576        #mk_archive_file 
     3577        # KPM REMOVE ME 
    35743578 
    35753579        mk_header_dir 
    35763580        save_pbi_details_to_header 
    3577         mk_header_file 
    3578         rm_header_dir 
     3581        #mk_header_file 
     3582        # KPM REMOVE ME 
     3583        #rm_header_dir 
    35793584 
    35803585        mk_output_pbi 
    35813586 
    35823587        rm_stage_dir 
     3588        exit 0 
    35833589} 
    35843590 
     
    40484054# Create a dir for manipulating header info 
    40494055mk_header_dir() { 
    4050         PBI_HEADERDIR="${PBI_PROGDIRPATH}/.headerdir" 
     4056        PBI_HEADERDIR="${PBI_STAGEDIRMNT}/pbimeta" 
    40514057        if [ -e "${PBI_HEADERDIR}" ] ; then rm -rf "${PBI_HEADERDIR}" ; fi 
    40524058        mkdir -p ${PBI_HEADERDIR} 
     
    40614067# Create a dir for staging the final archive 
    40624068mk_stage_dir() { 
    4063         local _excOpts="" 
     4069        if [ -n "$1" ] ; then 
     4070                cpDir="$1" 
     4071        else 
     4072                cpDir="${PBI_PROGDIRPATH}" 
     4073        fi 
    40644074 
    40654075        PBI_STAGEDIR="${PBI_PROGDIRPATH}/.stagedir" 
     
    40714081        fi 
    40724082        mkdir -p ${PBI_STAGEDIR} 
     4083 
     4084        # Figure out disk size and set up a vnode 
     4085        export UFSFILE=/usr/pbi/pbi.ufs.$$ 
     4086        cd /usr/local 
     4087        DIRSIZE=$(($(du -kd 0 | cut -f 1))) 
     4088        FSSIZE=$(($DIRSIZE + 1000)) 
     4089        rc_halt "dd if=/dev/zero of=${UFSFILE} bs=1k count=${FSSIZE}" 
     4090 
     4091        export USRDEVICE=/dev/$(mdconfig -a -t vnode -f ${UFSFILE}) 
     4092 
     4093        rc_halt "newfs -b 4096 -n -o space ${USRDEVICE}" 
     4094        rc_halt "mount -o noatime ${USRDEVICE} ${PBI_STAGEDIR}" 
     4095 
     4096        mkdir -p ${PBI_STAGEDIR}/local 
     4097        mkdir -p ${PBI_STAGEDIR}/etc 
     4098        mkdir -p ${PBI_STAGEDIR}/pbimeta 
     4099 
     4100        local _excOpts="" 
    40734101 
    40744102        # Build module list of excludes 
     
    40884116                --exclude .pkgdb --exclude .ld-elf.hints --exclude make.conf \ 
    40894117                --exclude make.conf.bak --exclude .keepports \ 
    4090                 -C "${PBI_PROGDIRPATH}" . 2>/dev/null \ 
    4091                 | tar xvpf - -C ${PBI_STAGEDIR} 2>/dev/null 
    4092  
     4118                -C "${cpDir}" . 2>/dev/null \ 
     4119                | tar xvpf - -C ${PBI_STAGEDIR}/local 2>/dev/null 
     4120 
     4121        cd ${PBI_PROGDIRPATH} 
     4122        PBI_STAGEDIRMNT="${PBI_STAGEDIR}" 
     4123        PBI_STAGEDIR="${PBI_STAGEDIR}/local" 
    40934124} 
    40944125 
     
    41134144# See if we need to clean the stagedir 
    41144145clean_stage_dir() { 
     4146 
     4147        if [ -e "${PBI_STAGEDIR}/etc" ] ; then 
     4148                mv ${PBI_STAGEDIR}/etc/* ${PBI_STAGEDIRMNT}/etc/ 
     4149        fi 
     4150 
    41154151        if [ "${PBI_USESYSGL}" != "NO" ] ; then 
    41164152                rm ${PBI_STAGEDIR}/lib/libGl.* >/dev/null 2>/dev/null 
     
    42554291 
    42564292        # Save a checksum of archive file 
    4257         sha256 -q "${PBI_CREATE_ARCHIVE}" > "${PBI_HEADERDIR}/pbi_archivesum" 
     4293        #sha256 -q "${PBI_CREATE_ARCHIVE}" > "${PBI_HEADERDIR}/pbi_archivesum" 
     4294        # KPM REMOVE ME 
    42584295 
    42594296        sign_pbi_files "$PBI_HEADERDIR" 
     
    42734310} 
    42744311 
     4312# Unmount list of md devices 
     4313umount_md_devices() { 
     4314    for i in $@; do 
     4315        echo "Unmounting ${i}" 
     4316        rc_halt "umount -f ${i}" 
     4317        rc_halt "mdconfig -d -u ${i}" 
     4318    done 
     4319} 
    42754320 
    42764321# All the pieces are ready, spit out the final PBI file 
     
    42814326                icon="${PBI_DEFAULT_ICON_CHROOT}" 
    42824327        fi 
     4328 
     4329        # Set PBI name all lower-case 
    42834330        _pbilow="`echo ${PBI_PROGNAME} | tr '[:upper:]' '[:lower:]' | sed 's| ||g'`" 
    4284  
    42854331        outfile="${PBI_CREATE_OUTDIR}/${_pbilow}-${PBI_PROGVERSION}-${ARCH}.pbi" 
    4286         mark1="${PBI_CREATE_OUTDIR}/.pbimark1.$$" 
    4287         mark2="${PBI_CREATE_OUTDIR}/.pbimark2.$$" 
    4288  
    4289         echo " 
    4290 ${PBI_SS_ICON}" >$mark1 
    4291         echo " 
    4292 ${PBI_SS_ARCHIVE}" >$mark2 
     4332 
     4333        DEVICES=${USRDEVICE} 
     4334 
     4335        echo "Filling the uncompressed fs with zeros to compress better" 
     4336        echo "Don't worry if you see a 'filesystem full' message here" 
     4337        zerofile=$(env TMPDIR=${PBI_STAGEDIR} mktemp -t zero) 
     4338        dd if=/dev/zero of=${zerofile} >/dev/null 2>/dev/null 
     4339        rm ${zerofile} 
     4340 
     4341        umount_md_devices ${DEVICES} 
    42934342 
    42944343        # DO IT, DO IT NOW!!! 
    4295         cat ${PBI_HEADER_ARCHIVE} $mark1 ${icon} $mark2 ${PBI_CREATE_ARCHIVE} > ${outfile}       
     4344        echo -n "Compressing ${UFSFILE}..." 
     4345        rc_halt "mkuzip -v -s 65536 -o ${outfile} ${UFSFILE}" 
     4346 
     4347        UFSSIZE=$(ls -l ${UFSFILE} | awk '{print $5}') 
     4348        UZIPSIZE=$(ls -l ${outfile} | awk '{print $5}') 
     4349 
     4350        PERCENT=$(awk -v ufs=${UFSSIZE} -v uzip=${UZIPSIZE} 'BEGIN{print (100 - (100 * (uzip/ufs)));}') 
     4351        rm -f ${UFSFILE} 
     4352        echo " ${PERCENT}% saved" 
     4353 
    42964354        sha256 -q ${outfile} > ${outfile}.sha256 
    42974355 
    42984356        echo "Created PBI: ${outfile}" 
    4299  
    4300         rm $mark1 
    4301         rm $mark2 
    4302         rm ${PBI_HEADER_ARCHIVE} 
    4303         rm ${PBI_CREATE_ARCHIVE} 
    43044357} 
    43054358 
     
    66576710                        mv ${PBI_CHROOTDIR}/pbiout/*.pbi ${PBI_CREATE_OUTDIR}/  
    66586711                        mv ${PBI_CHROOTDIR}/pbiout/*.sha256 ${PBI_CREATE_OUTDIR}/ 
     6712                else 
     6713                        echo "Error: pbi_makeport_chroot: returned non-0 status!" 
    66596714                fi 
    66606715 
  • src-sh/pbi-manager10/wrapper/Makefile

    r6144235 r393790b  
    1515AR            = ar cqs 
    1616RANLIB        =  
    17 QMAKE         = /usr/local/bin/qmake-qt4 
    1817TAR           = tar -cf 
    1918COMPRESS      = gzip -9f 
     
    4140SOURCES       = main.c  
    4241OBJECTS       = main.o 
    43 MAKE_TARGET   = .pbiwrapper 
    44 DESTDIR       = /usr/pbi/ 
    45 TARGET        = .pbiwrapper 
     42MAKE_TARGET   = pbiwrapper 
     43TARGET        = pbiwrapper 
    4644 
    4745first: all 
     
    7068 
    7169$(TARGET):  $(OBJECTS)   
    72         @$(CHK_DIR_EXISTS) /usr/pbi/ || $(MKDIR) /usr/pbi/ 
    7370        $(CC) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) 
    7471 
     
    125122 
    126123install_scripts: first FORCE 
    127         -@$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/pbi || $(MKDIR) $(INSTALL_ROOT)/usr/pbi/ 
    128         -$(INSTALL_FILE) .pbiwrapper $(INSTALL_ROOT)/usr/pbi/.pbiwrapper 
    129         -$(INSTALL_FILE) ldconfig $(INSTALL_ROOT)/usr/pbi/.ldconfig 
    130124 
    131125install:   FORCE install_scripts 
Note: See TracChangeset for help on using the changeset viewer.