tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: pkgsrc/mk/flavor/pkg



Hi,
This breaks package file creation as the temporary pathname
given to pkg_create is not ending in a suffix which triggers compression
of the tarball. The attached ugly patch fix this.

But I have to admit that I miss to be able to cut and paste
the binary package's pathname just created, see the sample output
below...
...
===> package-message [bison-2.3] ===> Building binary package for bison-2.3
Creating package /pkg_comp/packages/All/bison-2.3.tmp.tgz
Using SrcDir value of /usr/pkg
===> barrier [bison-2.3] ===> Leaving ``package'' after barrier for bison-2.3
...

Cheers, Stoned.

On Thu, Jan 03, 2008 at 11:21:48PM +0000, Roland Illig wrote:
> 
> Module Name:  pkgsrc
> Committed By: rillig
> Date:         Thu Jan  3 23:21:48 UTC 2008
> 
> Modified Files:
>       pkgsrc/mk/flavor/pkg: package.mk
> 
> Log Message:
> When creating the binary package, first create a temporary file, and if
> everything went well, rename it to the real name. That way, it is less
> likely that broken binary packages are created. It is a common
> assumption that binary package files, if they exist, are usable.
> 
> An example for a broken binary package is security/sudo-1.6.9p10, in
> which sbin/visudo wasn't readable when creating the package as an
> unprivileged user.
> 
> 
> To generate a diff of this commit:
> cvs rdiff -r1.12 -r1.13 pkgsrc/mk/flavor/pkg/package.mk
> 
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
> 
Index: flavor/pkg/package.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/flavor/pkg/package.mk,v
retrieving revision 1.13
diff -u -r1.13 package.mk
--- flavor/pkg/package.mk       3 Jan 2008 23:21:48 -0000       1.13
+++ flavor/pkg/package.mk       4 Jan 2008 13:29:59 -0000
@@ -40,11 +40,11 @@
 
 ${PKGFILE}: ${_CONTENTS_TARGETS}
        ${RUN} ${MKDIR} ${.TARGET:H}
-       ${RUN} if ${PKG_CREATE} ${_PKG_ARGS_PACKAGE} ${.TARGET}.tmp; then \
-               ${MV} -f ${.TARGET}.tmp ${.TARGET};                     \
+       ${RUN} if ${PKG_CREATE} ${_PKG_ARGS_PACKAGE} 
${.TARGET:S|${PKG_SUFX}$|.tmp${PKG_SUFX}|}; then \
+               ${MV} -f ${.TARGET:S|${PKG_SUFX}$|.tmp${PKG_SUFX}|} ${.TARGET}; 
\
        else                                                            \
                exitcode=$$?;                                           \
-               ${RM} -f ${.TARGET}.tmp;                                \
+               ${RM} -f ${.TARGET:S|${PKG_SUFX}$|.tmp${PKG_SUFX}|};    \
                exit $$exitcode;                                        \
        fi
 


Home | Main Index | Thread Index | Old Index