Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 May 2005 01:07:01 +0200
From:      "Simon L. Nielsen" <simon@FreeBSD.org>
To:        freebsd-ports@FreeBSD.org
Subject:   Re: portupgrade: Good location for flag file?
Message-ID:  <20050521230700.GF781@zaphod.nitro.dk>
In-Reply-To: <20050521132139.GD803@zaphod.nitro.dk>
References:  <20050521132139.GD803@zaphod.nitro.dk>

next in thread | previous in thread | raw e-mail | index | archive | help

--YH9Qf6Fh2G5kB/85
Content-Type: multipart/mixed; boundary="4f28nU6agdXSinmL"
Content-Disposition: inline


--4f28nU6agdXSinmL
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On 2005.05.21 15:21:40 +0200, Simon L. Nielsen wrote:
> Hello
>=20
> To really get portupgrade to work properly again after my patch for
> CAN-2005-0610 (portupgrade 20041226_2) I need to find a good location
> for the pkgdb.fixme flagfile.  Before 20041226_2 it was in /tmp or
> /var/tmp but for 20041226_2 it was moved to /var/db/pkg, which turned
> out to be a bad idea (see ports/81088 and mails on this list).
>=20
> So, I need to have a known static location for pkgdb.fixme which is in
> a directory only writeable by root.  So does anyone suggestions on a
> good location?  The only ones I can come up with, which are not really
> good, are /var/run or /var/db/portupgrade...

Pav suggested simply using /var/db/pkgdb.fixme, so unless somebody has
a better idea I plan to commit the attached patch within the next
couple of days (when my ports mentor gets back).

I noticed a cosmetic bug when using FreeBSD 6-CURRENT make so a fix
for that is also in the patch...

--=20
Simon L. Nielsen

--4f28nU6agdXSinmL
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename="port-portupgrade-CAN-2005-0610_4.patch"
Content-Transfer-Encoding: quoted-printable

Index: Makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/ports/sysutils/portupgrade/Makefile,v
retrieving revision 1.195
diff -u -d -r1.195 Makefile
--- Makefile	12 Apr 2005 08:24:48 -0000	1.195
+++ Makefile	5 May 2005 13:27:54 -0000
@@ -7,7 +7,7 @@
=20
 PORTNAME=3D	portupgrade
 PORTVERSION=3D	20041226
-PORTREVISION=3D	2
+PORTREVISION=3D	3
 CATEGORIES=3D	sysutils
 MASTER_SITES=3D	ftp://ftp.iDaemons.org/pub/distfiles/ \
 		${MASTER_SITE_LOCAL}
Index: files/patch-CAN-2005-0610
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/ports/sysutils/portupgrade/files/patch-CAN-2005-0610,v
retrieving revision 1.1
diff -u -d -r1.1 patch-CAN-2005-0610
--- files/patch-CAN-2005-0610	12 Apr 2005 08:24:48 -0000	1.1
+++ files/patch-CAN-2005-0610	21 May 2005 22:43:28 -0000
@@ -1,46 +1,29 @@
-diff -ru ../orig.pkgtools-20041224/lib/pkgdb.rb ./lib/pkgdb.rb
+diff -ur ../orig.pkgtools-20041224/lib/pkgdb.rb ./lib/pkgdb.rb
 --- ../orig.pkgtools-20041224/lib/pkgdb.rb	Wed Mar 23 21:37:47 2005
-+++ ./lib/pkgdb.rb	Tue Mar 29 00:27:02 2005
-@@ -97,7 +97,7 @@
++++ ./lib/pkgdb.rb	Sun May 22 00:39:38 2005
+@@ -96,8 +96,7 @@
+     @db_dir =3D File.expand_path(new_db_dir || ENV['PKG_DBDIR'] || '/var/=
db/pkg')
 =20
      @db_file =3D File.join(@db_dir, 'pkgdb.db')
-     @tmp_dir =3D ENV['PKG_TMPDIR'] || ENV['TMPDIR'] || '/var/tmp'
+-    @tmp_dir =3D ENV['PKG_TMPDIR'] || ENV['TMPDIR'] || '/var/tmp'
 -    @fixme_file =3D File.join(@tmp_dir, 'pkgdb.fixme')
-+    @fixme_file =3D File.join(@db_dir, 'pkgdb.fixme')
++    @fixme_file =3D ENV['PKG_FIXME_FILE'] || "/var/db/pkgdb.fixme"
      @db_filebase =3D @db_file.sub(/\.db$/, '')
      close_db
 =20
-diff -ru ../orig.pkgtools-20041224/lib/pkgsqldb.rb ./lib/pkgsqldb.rb
---- ../orig.pkgtools-20041224/lib/pkgsqldb.rb	Wed Mar 23 21:37:47 2005
-+++ ./lib/pkgsqldb.rb	Tue Mar 29 00:29:51 2005
-@@ -74,7 +74,7 @@
-=20
-     @db_file =3D File.join(@db_dir, 'pkgdb.sqldb')
-     @tmp_dir =3D ENV['PKG_TMPDIR'] || ENV['TMPDIR'] || '/var/tmp'
--    @fixme_file =3D File.join(@tmp_dir, 'pkgdb.fixme')
-+    @fixme_file =3D File.join(@db_dir, 'pkgdb.fixme')
-     close_db
-=20
-     @db_dir
-diff -ru ../orig.pkgtools-20041224/lib/pkgtools.rb ./lib/pkgtools.rb
---- ../orig.pkgtools-20041224/lib/pkgtools.rb	Wed Mar 23 21:37:47 2005
-+++ ./lib/pkgtools.rb	Wed Mar 30 23:51:50 2005
-@@ -204,7 +204,7 @@
-   $ports_dir =3D $portsdb.ports_dir
-   $packages_base =3D ENV['PACKAGES'] || File.join($ports_dir, 'packages')
-   $packages_dir =3D File.join($packages_base, 'All')
--  $tmpdir =3D ENV['PKG_TMPDIR'] || ENV['TMPDIR'] || '/var/tmp'
-+  init_tmpdir
-   $pkg_path =3D ENV['PKG_PATH'] || $packages_dir
-=20
-   $pkg_sites =3D (ENV['PKG_SITES'] || '').split
-@@ -222,6 +222,31 @@
-=20
-   $portsdb.ignore_categories =3D config_value(:IGNORE_CATEGORIES) || []
-   $portsdb.extra_categories =3D config_value(:EXTRA_CATEGORIES) || []
-+end
+Only in ./lib: pkgdb.rb~
+diff -ur ../orig.pkgtools-20041224/lib/pkgmisc.rb ./lib/pkgmisc.rb
+--- ../orig.pkgtools-20041224/lib/pkgmisc.rb	Wed Mar 23 21:37:47 2005
++++ ./lib/pkgmisc.rb	Thu May  5 14:09:37 2005
+@@ -95,3 +95,31 @@
+     end
+   end
+ end
 +
 +def init_tmpdir
++  if ! $tmpdir.nil? && $tmpdir !=3D "" then
++    return
++  end
 +  maintmpdir =3D ENV['PKG_TMPDIR'] || ENV['TMPDIR'] || '/var/tmp'
 +  if !FileTest.directory?(maintmpdir)
 +    raise "Temporary directory #{maintmpdir} does not exist"
@@ -63,6 +46,30 @@
 +    end
 +    }
 +  $tmpdir=3Dtmpdir
- end
++end
+diff -ur ../orig.pkgtools-20041224/lib/pkgsqldb.rb ./lib/pkgsqldb.rb
+--- ../orig.pkgtools-20041224/lib/pkgsqldb.rb	Wed Mar 23 21:37:47 2005
++++ ./lib/pkgsqldb.rb	Sun May 22 00:42:04 2005
+@@ -73,8 +73,7 @@
+     @db_dir =3D File.expand_path(new_db_dir || ENV['PKG_DBDIR'] || '/var/=
db/pkg')
 =20
- def parse_pattern(str, regex =3D false)
+     @db_file =3D File.join(@db_dir, 'pkgdb.sqldb')
+-    @tmp_dir =3D ENV['PKG_TMPDIR'] || ENV['TMPDIR'] || '/var/tmp'
+-    @fixme_file =3D File.join(@tmp_dir, 'pkgdb.fixme')
++    @fixme_file =3D ENV['PKG_FIXME_FILE'] || "/var/db/pkgdb.fixme"
+     close_db
+=20
+     @db_dir
+Only in ./lib: pkgsqldb.rb~
+diff -ur ../orig.pkgtools-20041224/lib/pkgtools.rb ./lib/pkgtools.rb
+--- ../orig.pkgtools-20041224/lib/pkgtools.rb	Wed Mar 23 21:37:47 2005
++++ ./lib/pkgtools.rb	Tue May  3 19:29:59 2005
+@@ -204,7 +204,7 @@
+   $ports_dir =3D $portsdb.ports_dir
+   $packages_base =3D ENV['PACKAGES'] || File.join($ports_dir, 'packages')
+   $packages_dir =3D File.join($packages_base, 'All')
+-  $tmpdir =3D ENV['PKG_TMPDIR'] || ENV['TMPDIR'] || '/var/tmp'
++  init_tmpdir
+   $pkg_path =3D ENV['PKG_PATH'] || $packages_dir
+=20
+   $pkg_sites =3D (ENV['PKG_SITES'] || '').split
Index: files/patch-Makefile.compat
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: files/patch-Makefile.compat
diff -N files/patch-Makefile.compat
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-Makefile.compat	21 May 2005 22:47:52 -0000
@@ -0,0 +1,11 @@
+--- ../orig.pkgtools-20041224/Makefile.compat	Wed Mar 23 21:37:47 2005
++++ Makefile.compat	Sun May 22 00:46:39 2005
+@@ -89,7 +89,7 @@
+ .endif
+ .endif
+=20
+-.endif defined(${group}) && !empty(${group})
++.endif # defined(${group}) && !empty(${group})
+ .endfor
+=20
+ .endif

--4f28nU6agdXSinmL--

--YH9Qf6Fh2G5kB/85
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (FreeBSD)

iD8DBQFCj78Uh9pcDSc1mlERAmk4AKCl1bqIH/s+fgUXce+44n+ytCiM1QCfRfWe
8IYVxRiJst+saooVKr8NHbU=
=8fob
-----END PGP SIGNATURE-----

--YH9Qf6Fh2G5kB/85--


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050521230700.GF781>