Bug 186406 - ports-mgmt/pkg_replace: preserve automatic flag
Summary: ports-mgmt/pkg_replace: preserve automatic flag
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Alex Kozlov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-03 12:00 UTC by kamada
Modified: 2014-02-04 14:10 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (1.14 KB, patch)
2014-02-03 12:00 UTC, kamada
no flags Details | Diff
update-pkg_replace-0.8.0_8.txt (920 bytes, text/plain)
2014-02-04 00:51 UTC, Ken DEGUCHI
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description kamada 2014-02-03 12:00:00 UTC
Hello Deguchi-san,

This is a patch to make pkg_replace preserve the automatic flag.
Could you merge this into your patch set?
Attached patch is against pkg_replace-0.8.0_7.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2014-02-03 12:00:13 UTC
Maintainer of ports-mgmt/pkg_replace,

Please note that PR ports/186406 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/186406

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2014-02-03 12:00:14 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 3 kamada 2014-02-03 12:56:45 UTC
Not enough tested, sorry.  The third fragment of the patch
should say "${cur_pkg_name}" instead of "${old_package}".
Revised patch attached.

--- /usr/local/sbin/pkg_replace	2014-02-03 08:15:28.000000000 +0900
+++ pkg_replace	2014-02-03 21:50:42.000000000 +0900
@@ -1290,7 +1290,8 @@
 }
 
 do_replace() {
-	local pkg_log pkg_tmpdir old_package old_required_by preserved_files
+	local pkg_log pkg_tmpdir old_package old_required_by preserved_files \
+		automatic_flag
 
 	if is_yes ${use_pkgng}; then
 		local old_origin new_origin
@@ -1365,6 +1366,7 @@
 		backup_package "${cur_pkg_name}" "${old_package}" &&
 		if is_yes ${use_pkgng}; then
 			old_origin=`${PKG_INFO} -qo ${cur_pkg_name}` || return 1
+			automatic_flag=$(${PKG_QUERY} %a "${cur_pkg_name}")
 		else
 			backup_file "${cur_pkg_pkgdir}/+REQUIRED_BY" "${old_required_by}"
 		fi &&
@@ -1381,6 +1383,7 @@
 			cur_pkg_pkgdir=${PKG_DBDIR}/${pkg_name}
 			if is_yes ${use_pkgng}; then
 				new_origin=`${PKG_INFO} -qo ${pkg_name}`
+				${PKG_SET} -y -A "${automatic_flag}" "${pkg_name}"
 			fi
 		else
 			log="install error"
@@ -1389,6 +1392,9 @@
 				"please reinstall '${old_package}' manually."
 				return 1
 			}
+			if is_yes ${use_pkgng}; then
+				${PKG_SET} -y -A "${automatic_flag}" "${cur_pkg_name}"
+			fi
 		fi
 	else
 		log="deinstall error"
Comment 4 Ken DEGUCHI 2014-02-04 00:51:30 UTC
Thank you. I merge your automatic flag patch into my patch.

Attached patch is update ports-mgmt/pkg_replace 0.8.0_7 -> 0.8.0_8.
Comment 5 Alex Kozlov freebsd_committer freebsd_triage 2014-02-04 13:51:23 UTC
Responsible Changed
From-To: freebsd-ports-bugs->ak

I'll take it.
Comment 6 dfilter service freebsd_committer freebsd_triage 2014-02-04 14:03:16 UTC
Author: ak
Date: Tue Feb  4 14:03:08 2014
New Revision: 342535
URL: http://svnweb.freebsd.org/changeset/ports/342535
QAT: https://qat.redports.org/buildarchive/r342535/

Log:
  - Preserve the automatic flag when using pkgng
  
  PR:	ports/186406
  Submitted by:	KAMADA Ken'ichi <kamada@nanohz.org>
  Approved by:	Ken DEGUCHI <kdeguchi@sz.tokoha-u.ac.jp> (maintainer)

Modified:
  head/ports-mgmt/pkg_replace/Makefile
  head/ports-mgmt/pkg_replace/distinfo

Modified: head/ports-mgmt/pkg_replace/Makefile
==============================================================================
--- head/ports-mgmt/pkg_replace/Makefile	Tue Feb  4 13:58:13 2014	(r342534)
+++ head/ports-mgmt/pkg_replace/Makefile	Tue Feb  4 14:03:08 2014	(r342535)
@@ -3,7 +3,7 @@
 
 PORTNAME=	pkg_replace
 PORTVERSION=	0.8.0
-PORTREVISION=	7
+PORTREVISION=	8
 CATEGORIES=	ports-mgmt
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE_JP}
 MASTER_SITE_SUBDIR=	portutil/22116

Modified: head/ports-mgmt/pkg_replace/distinfo
==============================================================================
--- head/ports-mgmt/pkg_replace/distinfo	Tue Feb  4 13:58:13 2014	(r342534)
+++ head/ports-mgmt/pkg_replace/distinfo	Tue Feb  4 14:03:08 2014	(r342535)
@@ -1,4 +1,4 @@
 SHA256 (pkg_replace-0.8.0.tar.bz2) = 3092f5fc0d18529eb5d38776941c0ee4d0073ecb524ab17671c81ca69c29e214
 SIZE (pkg_replace-0.8.0.tar.bz2) = 17296
-SHA256 (pkg_replace-0.8.0_7.patch) = adaf61417f5cceb6a92c702254f94dfe5c31c52fd16e1312ed1547b12fddd161
-SIZE (pkg_replace-0.8.0_7.patch) = 11257
+SHA256 (pkg_replace-0.8.0_8.patch) = c66579918c99277c6ef18e3c8d9f5fad3a452c1e0e32096f97918103271167c4
+SIZE (pkg_replace-0.8.0_8.patch) = 11601
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 7 Alex Kozlov freebsd_committer freebsd_triage 2014-02-04 14:03:33 UTC
State Changed
From-To: feedback->closed

Committed. Thanks!