Bug 187187 - fix sysutils/freesbie for pkgng
Summary: fix sysutils/freesbie for pkgng
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: Thomas Zander
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-02 03:10 UTC by TAKEMON Takashi
Modified: 2014-03-15 17:11 UTC (History)
0 users

See Also:


Attachments
file.shar (15.30 KB, text/plain)
2014-03-02 03:10 UTC, TAKEMON Takashi
no flags Details
patch-scripts-pkginstall.sh (1.96 KB, text/plain; charset=Shift_JIS)
2014-03-10 06:44 UTC, TAKEMON Takashi
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description TAKEMON Takashi 2014-03-02 03:10:00 UTC
freesbie environment allows you to create a 1CD system very easily.
But adding the package now I can not in pkgng environment.
So, we created a patch to address pkgng.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2014-03-02 15:17:36 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2014-03-02 15:17:36 UTC
Maintainer of sysutils/freesbie,

Please note that PR ports/187187 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/187187

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 3 Thomas Zander freebsd_committer freebsd_triage 2014-03-02 15:33:19 UTC
Responsible Changed
From-To: freebsd-ports-bugs->riggs

I'll take it.
Comment 4 Thomas Zander freebsd_committer freebsd_triage 2014-03-08 21:19:51 UTC
State Changed
From-To: feedback->open

Maintainer has fixed.
Comment 5 Thomas Zander freebsd_committer freebsd_triage 2014-03-08 21:20:00 UTC
State Changed
From-To: open->feedback

Ask for submitter approval.
Comment 6 TAKEMON Takashi 2014-03-10 06:44:03 UTC
Hello.
Thank you for incorporating the patch.

I do not have PowerPC machine.
So, I can not test on PowerPC machines.

but Fixes Makefile, config of the i386, amd64 worked fine.

pkginstall.sh patch that I made was incorrect.
I made a another patch that works fine more.
Please use this instead.

Thank you.
TAKEMON Takashi

(2014/03/09 5:56), Thomas Zander wrote:
> Thanks for the pr. I have prepared an update using your ideas, but
> - support the amd64 and powerpc users as well
> - select the pkg management tool based on whether we are on a
>    WITH_PKGNG system or not (support for old pkg_* tools until at least
>    September 2014!)
> - support staging
>
> Could you test the attached version and confirm that it works for you?
>
> Thanks
> Riggs
>
Comment 7 dfilter service freebsd_committer freebsd_triage 2014-03-15 17:05:54 UTC
Author: riggs
Date: Sat Mar 15 17:05:50 2014
New Revision: 348356
URL: http://svnweb.freebsd.org/changeset/ports/348356
QAT: https://qat.redports.org/buildarchive/r348356/

Log:
  - Support PKGNG
  - Support Staging
  - Update maintainer e-mail address
  - Introduce limitation of the port to supported ARCHs
  - Add LICENSE
  - USE_BZIP2 -> USES tar:bzip2
  - Bump PORTREVISION
  
  PR:		ports/187187
  Submitted by:	TAKEMON Takashi <takemon@bamboogate.co.jp>
  Approved by:	thierry (mentor)

Added:
  head/sysutils/freesbie/files/conf-arch-FREESBIE.in   (contents, props changed)
  head/sysutils/freesbie/files/extra-patch-pkgng   (contents, props changed)
Modified:
  head/sysutils/freesbie/Makefile

Modified: head/sysutils/freesbie/Makefile
==============================================================================
--- head/sysutils/freesbie/Makefile	Sat Mar 15 16:55:47 2014	(r348355)
+++ head/sysutils/freesbie/Makefile	Sat Mar 15 17:05:50 2014	(r348356)
@@ -3,27 +3,42 @@
 
 PORTNAME=	freesbie
 PORTVERSION=	2.0.20070710
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	sysutils
 MASTER_SITES=	http://www.rrr.de/~riggs/freesbie/
 MASTER_SITES+=	${MASTER_SITE_LOCAL:S/%SUBDIR%/delphij/}
 DISTNAME=	${PORTNAME}-${PORTVERSION:S/2.0.//}
 
-MAINTAINER=	riggs@rrr.de
+MAINTAINER=	riggs@FreeBSD.org
 COMMENT=	Yet another cool answer to the system-on-cd question
 
+LICENSE=	BSD2CLAUSE
+
 RUN_DEPENDS=	cdrecord:${PORTSDIR}/sysutils/cdrtools
 
-USE_BZIP2=	yes
+USES=		tar:bzip2
 NO_BUILD=	yes
 
 WRKSRC=		${WRKDIR}/${PORTNAME}2
 
-NO_STAGE=	yes
+ONLY_FOR_ARCHS=	amd64 i386 powerpc
+ONLY_FOR_ARCHS_REASON=	FreeSBIE build system only supports amd64, i386 and powerpc
+
+.include <bsd.port.pre.mk>
+
+.if defined(WITH_PKGNG)
+EXTRA_PATCHES+=	${FILESDIR}/extra-patch-pkgng
+.endif
+
+pre-configure:
+	@${SED} -e "s:%%ARCH%%:${ARCH}:g" ${FILESDIR}/conf-arch-FREESBIE.in > ${WRKSRC}/conf/${ARCH}/FREESBIE
+
 do-install:
-	@ ${MKDIR} ${DATADIR}
-	@ ${RM} ${WRKSRC}/scripts/iso.sh.orig
+	@ ${MKDIR} ${STAGEDIR}${DATADIR}
+	@ ${RM} -f ${WRKSRC}/scripts/iso.sh.orig \
+		${WRKSRC}/scripts/pkginstall.sh.orig \
+		${WRKSRC}/scripts/pkgselect.sh.orig
 	@ cd ${WRKSRC} && ${FIND} . -type f -print | tar -cf - -T - | \
-	tar -xf - -C ${DATADIR}
+	tar -xf - -C ${STAGEDIR}${DATADIR}
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>

Added: head/sysutils/freesbie/files/conf-arch-FREESBIE.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/freesbie/files/conf-arch-FREESBIE.in	Sat Mar 15 17:05:50 2014	(r348356)
@@ -0,0 +1,5 @@
+include /usr/src/sys/%%ARCH%%/conf/GENERIC
+ident FREESBIE
+options GEOM_UZIP # Read-only compressed disks
+options GEOM_LABEL # Providers labelization.
+options UNIONFS # Union filesystem

Added: head/sysutils/freesbie/files/extra-patch-pkgng
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/freesbie/files/extra-patch-pkgng	Sat Mar 15 17:05:50 2014	(r348356)
@@ -0,0 +1,90 @@
+--- scripts/pkginstall.sh.orig	2007-01-16 19:14:46.000000000 +0900
++++ scripts/pkginstall.sh	2014-03-10 15:36:47.962245461 +0900
+@@ -52,7 +52,7 @@
+ 
+ 	# pkg_info might fail if the listed package isn't present
+ 	set +e
+-	origins=$(pkg_info -EX "^$(escape_pkg ${pkg})($|-[^-]+$)")
++	origins=$(pkg query -x "%n-%v" "^$(escape_pkg ${pkg})($|-[^-]+$)")
+ 	retval=$?
+ 	set -e
+ 	if [ ${retval} -eq 0 ]; then
+@@ -84,7 +84,7 @@
+     touch deps
+     echo -n "Finding dependencies... "
+     while read pkg; do
+-	deps=$(pkg_info -qr ${pkg} | cut -d ' ' -f 2)
++	deps=$(pkg query "%dn-%dv" ${pkg})
+ 	for dep in ${deps}; do
+ 	    echo ${dep} >> tmp_deps
+ 	done      
+@@ -142,7 +142,7 @@
+     export PACKAGE_BUILDING=yo
+     chrootpkgpath=${CHROOTWD#$BASEDIR}
+     pkgfile=${WORKDIR}/sortpkg
+-    pkgaddcmd="chroot ${BASEDIR} pkg_add -v"
++    pkgaddcmd="/usr/local/sbin/pkg -c ${BASEDIR} add -f "
+     totpkg=$(wc -l $pkgfile | awk '{print $1}')
+     echo "Copying ${totpkg} packages"
+     cd ${CHROOTWD}
+@@ -159,7 +159,11 @@
+ 	count=$((${count} + 1))
+ 
+ 	echo "Running pkg_create -b ${pkg} ${CHROOTWD}/${pkg}.tar" >> ${LOGFILE}
+-	pkg_create -b ${pkg} ${CHROOTWD}/${pkg}.tar >> ${LOGFILE} 2>&1
++	rpkg=`pkg query %dn-%dv ${pkg}` 
++	for spkg in ${rpkg}; do
++		pkg create -o ${CHROOTWD} -n -f tar ${spkg} >> ${LOGFILE} 2>&1
++	done
++	pkg create -o ${CHROOTWD} -n -f tar ${pkg} >> ${LOGFILE} 2>&1
+ 
+ 	echo "Running $pkgaddcmd ${chrootpkgpath}/${pkg}.tar" >> ${LOGFILE}
+ 	$pkgaddcmd ${chrootpkgpath}/${pkg}.tar >> ${LOGFILE} 2>&1
+@@ -168,12 +172,17 @@
+ 
+     done < $pkgfile
+     echo "]"
++    if [ -f ${WORKDIR}/extra/customroot/var/db ]; then
++	chroot ${BASEDIR} pkg backup -d test.db
++	env PKG_DBDIR=${WORKDIR}extra/customroot/var/db/pkg pkg backup -r ${BASEDIR}/test.db
++	rm ${BASEDIR}/test.db
++    fi
+     set -e
+ }
+ 
+ delete_old_packages() {
+     echo "Deleting previously installed packages"
+-    chroot ${BASEDIR} pkg_delete -a >> ${LOGFILE} 2>&1
++    pkg -c ${BASEDIR} delete -afy >> ${LOGFILE} 2>&1
+ }
+ 
+ # Deletes workdirs
+--- scripts/pkgselect.sh.orig	2014-02-16 02:43:17.000000000 +0000
++++ scripts/pkgselect.sh	2014-02-25 20:55:34.000000000 +0000
+@@ -21,7 +21,7 @@
+ 
+ # Check if there are packages installed on the system
+ check_pkgs() {
+-    count=$(pkg_info -Qoa | wc -l)
++    count=$(pkg query -a "%n-%v:%o" | wc -l)
+     if [ ${count} -eq 0 ]; then
+ 	/usr/bin/dialog --title "FreeSBIE Packages selection" --clear \
+ 	--msgbox "Sorry, you don't have any packages installed.\n\nPlease install at least the packages you want\nto include in your distribution." 10 50
+@@ -40,7 +40,7 @@
+     # Create a different file for each category. Each row in each file
+     # will look like:
+     # PKGNAME PKGNAME-version    
+-    pkg_info -Qoa | awk \
++    pkg query -a "%n-%v:%o" | awk \
+ ' BEGIN { FS=":|/" } 
+ { 
+     a=$1;
+@@ -63,7 +63,7 @@
+ 
+ 	    # pkg_info might fail if the listed package isn't present
+ 	    set +e
+-	    origins=$(pkg_info -QoX "^$(escape_pkg ${pkg})($|-[^-]+$)")
++	    origins=$(pkg query -x "%n-%v:%o" "^$(escape_pkg ${pkg})($|-[^-]+$)")
+ 	    retval=$?
+ 	    set -e
+ 	    if [ ${retval} -eq 0 ]; then
_______________________________________________
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 8 Thomas Zander freebsd_committer freebsd_triage 2014-03-15 17:11:45 UTC
State Changed
From-To: feedback->closed

Committed, with minor changes. Thanks!