Changeset 1793fe1


Ignore:
Timestamp:
09/28/13 23:42:50 (14 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3, releng/10.1
Children:
3b0aba7
Parents:
ae23d60
Message:

Update pbi-manager10, stick with lzma tar archiving for now, will
revisit uzip down the road.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-sh/pbi-manager10/pbi-manager

    r393790b r1793fe1  
    16581658        chroot_make_cleanup 
    16591659        clean_remote_dl 
    1660         umount_md_devices ${DEVICES} 
    16611660        exit 255 
    16621661} 
     
    35743573        mk_hash_list 
    35753574 
    3576         #mk_archive_file 
    3577         # KPM REMOVE ME 
     3575        mk_archive_file 
    35783576 
    35793577        mk_header_dir 
    35803578        save_pbi_details_to_header 
    3581         #mk_header_file 
    3582         # KPM REMOVE ME 
    3583         #rm_header_dir 
     3579        mk_header_file 
     3580        rm_header_dir 
    35843581 
    35853582        mk_output_pbi 
     
    40824079        mkdir -p ${PBI_STAGEDIR} 
    40834080 
    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  
    40964081        mkdir -p ${PBI_STAGEDIR}/local 
    40974082        mkdir -p ${PBI_STAGEDIR}/etc 
    40984083        mkdir -p ${PBI_STAGEDIR}/pbimeta 
     4084        mkdir -p ${PBI_STAGEDIR}/virtbase 
    40994085 
    41004086        local _excOpts="" 
     
    42914277 
    42924278        # Save a checksum of archive file 
    4293         #sha256 -q "${PBI_CREATE_ARCHIVE}" > "${PBI_HEADERDIR}/pbi_archivesum" 
    4294         # KPM REMOVE ME 
     4279        sha256 -q "${PBI_CREATE_ARCHIVE}" > "${PBI_HEADERDIR}/pbi_archivesum" 
    42954280 
    42964281        sign_pbi_files "$PBI_HEADERDIR" 
     
    43104295} 
    43114296 
    4312 # Unmount list of md devices 
    4313 umount_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 } 
    4320  
    43214297# All the pieces are ready, spit out the final PBI file 
    43224298mk_output_pbi() { 
     
    43314307        outfile="${PBI_CREATE_OUTDIR}/${_pbilow}-${PBI_PROGVERSION}-${ARCH}.pbi" 
    43324308 
    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} 
     4309        mark1="${PBI_CREATE_OUTDIR}/.pbimark1.$$" 
     4310        mark2="${PBI_CREATE_OUTDIR}/.pbimark2.$$" 
     4311        echo " 
     4312${PBI_SS_ICON}" >$mark1 
     4313        echo " 
     4314${PBI_SS_ARCHIVE}" >$mark2 
     4315 
    43424316 
    43434317        # DO IT, DO IT NOW!!! 
    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  
     4318        cat ${PBI_HEADER_ARCHIVE} $mark1 ${icon} $mark2 ${PBI_CREATE_ARCHIVE} > ${outfile} 
    43544319        sha256 -q ${outfile} > ${outfile}.sha256 
    43554320 
    43564321        echo "Created PBI: ${outfile}" 
     4322 
     4323        rm $mark1 
     4324        rm $mark2 
     4325        rm ${PBI_HEADER_ARCHIVE} 
     4326        rm ${PBI_CREATE_ARCHIVE} 
    43574327} 
    43584328 
     
    67536723 
    67546724        # Prune any proto / build specific ports 
    6755         start_pbi_prune_ports 
     6725        if [ -z "$PBI_PKGNGBUILD" ] ; then 
     6726                start_pbi_prune_ports 
     6727        fi 
    67566728 
    67576729        # See if we need to run a post make script 
     
    74027374  if [ $? -eq 0 ] ; then return ; fi 
    74037375 
     7376  # Are we doing a PKGNG build? 
     7377  if [ -n "$PBI_PKGNGBUILD" ] ; then 
     7378        pkg install -y "$_lPortRaw" 
     7379        if [ $? -ne 0 ] ; then 
     7380           exit_err "Failed installing $_lPortRaw" 
     7381        fi 
     7382        return 0 
     7383  fi 
     7384 
     7385  # Lets do old-fashioned build 
     7386 
     7387  # KPM! ##############  
     7388  # We will need to revisit this portion later, see if we can 
     7389  # grab the user / group list from pkgng installed packages 
     7390 
    74047391  # Save any users / groups we need to create later 
    74057392  local pUsers="`make -V USERS -C $_lPort PORTSDIR=${PORTSDIR}`" 
     
    74277414  done 
    74287415 
    7429   # Are we doing a PKGNG build? 
    7430   if [ "$PBI_PKGNGBUILD" ] ; then 
    7431         pkg install -y "$_lPortRaw" 
    7432         if [ $? -ne 0 ] ; then 
    7433            exit_err "Failed installing $_lPortRaw" 
    7434         fi 
    7435         return 0 
    7436   fi 
    7437  
    7438   # Lets do old-fashioned build 
    74397416  echo "Compiling port: ${_lPort}" 
    74407417  cd ${_lPort} 
Note: See TracChangeset for help on using the changeset viewer.