Lines 125-138
Link Here
|
125 |
: ${PACKAGEROOT="ftp://ftp.NetBSD.org"} |
125 |
: ${PACKAGEROOT="ftp://ftp.NetBSD.org"} |
126 |
: ${PKG_SUFX=".tgz"} |
126 |
: ${PKG_SUFX=".tgz"} |
127 |
#else |
127 |
#else |
|
|
128 |
: ${use_pkgng="`/usr/bin/make -f/usr/share/mk/bsd.port.mk -V WITH_PKGNG`"} |
129 |
if [ "x${use_pkgng}" = "xdevel" ]; then |
130 |
use_pkgng="yes" |
131 |
fi |
128 |
: ${PORTSDIR="/usr/ports"} |
132 |
: ${PORTSDIR="/usr/ports"} |
|
|
133 |
if is_yes ${use_pkgng}; then |
134 |
: ${PKGREPOSITORY="/var/cache/pkg/All"} |
135 |
else |
129 |
: ${PKGREPOSITORY="${PORTSDIR}/packages/All"} |
136 |
: ${PKGREPOSITORY="${PORTSDIR}/packages/All"} |
|
|
137 |
fi |
130 |
#ifdef WITH_OPENBSD |
138 |
#ifdef WITH_OPENBSD |
131 |
: ${PACKAGEROOT="ftp://ftp.OpenBSD.org"} |
139 |
: ${PACKAGEROOT="ftp://ftp.OpenBSD.org"} |
132 |
: ${PKG_SUFX=".tgz"} |
140 |
: ${PKG_SUFX=".tgz"} |
133 |
#else |
141 |
#else |
|
|
142 |
if is_yes ${use_pkgng}; then |
143 |
: ${PACKAGEROOT="http://pkgbeta.FreeBSD.org"} |
144 |
: ${PKG_SUFX=".txz"} |
145 |
else |
134 |
: ${PACKAGEROOT="ftp://ftp.FreeBSD.org"} |
146 |
: ${PACKAGEROOT="ftp://ftp.FreeBSD.org"} |
135 |
: ${PKG_SUFX=".tbz"} |
147 |
: ${PKG_SUFX=".tbz"} |
|
|
148 |
fi |
136 |
#endif |
149 |
#endif |
137 |
#endif |
150 |
#endif |
138 |
: ${PKG_BACKUP_DIR=${PKGREPOSITORY}} |
151 |
: ${PKG_BACKUP_DIR=${PKGREPOSITORY}} |
Lines 152-161
Link Here
|
152 |
} |
165 |
} |
153 |
|
166 |
|
154 |
init_pkgtools() { |
167 |
init_pkgtools() { |
|
|
168 |
if is_yes ${use_pkgng}; then |
169 |
PKG_ADD="pkg add" |
170 |
PKG_CREATE="pkg create" |
171 |
PKG_DELETE="pkg delete" |
172 |
PKG_INFO="pkg info" |
173 |
PKG_SET="pkg set" |
174 |
else |
155 |
PKG_ADD="pkg_add" |
175 |
PKG_ADD="pkg_add" |
156 |
PKG_CREATE="pkg_create" |
176 |
PKG_CREATE="pkg_create" |
157 |
PKG_DELETE="pkg_delete" |
177 |
PKG_DELETE="pkg_delete" |
158 |
PKG_INFO="pkg_info" |
178 |
PKG_INFO="pkg_info" |
|
|
179 |
fi |
159 |
MAKE="@MAKE@" |
180 |
MAKE="@MAKE@" |
160 |
} |
181 |
} |
161 |
|
182 |
|
Lines 213-219
Link Here
|
213 |
expand_path 'file' "${p##*=}" |
234 |
expand_path 'file' "${p##*=}" |
214 |
file_exist "${file}" || continue |
235 |
file_exist "${file}" || continue |
215 |
p=${p%=*} ;; |
236 |
p=${p%=*} ;; |
216 |
*.t[bg]z) |
237 |
*.t[bgx]z) |
217 |
expand_path 'file' "$p" |
238 |
expand_path 'file' "$p" |
218 |
get_pkgname_for_binary 'p' "${file}" || continue |
239 |
get_pkgname_for_binary 'p' "${file}" || continue |
219 |
p=${p%-*} ;; |
240 |
p=${p%-*} ;; |
Lines 423-428
Link Here
|
423 |
file_exist "$2" || return 1 |
444 |
file_exist "$2" || return 1 |
424 |
|
445 |
|
425 |
case $2 in |
446 |
case $2 in |
|
|
447 |
*.txz) _opt=J ;; |
426 |
*.tbz) _opt=j ;; |
448 |
*.tbz) _opt=j ;; |
427 |
*.tgz) _opt=z ;; |
449 |
*.tgz) _opt=z ;; |
428 |
*) return 1 ;; |
450 |
*) return 1 ;; |
Lines 434-439
Link Here
|
434 |
#ifdef WITH_OPENBSD |
456 |
#ifdef WITH_OPENBSD |
435 |
X=`@TAR@ x${_opt}f "$2" -O "+CONTENTS" | |
457 |
X=`@TAR@ x${_opt}f "$2" -O "+CONTENTS" | |
436 |
#else |
458 |
#else |
|
|
459 |
is_yes ${use_pkgng} && X=`${PKG_INFO} -F "$2"` || |
437 |
X=`@TAR@ x${_opt}f "$2" -O --fast-read "+CONTENTS" | |
460 |
X=`@TAR@ x${_opt}f "$2" -O --fast-read "+CONTENTS" | |
438 |
#endif |
461 |
#endif |
439 |
#endif |
462 |
#endif |
Lines 467-472
Link Here
|
467 |
done < "${PKG_DBDIR}/$2/+BUILD_INFO" |
490 |
done < "${PKG_DBDIR}/$2/+BUILD_INFO" |
468 |
fi |
491 |
fi |
469 |
#else |
492 |
#else |
|
|
493 |
if is_yes ${use_pkgng}; then |
494 |
X=`${PKG_INFO} -qo $2` |
495 |
eval $1=\$X |
496 |
return 0 |
497 |
fi |
470 |
if [ -r "${PKG_DBDIR}/$2/+CONTENTS" ]; then |
498 |
if [ -r "${PKG_DBDIR}/$2/+CONTENTS" ]; then |
471 |
while read X; do |
499 |
while read X; do |
472 |
case $X in |
500 |
case $X in |
Lines 488-494
Link Here
|
488 |
} |
516 |
} |
489 |
|
517 |
|
490 |
set_pkg_vars() { |
518 |
set_pkg_vars() { |
|
|
519 |
if is_yes ${use_pkgng}; then |
520 |
${PKG_INFO} -e $1 || return 1 |
521 |
else |
491 |
[ -d "${PKG_DBDIR}/$1" ] || return 1 |
522 |
[ -d "${PKG_DBDIR}/$1" ] || return 1 |
|
|
523 |
fi |
492 |
|
524 |
|
493 |
pkg_name=$1 |
525 |
pkg_name=$1 |
494 |
pkg_pkgdir=${PKG_DBDIR}/$1 |
526 |
pkg_pkgdir=${PKG_DBDIR}/$1 |
Lines 526-535
Link Here
|
526 |
|
558 |
|
527 |
for _arg in ${1+"$@"}; do |
559 |
for _arg in ${1+"$@"}; do |
528 |
_pattern=${_arg#${PKG_DBDIR}/} |
560 |
_pattern=${_arg#${PKG_DBDIR}/} |
|
|
561 |
if is_yes ${use_pkgng}; then |
562 |
for p in `${PKG_INFO} -g "${_pattern}" 2>/dev/null`; do |
563 |
if is_yes ${opt_depends}; then |
564 |
pkg_depends '_deps' "$p" |
565 |
eval ${_var}=\"\$${_var} \${_deps}\" |
566 |
fi |
567 |
|
568 |
eval ${_var}=\"\$${_var} \$p\" |
529 |
|
569 |
|
|
|
570 |
if is_yes ${opt_required_by}; then |
571 |
pkg_required_by '_req_by' "$p" |
572 |
eval ${_var}=\"\$${_var} \${_req_by}\" |
573 |
fi |
574 |
done |
575 |
if [ -z "${pkgs}" ]; then |
576 |
warn "No such installed package: ${_arg}" |
577 |
fi |
578 |
else |
530 |
case ${_pattern} in |
579 |
case ${_pattern} in |
531 |
*\**|*-pl[0-9]*|*-[0-9]*[0-9.][a-z]|*-[0-9]*[0-9]) ;; |
580 |
*\**|*-[0-9]*|*-[brv.][0-9]*|*-a.[0-9]*|*-pl[0-9]*|*-b.r[0-9]*|*-cr.[a-z]*) ;; |
532 |
*) _pattern="${_pattern}-[0-9]*[0-9a-z]" ;; |
581 |
*) _pattern="${_pattern}-[0-9]*[0-9a-zA-Z]" ;; |
533 |
esac |
582 |
esac |
534 |
|
583 |
|
535 |
for p in ${PKG_DBDIR}/${_pattern}/+CONTENTS; do |
584 |
for p in ${PKG_DBDIR}/${_pattern}/+CONTENTS; do |
Lines 552-557
Link Here
|
552 |
warn "No such installed package: ${_arg}" |
601 |
warn "No such installed package: ${_arg}" |
553 |
fi |
602 |
fi |
554 |
done |
603 |
done |
|
|
604 |
fi |
555 |
done |
605 |
done |
556 |
|
606 |
|
557 |
set -f |
607 |
set -f |
Lines 568-573
Link Here
|
568 |
done < "${PKG_DBDIR}/$2/+REQUIRING" |
618 |
done < "${PKG_DBDIR}/$2/+REQUIRING" |
569 |
fi |
619 |
fi |
570 |
#else |
620 |
#else |
|
|
621 |
if is_yes ${use_pkgng}; then |
622 |
X=`${PKG_INFO} -qd $2` |
623 |
eval $1=\"\${X}\" |
624 |
return 0 |
625 |
fi |
626 |
|
571 |
if [ -r "${PKG_DBDIR}/$2/+CONTENTS" ]; then |
627 |
if [ -r "${PKG_DBDIR}/$2/+CONTENTS" ]; then |
572 |
while read X; do |
628 |
while read X; do |
573 |
case $X in |
629 |
case $X in |
Lines 588-593
Link Here
|
588 |
pkg_required_by() { |
644 |
pkg_required_by() { |
589 |
local X |
645 |
local X |
590 |
|
646 |
|
|
|
647 |
if is_yes ${use_pkgng}; then |
648 |
X=`${PKG_INFO} -qr $2` |
649 |
eval $1=\"\$X\" |
650 |
return 0 |
651 |
fi |
652 |
|
591 |
eval $1= |
653 |
eval $1= |
592 |
if [ -r "${PKG_DBDIR}/$2/+REQUIRED_BY" ]; then |
654 |
if [ -r "${PKG_DBDIR}/$2/+REQUIRED_BY" ]; then |
593 |
while read X; do |
655 |
while read X; do |
Lines 597-603
Link Here
|
597 |
} |
659 |
} |
598 |
|
660 |
|
599 |
pkg_sort() { |
661 |
pkg_sort() { |
600 |
local p _var _sorted _unsorted _arg _deps |
662 |
local p _var _sorted _unsorted _arg _deps _deplist |
601 |
|
663 |
|
602 |
_var=$1; shift |
664 |
_var=$1; shift |
603 |
_sorted= |
665 |
_sorted= |
Lines 612-618
Link Here
|
612 |
*" ${_arg} "*) continue ;; |
674 |
*" ${_arg} "*) continue ;; |
613 |
esac |
675 |
esac |
614 |
|
676 |
|
615 |
if [ -s "${PKG_DBDIR}/${_arg}/+REQUIRED_BY" ]; then |
677 |
_deplist= |
|
|
678 |
if is_yes ${use_pkgng}; then |
679 |
_deplist=`${PKG_INFO} -qr ${_arg}` |
680 |
else |
681 |
_deplist="${PKG_DBDIR}/${_arg}/+REQUIRED_BY" |
682 |
fi |
683 |
if [ -s "${_deplist}" ]; then |
616 |
pkg_depends '_deps' "${_arg}" |
684 |
pkg_depends '_deps' "${_arg}" |
617 |
|
685 |
|
618 |
for p in ${_deps}; do |
686 |
for p in ${_deps}; do |
Lines 757-765
Link Here
|
757 |
info "Installing '$1'" |
825 |
info "Installing '$1'" |
758 |
|
826 |
|
759 |
case $1 in |
827 |
case $1 in |
760 |
*.t[bg]z) |
828 |
*.t[bgx]z) |
761 |
is_yes ${opt_force} && install_args="-f" |
829 |
is_yes ${opt_force} && install_args="-f" |
|
|
830 |
if ! is_yes ${use_pkgng}; then |
762 |
is_yes ${opt_verbose} && install_args="${install_args} -v" |
831 |
is_yes ${opt_verbose} && install_args="${install_args} -v" |
|
|
832 |
fi |
763 |
|
833 |
|
764 |
xtry "${2-}" ${PKG_ADD} ${install_args} "$1" || return 1 |
834 |
xtry "${2-}" ${PKG_ADD} ${install_args} "$1" || return 1 |
765 |
;; |
835 |
;; |
Lines 795-801
Link Here
|
795 |
|
865 |
|
796 |
deinstall_args= |
866 |
deinstall_args= |
797 |
is_yes ${opt_force} && deinstall_args="-f" |
867 |
is_yes ${opt_force} && deinstall_args="-f" |
|
|
868 |
if is_yes ${use_pkgng}; then |
869 |
deinstall_args="${deinstall_args} -y" |
870 |
else |
798 |
is_yes ${opt_verbose} && deinstall_args="${deinstall_args} -v" |
871 |
is_yes ${opt_verbose} && deinstall_args="${deinstall_args} -v" |
|
|
872 |
fi |
799 |
|
873 |
|
800 |
#ifdef WITH_PKGSRC |
874 |
#ifdef WITH_PKGSRC |
801 |
if [ -e "${PKG_DBDIR}/$1/+PRESERVE" ]; then |
875 |
if [ -e "${PKG_DBDIR}/$1/+PRESERVE" ]; then |
Lines 915-921
Link Here
|
915 |
*) subdir="${OS_MAJOR}-stable" ;; |
989 |
*) subdir="${OS_MAJOR}-stable" ;; |
916 |
esac |
990 |
esac |
917 |
|
991 |
|
|
|
992 |
if is_yes ${use_pkgng}; then |
993 |
uri_path=/freebsd-${OS_MAJOR}-${ARCH}/latest/All/ |
994 |
else |
918 |
uri_path="/pub/FreeBSD/ports/${ARCH}/packages-${subdir}/All/" |
995 |
uri_path="/pub/FreeBSD/ports/${ARCH}/packages-${subdir}/All/" |
|
|
996 |
fi |
919 |
#endif |
997 |
#endif |
920 |
#endif |
998 |
#endif |
921 |
uri="${PACKAGEROOT}${uri_path}${pkg}" |
999 |
uri="${PACKAGEROOT}${uri_path}${pkg}" |
Lines 987-993
Link Here
|
987 |
return 1 |
1065 |
return 1 |
988 |
fi |
1066 |
fi |
989 |
#else |
1067 |
#else |
|
|
1068 |
if is_yes ${use_pkgng}; then |
1069 |
try ${PKG_CREATE} -f ${PKG_SUFX} -o "${2%/*}" "$1" || return 1 |
1070 |
else |
990 |
try ${PKG_CREATE} -b "$1" "$2" || return 1 |
1071 |
try ${PKG_CREATE} -b "$1" "$2" || return 1 |
|
|
1072 |
fi |
991 |
#endif |
1073 |
#endif |
992 |
#endif |
1074 |
#endif |
993 |
} |
1075 |
} |
Lines 1031-1042
Link Here
|
1031 |
} |
1113 |
} |
1032 |
|
1114 |
|
1033 |
preserve_libs() { |
1115 |
preserve_libs() { |
1034 |
local file |
1116 |
local file pkg_info_opts |
1035 |
|
1117 |
|
1036 |
is_yes ${opt_preserve_libs} || return 0 |
1118 |
is_yes ${opt_preserve_libs} || return 0 |
1037 |
|
1119 |
|
|
|
1120 |
if is_yes ${use_pkgng}; then |
1121 |
pkg_info_opts='-ql' |
1122 |
else |
1123 |
pkg_info_opts='-qL' |
1124 |
fi |
1038 |
preserved_files= |
1125 |
preserved_files= |
1039 |
for file in $(${PKG_INFO} -qL "$1"); do |
1126 |
for file in $(${PKG_INFO} ${pkg_info_opts} "$1"); do |
1040 |
case ${file##*/} in |
1127 |
case ${file##*/} in |
1041 |
lib*.so.[0-9]*) |
1128 |
lib*.so.[0-9]*) |
1042 |
if [ -f "${file}" ]; then |
1129 |
if [ -f "${file}" ]; then |
Lines 1080-1099
Link Here
|
1080 |
fix_dependencies() { |
1167 |
fix_dependencies() { |
1081 |
#ifndef WITH_PKGSRC |
1168 |
#ifndef WITH_PKGSRC |
1082 |
#ifndef WITH_OPENBSD |
1169 |
#ifndef WITH_OPENBSD |
1083 |
local p deps newdep opt_depends opt_required_by |
1170 |
local p deps newdep opt_depends opt_required_by dep_installed |
1084 |
|
1171 |
|
1085 |
opt_depends=NO |
1172 |
opt_depends=NO |
1086 |
opt_required_by=NO |
1173 |
opt_required_by=NO |
1087 |
pkg_depends 'deps' "$1" |
1174 |
pkg_depends 'deps' "$1" |
1088 |
|
1175 |
|
1089 |
for p in ${deps}; do |
1176 |
for p in ${deps}; do |
1090 |
if [ ! -d "${PKG_DBDIR}/$p" ]; then |
1177 |
dep_installed=no |
|
|
1178 |
if is_yes ${use_pkgng}; then |
1179 |
${PKG_INFO} -e $p && dep_installed=yes || dep_installed=no |
1180 |
else |
1181 |
[ -d "${PKG_DBDIR}/$p" ] && dep_installed=yes || dep_installed=no |
1182 |
fi |
1183 |
if ! is_yes ${dep_installed}; then |
1091 |
pkg_glob 'newdep' "${p%-*}" 2>/dev/null |
1184 |
pkg_glob 'newdep' "${p%-*}" 2>/dev/null |
1092 |
|
1185 |
|
1093 |
if empty ${newdep}; then |
1186 |
if empty ${newdep}; then |
1094 |
warn "'$1' depends on '$p', but it is NOT installed!" |
1187 |
warn "'$1' depends on '$p', but it is NOT installed!" |
1095 |
else |
1188 |
else |
|
|
1189 |
if is_yes ${use_pkgng}; then |
1190 |
${PKG_SET} -y -o `${PKG_INFO} -qo $1`:`${PKG_INFO} -qo $p` || return 1 |
1191 |
else |
1096 |
update_pkgdep "$1" "$p" "${newdep##* }" || return 1 |
1192 |
update_pkgdep "$1" "$p" "${newdep##* }" || return 1 |
|
|
1193 |
fi |
1097 |
fi |
1194 |
fi |
1098 |
fi |
1195 |
fi |
1099 |
done |
1196 |
done |
Lines 1102-1107
Link Here
|
1102 |
} |
1199 |
} |
1103 |
|
1200 |
|
1104 |
update_dependencies() { |
1201 |
update_dependencies() { |
|
|
1202 |
if is_yes ${use_pkgng}; then |
1203 |
info "Updating the dependencies" |
1204 |
${PKG_SET} -y -o $1:$2 || return 1 |
1205 |
info " $1 -> $2" |
1206 |
else |
1105 |
local p req_by |
1207 |
local p req_by |
1106 |
|
1208 |
|
1107 |
pkg_required_by 'req_by' "$2" |
1209 |
pkg_required_by 'req_by' "$2" |
Lines 1114-1119
Link Here
|
1114 |
update_pkgdep "$p" "$1-[^-]*" "$2" || return 1 |
1216 |
update_pkgdep "$p" "$1-[^-]*" "$2" || return 1 |
1115 |
done |
1217 |
done |
1116 |
fi |
1218 |
fi |
|
|
1219 |
fi |
1117 |
} |
1220 |
} |
1118 |
|
1221 |
|
1119 |
have_pkgdep() { |
1222 |
have_pkgdep() { |
Lines 1122-1128
Link Here
|
1122 |
if [ -r "${PKG_DBDIR}/$1/+CONTENTS" ]; then |
1225 |
if [ -r "${PKG_DBDIR}/$1/+CONTENTS" ]; then |
1123 |
while read X; do |
1226 |
while read X; do |
1124 |
case $X in |
1227 |
case $X in |
1125 |
@pkgdep\ $2-[0-9]*|@pkgdep\ $2-pl[0-9]*) |
1228 |
@pkgdep\ $2-[0-9]*|@pkgdep\ $2-[brv.][0-9]*|@pkgdep\ $2-a.[0-9]*|@pkgdep\ $2-pl[0-9]*|@pkgdep\ $2-b.r[0-9]*|@pkgdep\ $2-cr.[a-z]*) |
1126 |
return 0 ;; |
1229 |
return 0 ;; |
1127 |
[!@]*) break ;; |
1230 |
[!@]*) break ;; |
1128 |
esac |
1231 |
esac |
Lines 1134-1140
Link Here
|
1134 |
|
1237 |
|
1135 |
update_pkgdep() { |
1238 |
update_pkgdep() { |
1136 |
update_file "${PKG_DBDIR}/$1/+CONTENTS" \ |
1239 |
update_file "${PKG_DBDIR}/$1/+CONTENTS" \ |
1137 |
"s/^@pkgdep $2\$/@pkgdep $3/" || return 1 |
1240 |
"/^@pkgdep $2\$/,/^@comment DEPORIGIN:/ { s|^@pkgdep $2\$|@pkgdep $3|; s|^@comment DEPORIGIN:.*\$|@comment DEPORIGIN:${pkg_origin}|; }" || return 1 |
1138 |
} |
1241 |
} |
1139 |
|
1242 |
|
1140 |
delete_pkgdep() { |
1243 |
delete_pkgdep() { |
Lines 1325-1331
Link Here
|
1325 |
|
1428 |
|
1326 |
init_install() { |
1429 |
init_install() { |
1327 |
case $1 in |
1430 |
case $1 in |
1328 |
*.t[bg]z) |
1431 |
*.t[bgx]z) |
1329 |
set_pkg_vars_for_binary "$1" || return 1 ;; |
1432 |
set_pkg_vars_for_binary "$1" || return 1 ;; |
1330 |
/*) set_port_vars "$1" || return 1 ;; |
1433 |
/*) set_port_vars "$1" || return 1 ;; |
1331 |
*) set_port_vars "${PORTSDIR}/$1" || return 1 ;; |
1434 |
*) set_port_vars "${PORTSDIR}/$1" || return 1 ;; |
Lines 1351-1357
Link Here
|
1351 |
done |
1454 |
done |
1352 |
|
1455 |
|
1353 |
case ${replace_with} in |
1456 |
case ${replace_with} in |
1354 |
*.t[bg]z) |
1457 |
*.t[bgx]z) |
1355 |
pkg_binary=${replace_with} ;; |
1458 |
pkg_binary=${replace_with} ;; |
1356 |
?*) |
1459 |
?*) |
1357 |
pkg_portdir=${replace_with} |
1460 |
pkg_portdir=${replace_with} |
Lines 1428-1433
Link Here
|
1428 |
do_replace() { |
1531 |
do_replace() { |
1429 |
local pkg_log pkg_tmpdir old_package old_required_by preserved_files |
1532 |
local pkg_log pkg_tmpdir old_package old_required_by preserved_files |
1430 |
|
1533 |
|
|
|
1534 |
if is_yes ${use_pkgng}; then |
1535 |
local old_origin new_origin |
1536 |
old_origin= |
1537 |
new_origin= |
1538 |
fi |
1539 |
|
1431 |
init_replace "$1" || { status=skipped; return 0; } |
1540 |
init_replace "$1" || { status=skipped; return 0; } |
1432 |
|
1541 |
|
1433 |
if [ "${cur_pkg_name}" != "${pkg_name}" ]; then |
1542 |
if [ "${cur_pkg_name}" != "${pkg_name}" ]; then |
Lines 1482-1488
Link Here
|
1482 |
fi |
1591 |
fi |
1483 |
|
1592 |
|
1484 |
pkg_tmpdir="${tmpdir}/${cur_pkg_name}" |
1593 |
pkg_tmpdir="${tmpdir}/${cur_pkg_name}" |
|
|
1594 |
if ! is_yes ${use_pkgng}; then |
1485 |
old_required_by="${pkg_tmpdir}/+REQUIRED_BY" |
1595 |
old_required_by="${pkg_tmpdir}/+REQUIRED_BY" |
|
|
1596 |
fi |
1486 |
|
1597 |
|
1487 |
if ! find_package 'old_package' "${cur_pkg_name}"; then |
1598 |
if ! find_package 'old_package' "${cur_pkg_name}"; then |
1488 |
old_package="${pkg_tmpdir}/${cur_pkg_name}${PKG_SUFX}" |
1599 |
old_package="${pkg_tmpdir}/${cur_pkg_name}${PKG_SUFX}" |
Lines 1491-1497
Link Here
|
1491 |
if ! { |
1602 |
if ! { |
1492 |
create_dir "${pkg_tmpdir}" && |
1603 |
create_dir "${pkg_tmpdir}" && |
1493 |
backup_package "${cur_pkg_name}" "${old_package}" && |
1604 |
backup_package "${cur_pkg_name}" "${old_package}" && |
1494 |
backup_file "${cur_pkg_pkgdir}/+REQUIRED_BY" "${old_required_by}" && |
1605 |
if is_yes ${use_pkgng}; then |
|
|
1606 |
old_origin=`${PKG_INFO} -qo ${cur_pkg_name}` || return 1 |
1607 |
else |
1608 |
backup_file "${cur_pkg_pkgdir}/+REQUIRED_BY" "${old_required_by}" |
1609 |
fi && |
1495 |
preserve_libs "${cur_pkg_name}" |
1610 |
preserve_libs "${cur_pkg_name}" |
1496 |
}; then |
1611 |
}; then |
1497 |
log="backup error" |
1612 |
log="backup error" |
Lines 1503-1508
Link Here
|
1503 |
if install_package "${pkg_binary:-${pkg_portdir}}" "${pkg_log}"; then |
1618 |
if install_package "${pkg_binary:-${pkg_portdir}}" "${pkg_log}"; then |
1504 |
status=done |
1619 |
status=done |
1505 |
cur_pkg_pkgdir=${PKG_DBDIR}/${pkg_name} |
1620 |
cur_pkg_pkgdir=${PKG_DBDIR}/${pkg_name} |
|
|
1621 |
if is_yes ${use_pkgng}; then |
1622 |
new_origin=`${PKG_INFO} -qo ${pkg_name}` |
1623 |
fi |
1506 |
else |
1624 |
else |
1507 |
log="install error" |
1625 |
log="install error" |
1508 |
restore_package "${old_package}" || { |
1626 |
restore_package "${old_package}" || { |
Lines 1515-1522
Link Here
|
1515 |
log="deinstall error" |
1633 |
log="deinstall error" |
1516 |
fi |
1634 |
fi |
1517 |
|
1635 |
|
|
|
1636 |
if ! is_yes ${use_pkgng}; then |
1518 |
restore_file "${old_required_by}" "${cur_pkg_pkgdir}/+REQUIRED_BY" || |
1637 |
restore_file "${old_required_by}" "${cur_pkg_pkgdir}/+REQUIRED_BY" || |
1519 |
warn "Failed to restore the +REQUIRED_BY file." |
1638 |
warn "Failed to restore the +REQUIRED_BY file." |
|
|
1639 |
fi |
1520 |
process_package "${old_package}" || |
1640 |
process_package "${old_package}" || |
1521 |
warn "Failed to keep the old version." |
1641 |
warn "Failed to keep the old version." |
1522 |
clean_libs || |
1642 |
clean_libs || |
Lines 1527-1533
Link Here
|
1527 |
case ${status} in |
1647 |
case ${status} in |
1528 |
done) |
1648 |
done) |
1529 |
fix_dependencies "${pkg_name}" || return 1 |
1649 |
fix_dependencies "${pkg_name}" || return 1 |
1530 |
update_dependencies "${cur_pkg_name%-*}" "${pkg_name}" || return 1 ;; |
1650 |
if is_yes ${use_pkgng}; then |
|
|
1651 |
update_dependencies "${old_origin}" "${new_origin}" || return 1 |
1652 |
else |
1653 |
update_dependencies "${cur_pkg_name%-*}" "${pkg_name}" || return 1 |
1654 |
fi ;; |
1531 |
*) |
1655 |
*) |
1532 |
return 1 ;; |
1656 |
return 1 ;; |
1533 |
esac |
1657 |
esac |