Mantis - pkg_get
|
|||||||||||
Viewing Issue Advanced Details | |||||||||||
|
|||||||||||
ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: | ||||||
673 | other | feature | always | 2004-10-19 09:18 | 2009-03-01 03:12 | ||||||
|
|||||||||||
Reporter: | duncs | Platform: | |||||||||
Assigned To: | phil | OS: | |||||||||
Priority: | normal | OS Version: | |||||||||
Status: | resolved | Product Version: | |||||||||
Product Build: | Resolution: | fixed | |||||||||
Projection: | none | ||||||||||
ETA: | none | Fixed in Version: | |||||||||
|
|||||||||||
Summary: | 0000673: pkg-get doesnt cope with pkgask files yet | ||||||||||
Description: | pkg-get doesnt know how to use pkgask files. (i.e. pkgadd -r <pkgask> <pkg>). Patch provided in \"additional information\". Note: the patch requires the catalog file to include $6 as \"pkgask\" and will be used for a package name call <pkg>.pkgask[.gz] (whereas package is <pkg>.pkg[.gz]). Patch is against pkg-get version \"pkg-get SCCS rev 2.45\". Why do i need this? I use pkg-get against my own internal repository for distributing packages around a few hundred machines. A few of those packages need pkgask files to install correctly. Note also in my own package i drop in a verion of wget into /var/pkg-get/ to ensure there is always one available if it hasnt otherwise been installed on the machine. | ||||||||||
Steps To Reproduce: | |||||||||||
Additional Information: |
*** pkg-get.dist Mon Oct 18 17:27:19 2004 --- package/usr/local/bin/pkg-get Tue Oct 19 13:16:53 2004 *************** *** 128,134 **** --- 128,140 ---- #-nv means NO progress meter at all. You dont get the dots. # wget -nv --dot-style=mega --passive-ftp + # get pkgask file first - ignore any failures. Only want failures + # from getting the pkg file itself + if [[ -n \"$pkgask\" ]]; then + $WGET $PROXYFLAGS $WGETFLAGS ${graburl%.gz}ask.gz + fi $WGET $PROXYFLAGS $WGETFLAGS $graburl + } *************** *** 153,159 **** print \" \'-d|download\' just download the package, not install\" print \" \'-D|describe\' describe available packages, or search for one\" print \" \'-U|updatecatalog\' updates download site inventory\" ! print \" \'-f\' dont ask any questions: force default behaviour\" print \" Normally used with an override admin file\" print \" See /var/pkg-get/admin-fullauto\" --- 159,165 ---- print \" \'-d|download\' just download the package, not install\" print \" \'-D|describe\' describe available packages, or search for one\" print \" \'-U|updatecatalog\' updates download site inventory\" ! print \" \'-p|pkgask\' use a pkgask file if one is available\" print \" \'-f\' dont ask any questions: force default behaviour\" print \" Normally used with an override admin file\" print \" See /var/pkg-get/admin-fullauto\" *************** *** 821,827 **** if [[ \"$DIRECTORY\" != \"\" ]] ; then # no point in using upgrade: # can only be one pkgname in a dir. ! $progname install $DIRECTORY $dependpkg continue fi --- 827,837 ---- if [[ \"$DIRECTORY\" != \"\" ]] ; then # no point in using upgrade: # can only be one pkgname in a dir. ! PKGASK= ! if [[ -n \"$pkgask\" ]]; then ! PKGASK=\"pkgask\" ! fi ! $0 install $PKGASK $DIRECTORY $dependpkg continue fi *************** *** 916,921 **** --- 926,940 ---- mv -f $filename.tmp $filename fi + pkgaskname=`echo $filename | sed \'s/.pkg/.pkgask/\'` + if [[ -f ${pkgaskname} ]]; then + env LANG=C file ${pkgaskname} | grep \'compressed \' >/dev/null + if [[ $? -eq 0 ]] ; then + gzip -d -c ${pkgaskname} >${pkgaskname}.tmp + mv -f $pkgaskname.tmp ${pkgaskname} + fi + fi + pkgname=`nawk \'NR==2 {print $1;exit}\' $filename` if [[ $do_upgrade -eq 1 ]] ; then remove_sysv_pkg $pkgname *************** *** 937,943 **** fi fi ! pkgadd -d $filename $ADMINFLAG $pkgname status=$? if [[ $status -ne 0 ]] ; then print ERROR: could not add $pkgname. --- 956,974 ---- fi fi ! PKGASK= ! if [[ -n \"$pkgask\" ]]; then ! #ls -la ${pkgaskname}* ! if [[ -f ${pkgaskname} ]]; then ! PKGASK=\"-n -r ${pkgaskname}\" ! fi ! fi ! ! #echo mode=$mode ! #echo PKGASK=$PKGASK ! ! #echo test 1 pkgadd -d $filename $PKGASK $ADMINFLAG $pkgname ! pkgadd -d $filename $PKGASK $ADMINFLAG $pkgname status=$? if [[ $status -ne 0 ]] ; then print ERROR: could not add $pkgname. *************** *** 1184,1189 **** --- 1215,1223 ---- software=\"$1\" rem_rev=\"$2\" pkgname=\"$3\" + whocares=\"$4\" + whocares=\"$5\" + sftask=\"$6\" # gzip triggers this. if [[ \"$pkgname\" == \"\" ]] ; then *************** *** 1201,1208 **** if [[ \"$localrev\" == \"$rem_rev\" ]] ; then rem_rev=\"SAME\" fi # match with headers in show_installed ! printf \"%15s %25s %25s\\n\" \"$software\" \"$localrev\" \"$rem_rev\" } # This cross-references all known install packages that match --- 1235,1247 ---- if [[ \"$localrev\" == \"$rem_rev\" ]] ; then rem_rev=\"SAME\" fi + + if [[ -n \"$sftask\" ]]; then + sftask=\"yes\" + fi + # match with headers in show_installed ! printf \"%15s %22s %22s %8s\\n\" \"$software\" \"$localrev\" \"$rem_rev\" \"$sftask\" } # This cross-references all known install packages that match *************** *** 1211,1217 **** print \"# (From site $url )\" # match with output of compare_pkg ! printf \"%15s %25s %25s\\n\" \"software\" \"localrev\" \"remoterev\" if [[ \"$1\" = \"\" ]] ; then egrep -v \'^#\' $CATALOGFILE | while read line ; do --- 1250,1256 ---- print \"# (From site $url )\" # match with output of compare_pkg ! printf \"%15s %22s %22s %8s\\n\" \"software\" \"localrev\" \"remoterev\" \"pkgask\" if [[ \"$1\" = \"\" ]] ; then egrep -v \'^#\' $CATALOGFILE | while read line ; do *************** *** 1516,1525 **** return 0; fi if [[ do_upgrade -eq 0 ]] ; then # Dont bother to upgrade, just install and get out of here. ! pkgadd $ADMINFLAG -d $tmpdir $tmppkg return $?; fi --- 1555,1576 ---- return 0; fi + PKGASK= + if [[ -n \"$pkgask\" ]]; then + #ls -la ${pkgname}* + if [[ -f ${tmppkg}.pkgask ]];then + PKGASK=\"-r ${tmppkg}.pkgask\" + fi + fi if [[ do_upgrade -eq 0 ]] ; then # Dont bother to upgrade, just install and get out of here. ! ! # echo mode=$mode ! # echo PKGASK=$PKGASK ! ! # echo test 2 pkgadd $PKGASK $ADMINFLAG -d $tmpdir $tmppkg ! pkgadd $PKGASK $ADMINFLAG -d $tmpdir $tmppkg return $?; fi *************** *** 1535,1541 **** pkgrm $ADMINFLAG $f fi done ! pkgadd $ADMINFLAG -d $tmpdir $tmppkg } ############################################################################### --- 1586,1597 ---- pkgrm $ADMINFLAG $f fi done ! ! echo mode=$mode ! echo PKGASK=$PKGASK ! ! echo test 3 pkgadd $PKGASK $ADMINFLAG -d $tmpdir $tmppkg ! pkgadd $PKGASK $ADMINFLAG -d $tmpdir $tmppkg } ############################################################################### *************** *** 1572,1578 **** # We do the standard way first. # Then duplicate everything lower down, for longopts type args ! while getopts \"dDs:uUacirhvf\" mode_var ; do case $mode_var in d) mode=install --- 1628,1634 ---- # We do the standard way first. # Then duplicate everything lower down, for longopts type args ! while getopts \"dDs:puUacirhvf\" mode_var ; do case $mode_var in d) mode=install *************** *** 1606,1611 **** --- 1662,1670 ---- r) mode=remove ;; + p) + pkgask=true + ;; f) force=true ;; *************** *** 1665,1670 **** --- 1724,1733 ---- mode=remove shift ;; + pkgask|--pkgask) + pkgask=true + shift + ;; moo|--moo) mode=moo shift *************** *** 1713,1719 **** # HAVE wget available. Check for it. whence wget >/dev/null if [[ $? -ne 0 ]] ; then ! PATH=$PATH:/opt/csw/bin:/opt/sfw/bin:/usr/sfw/bin:/usr/local/bin fi whence wget >/dev/null || get_wget --- 1776,1782 ---- # HAVE wget available. Check for it. whence wget >/dev/null if [[ $? -ne 0 ]] ; then ! PATH=$PATH:/opt/csw/bin:/opt/sfw/bin:/usr/sfw/bin:/usr/local/bin:/var/pkg-get fi whence wget >/dev/null || get_wget |
||||||||||
Relationships |
| ||||||||||
Attached Files: | |||||||||||
|
|||||||||||
Issue History | |||||||||||
Date Modified | Username | Field | Change | ||||||||
2009-03-01 03:08 | phil | Note Added: 0005595 | |||||||||
2009-03-01 03:09 | phil | Status | assigned => resolved | ||||||||
2009-03-01 03:09 | phil | Resolution | open => fixed | ||||||||
2009-03-01 03:10 | phil | Note Added: 0005596 | |||||||||
2009-03-01 03:12 | phil | Note Added: 0005597 |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|