head	1.23;
access;
symbols
	pkgsrc-2026Q1:1.23.0.4
	pkgsrc-2026Q1-base:1.23
	pkgsrc-2025Q4:1.23.0.2
	pkgsrc-2025Q4-base:1.23
	pkgsrc-2025Q3:1.22.0.6
	pkgsrc-2025Q3-base:1.22
	pkgsrc-2025Q2:1.22.0.4
	pkgsrc-2025Q2-base:1.22
	pkgsrc-2025Q1:1.22.0.2
	pkgsrc-2025Q1-base:1.22
	pkgsrc-2024Q4:1.21.0.4
	pkgsrc-2024Q4-base:1.21
	pkgsrc-2024Q3:1.21.0.2
	pkgsrc-2024Q3-base:1.21
	pkgsrc-2024Q2:1.20.0.18
	pkgsrc-2024Q2-base:1.20
	pkgsrc-2024Q1:1.20.0.16
	pkgsrc-2024Q1-base:1.20
	pkgsrc-2023Q4:1.20.0.14
	pkgsrc-2023Q4-base:1.20
	pkgsrc-2023Q3:1.20.0.12
	pkgsrc-2023Q3-base:1.20
	pkgsrc-2023Q2:1.20.0.10
	pkgsrc-2023Q2-base:1.20
	pkgsrc-2023Q1:1.20.0.8
	pkgsrc-2023Q1-base:1.20
	pkgsrc-2022Q4:1.20.0.6
	pkgsrc-2022Q4-base:1.20
	pkgsrc-2022Q3:1.20.0.4
	pkgsrc-2022Q3-base:1.20
	pkgsrc-2022Q2:1.20.0.2
	pkgsrc-2022Q2-base:1.20
	pkgsrc-2022Q1:1.18.0.10
	pkgsrc-2022Q1-base:1.18
	pkgsrc-2021Q4:1.18.0.8
	pkgsrc-2021Q4-base:1.18
	pkgsrc-2021Q3:1.18.0.6
	pkgsrc-2021Q3-base:1.18
	pkgsrc-2021Q2:1.18.0.4
	pkgsrc-2021Q2-base:1.18
	pkgsrc-2021Q1:1.18.0.2
	pkgsrc-2021Q1-base:1.18
	pkgsrc-2020Q4:1.17.0.2
	pkgsrc-2020Q4-base:1.17
	pkgsrc-2020Q3:1.14.0.12
	pkgsrc-2020Q3-base:1.14
	pkgsrc-2020Q2:1.14.0.10
	pkgsrc-2020Q2-base:1.14
	pkgsrc-2020Q1:1.14.0.6
	pkgsrc-2020Q1-base:1.14
	pkgsrc-2019Q4:1.14.0.8
	pkgsrc-2019Q4-base:1.14
	pkgsrc-2019Q3:1.14.0.4
	pkgsrc-2019Q3-base:1.14
	pkgsrc-2019Q2:1.14.0.2
	pkgsrc-2019Q2-base:1.14
	pkgsrc-2019Q1:1.13.0.18
	pkgsrc-2019Q1-base:1.13
	pkgsrc-2018Q4:1.13.0.16
	pkgsrc-2018Q4-base:1.13
	pkgsrc-2018Q3:1.13.0.14
	pkgsrc-2018Q3-base:1.13
	pkgsrc-2018Q2:1.13.0.12
	pkgsrc-2018Q2-base:1.13
	pkgsrc-2018Q1:1.13.0.10
	pkgsrc-2018Q1-base:1.13
	pkgsrc-2017Q4:1.13.0.8
	pkgsrc-2017Q4-base:1.13
	pkgsrc-2017Q3:1.13.0.6
	pkgsrc-2017Q3-base:1.13
	pkgsrc-2017Q2:1.13.0.2
	pkgsrc-2017Q2-base:1.13
	pkgsrc-2017Q1:1.11.0.2
	pkgsrc-2017Q1-base:1.11
	pkgsrc-2016Q4:1.9.0.18
	pkgsrc-2016Q4-base:1.9
	pkgsrc-2016Q3:1.9.0.16
	pkgsrc-2016Q3-base:1.9
	pkgsrc-2016Q2:1.9.0.14
	pkgsrc-2016Q2-base:1.9
	pkgsrc-2016Q1:1.9.0.12
	pkgsrc-2016Q1-base:1.9
	pkgsrc-2015Q4:1.9.0.10
	pkgsrc-2015Q4-base:1.9
	pkgsrc-2015Q3:1.9.0.8
	pkgsrc-2015Q3-base:1.9
	pkgsrc-2015Q2:1.9.0.6
	pkgsrc-2015Q2-base:1.9
	pkgsrc-2015Q1:1.9.0.4
	pkgsrc-2015Q1-base:1.9
	pkgsrc-2014Q4:1.9.0.2
	pkgsrc-2014Q4-base:1.9
	pkgsrc-2014Q3:1.8.0.6
	pkgsrc-2014Q3-base:1.8
	pkgsrc-2014Q2:1.8.0.4
	pkgsrc-2014Q2-base:1.8
	pkgsrc-2014Q1:1.8.0.2
	pkgsrc-2014Q1-base:1.8
	pkgsrc-2013Q4:1.7.0.4
	pkgsrc-2013Q4-base:1.7
	pkgsrc-2013Q3:1.7.0.2
	pkgsrc-2013Q3-base:1.7
	pkgsrc-2013Q2:1.6.0.6
	pkgsrc-2013Q2-base:1.6
	pkgsrc-2013Q1:1.6.0.4
	pkgsrc-2013Q1-base:1.6
	pkgsrc-2012Q4:1.6.0.2
	pkgsrc-2012Q4-base:1.6
	pkgsrc-2012Q3:1.4.0.2
	pkgsrc-2012Q3-base:1.4;
locks; strict;
comment	@# @;


1.23
date	2025.12.18.19.25.14;	author christos;	state Exp;
branches;
next	1.22;
commitid	TwGgsAnalb0BqVmG;

1.22
date	2025.01.23.20.11.36;	author wiz;	state Exp;
branches;
next	1.21;
commitid	kK5fpYnU62ZkgEGF;

1.21
date	2024.07.25.05.41.52;	author wiz;	state Exp;
branches;
next	1.20;
commitid	L4IApi8TvS8HibjF;

1.20
date	2022.04.15.09.10.56;	author nia;	state Exp;
branches;
next	1.19;
commitid	GxL6NmzsImMxchAD;

1.19
date	2022.04.15.08.07.25;	author nia;	state Exp;
branches;
next	1.18;
commitid	AwZg9d6js4oKQgAD;

1.18
date	2021.03.14.08.44.01;	author nia;	state Exp;
branches;
next	1.17;
commitid	ynoeajeLax59OfLC;

1.17
date	2020.10.21.21.34.21;	author kamil;	state Exp;
branches;
next	1.16;
commitid	2kaau5lmOgpkHOsC;

1.16
date	2020.10.14.09.50.49;	author maya;	state Exp;
branches;
next	1.15;
commitid	3zMq4Dnyatq42RrC;

1.15
date	2020.10.13.00.50.08;	author maya;	state Exp;
branches;
next	1.14;
commitid	GLg0CYJRICbI4GrC;

1.14
date	2019.06.03.20.35.55;	author triaxx;	state Exp;
branches;
next	1.13;
commitid	BO0UWCMjt7n4DMpB;

1.13
date	2017.05.29.23.07.49;	author jlam;	state Exp;
branches;
next	1.12;
commitid	ZZm6GaEEDWcR6lTz;

1.12
date	2017.05.29.18.56.49;	author jlam;	state Exp;
branches;
next	1.11;
commitid	bVMF8lVBI420IjTz;

1.11
date	2017.03.20.00.25.35;	author maya;	state Exp;
branches;
next	1.10;
commitid	CN5jOwYpgzHFOdKz;

1.10
date	2016.12.31.09.39.31;	author wiz;	state Exp;
branches;
next	1.9;
commitid	0Gg2dzj5Aq6Gq7Az;

1.9
date	2014.10.09.14.07.00;	author wiz;	state Exp;
branches;
next	1.8;
commitid	fBDATFVmQ3454xTx;

1.8
date	2014.02.08.15.59.30;	author jmmv;	state Exp;
branches;
next	1.7;
commitid	SuowNDj0v32qvjox;

1.7
date	2013.07.28.23.37.14;	author jmmv;	state Exp;
branches;
next	1.6;
commitid	9u8esM6l3s21jiZw;

1.6
date	2012.10.23.19.51.26;	author asau;	state Exp;
branches;
next	1.5;

1.5
date	2012.10.11.00.16.46;	author jmmv;	state Exp;
branches;
next	1.4;

1.4
date	2012.09.07.12.48.32;	author jmmv;	state Exp;
branches;
next	1.3;

1.3
date	2012.08.25.01.57.27;	author jmmv;	state Exp;
branches;
next	1.2;

1.2
date	2012.08.15.21.21.15;	author jmmv;	state Exp;
branches;
next	1.1;

1.1
date	2012.08.06.17.06.17;	author jmmv;	state Exp;
branches;
next	;


desc
@@


1.23
log
@PR/59759: J. Spath: Add patch supplied (fixes order, recommends reboot,
adds doc)
@
text
@# $NetBSD: Makefile,v 1.22 2025/01/23 20:11:36 wiz Exp $

DISTNAME=	sysupgrade-1.5
PKGREVISION=	12
CATEGORIES=	sysutils
MASTER_SITES=	${MASTER_SITE_GITHUB:=jmmv/}

MAINTAINER=	pkgsrc-users@@NetBSD.org
COMMENT=	Automate upgrades of NetBSD
LICENSE=	modified-bsd

GNU_CONFIGURE=		yes
TEST_TARGET=		check
USE_LANGUAGES=		# empty
USE_TOOLS=		pkg-config

BUILD_DEFS+=		VARBASE
SYSUPGRADE_CACHEDIR=	${VARBASE}/cache/sysupgrade
OWN_DIRS_PERMS=		${SYSUPGRADE_CACHEDIR} \
			${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 0755
CONFIGURE_ARGS+=	SYSUPGRADE_CACHEDIR=${SYSUPGRADE_CACHEDIR}

CONFIGURE_ARGS+=	--sysconfdir=${PKG_SYSCONFDIR}
INSTALL_MAKE_FLAGS+=	sysconfdir=${EGDIR}
EGDIR=			${PREFIX}/share/examples/sysupgrade
CONF_FILES+=		${EGDIR}/default.conf ${PKG_SYSCONFDIR}/sysupgrade.conf

PKG_OPTIONS_VAR=	PKG_OPTIONS.sysupgrade
PKG_SUPPORTED_OPTIONS=	tests
PKG_SUGGESTED_OPTIONS=	tests

.include "../../mk/bsd.options.mk"

.if !empty(PKG_OPTIONS:Mtests)
.  include "../../devel/atf/buildlink3.mk"
PLIST_SUBST+=	TESTS=
.else
PLIST_SUBST+=	TESTS=@@comment
.endif

BUILDLINK_API_DEPENDS.shtk+=	shtk>=1.3
.include "../../devel/shtk/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
@


1.22
log
@sysupgrade: update config file so it works on NetBSD 10+

From Robert Bagdan via wip.

Bump PKGREVISION.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.21 2024/07/25 05:41:52 wiz Exp $
d4 1
a4 1
PKGREVISION=	11
@


1.21
log
@*: reset MAINTAINER (became observer)
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.20 2022/04/15 09:10:56 nia Exp $
d4 1
a4 1
PKGREVISION=	10
@


1.20
log
@sysupgrade: Infer default archive extension based on the CPU architecture.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.19 2022/04/15 08:07:25 nia Exp $
d7 2
a8 1
MAINTAINER=	jmmv@@NetBSD.org
@


1.19
log
@sysupgrade: protect against failures when /usr/sbin is not in PATH
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.18 2021/03/14 08:44:01 nia Exp $
d4 1
a4 1
PKGREVISION=	9
@


1.18
log
@sysupgrade: More useful example URLs.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.17 2020/10/21 21:34:21 kamil Exp $
d4 1
a4 1
PKGREVISION=	8
@


1.17
log
@sysupgrade: Switch the default case to .tar.xz sets

The .tgz users can tune it setting ARCHIVE_EXTENSION.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.16 2020/10/14 09:50:49 maya Exp $
d4 1
a4 1
PKGREVISION=	7
@


1.16
log
@sysupgrade: rm *${arch_ext} as well as *gz, not in place of.

PKGREVISION++
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.15 2020/10/13 00:50:08 maya Exp $
d4 1
a4 1
PKGREVISION=	6
@


1.15
log
@sysupgrade: PKGREVISION->5, handle ARCHIVE_EXTENSION also in sysupgrade clean

From Sunil Nimmagadda in PR pkg/55713
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.14 2019/06/03 20:35:55 triaxx Exp $
d4 1
a4 1
PKGREVISION=	5
@


1.14
log
@Add variable for archive file extension

Fix PR pkg/53697
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.13 2017/05/29 23:07:49 jlam Exp $
d4 1
a4 1
PKGREVISION=	4
@


1.13
log
@Fix broken build by adding missing directory permissions.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.12 2017/05/29 18:56:49 jlam Exp $
d4 1
a4 1
PKGREVISION=	3
d6 1
a6 2
MASTER_SITES=	https://github.com/jmmv/sysupgrade/releases/download/sysupgrade-1.5/

@


1.12
log
@Fix ownership of ${VARBASE}/cache/sysupgrade.

Fix case where OWN_DIRS_PERMS obviously was intended instead of OWN_DIRS.
Also use ${REAL_ROOT_USER}:${REAL_ROOT_GROUP} instead of hardcoding
root:wheel.

Bump PKGREVISION for fixes that changed binary package.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.11 2017/03/20 00:25:35 maya Exp $
d19 2
a20 1
OWN_DIRS_PERMS=		${SYSUPGRADE_CACHEDIR} ${REAL_ROOT_USER} ${REAL_ROOT_GROUP}
@


1.11
log
@sysupgrade: don't reject https. bump PKGREVISION.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.10 2016/12/31 09:39:31 wiz Exp $
d4 1
a4 1
PKGREVISION=	2
d19 1
a19 1
OWN_DIRS=		${SYSUPGRADE_CACHEDIR} root wheel
@


1.10
log
@Use standard way to test for options.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.9 2014/10/09 14:07:00 wiz Exp $
d4 1
a4 1
PKGREVISION=	1
@


1.9
log
@Remove pkgviews: don't set PKG_INSTALLATION_TYPES in Makefiles.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.8 2014/02/08 15:59:30 jmmv Exp $
d33 1
a33 1
.if $(PKG_OPTIONS:Mtests)
@


1.8
log
@Depend on atf 0.20 (not atf-libs) and bump PKGREVISION.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.7 2013/07/28 23:37:14 jmmv Exp $
a11 2
PKG_INSTALLATION_TYPES=	overwrite pkgviews

@


1.7
log
@Update to 1.5:

Released on 2013-07-28.

* Sources migrated to a GitHub project from the previous copy in
  the pkgsrc repository.  sysupgrade is now a first-class package and
  includes a traditional build system based on automake and autoconf.

* Moved the sysupgrade script from bin to sbin.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.6 2012/10/23 19:51:26 asau Exp $
d4 1
d36 1
a36 2
BUILDLINK_API_DEPENDS.atf-libs+=	atf-libs>=0.17
.  include "../../devel/atf-libs/buildlink3.mk"
@


1.6
log
@Drop superfluous PKG_DESTDIR_SUPPORT, "user-destdir" is default these days.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.5 2012/10/11 00:16:46 jmmv Exp $
d3 1
a3 1
DISTNAME=	sysupgrade-1.4
d5 1
a5 2
MASTER_SITES=	# empty
DISTFILES=	# empty
d13 4
a16 5
WRKSRC=			${WRKDIR}
NO_CONFIGURE=		YES

BUILD_SUBST+=		-e 's,@@SYSUPGRADE_CACHEDIR@@,${CACHEDIR},g'
BUILD_SUBST+=		-e 's,@@SYSUPGRADE_ETCDIR@@,${PKG_SYSCONFDIR},g'
d19 3
a21 2
CACHEDIR=		${VARBASE}/cache/sysupgrade
OWN_DIRS=		${CACHEDIR} root wheel
d23 2
d35 2
a37 21
.  include "../../devel/atf-libs/buildlink3.mk"

BUILD_SUBST+=		-e 's,@@ATF_SH@@,${BUILDLINK_PREFIX.atf-libs}/bin/atf-sh,g'

do-build: build-tests
build-tests:
	cp ${FILESDIR}/Kyuafile ${WRKSRC}
	sed ${BUILD_SUBST} ${FILESDIR}/sysupgrade_test.sh \
	    >${WRKSRC}/sysupgrade_test
	chmod +x ${WRKSRC}/sysupgrade_test

INSTALLATION_DIRS+=	tests/sysupgrade

do-install: install-tests
install-tests:
	${INSTALL_DATA} ${WRKSRC}/Kyuafile ${DESTDIR}${PREFIX}/tests/sysupgrade
	${INSTALL_SCRIPT} ${WRKSRC}/sysupgrade_test \
	    ${DESTDIR}${PREFIX}/tests/sysupgrade/

do-test:
	cd ${WRKSRC} && PATH="${WRKSRC}:${PATH}" kyua test
d42 1
a42 19
do-build:
	sed ${BUILD_SUBST} ${FILESDIR}/sysupgrade.sh \
	    | ${BUILDLINK_PREFIX.shtk}/bin/shtk build \
	    -s ${SH} -m sysupgrade_main -o ${WRKSRC}/sysupgrade -
.for file in sysupgrade.8 sysupgrade.conf.5 default.conf
	sed ${BUILD_SUBST} <${FILESDIR}/${file} >${WRKSRC}/${file}
.endfor

INSTALLATION_DIRS+=	bin ${PKGMANDIR}/man5 ${PKGMANDIR}/man8 \
			share/examples/sysupgrade

do-install:
	${INSTALL_SCRIPT} ${WRKSRC}/sysupgrade ${DESTDIR}${PREFIX}/bin/
	${INSTALL_MAN} ${WRKSRC}/sysupgrade.8 \
	    ${DESTDIR}${PREFIX}/${PKGMANDIR}/man8/
	${INSTALL_MAN} ${WRKSRC}/sysupgrade.conf.5 \
	    ${DESTDIR}${PREFIX}/${PKGMANDIR}/man5/
	${INSTALL_DATA} ${WRKSRC}/default.conf ${DESTDIR}${EGDIR}

@


1.5
log
@Update to 1.4:

- Add support to fetch release sets via ssh.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.4 2012/09/07 12:48:32 jmmv Exp $
a12 1
PKG_DESTDIR_SUPPORT=	user-destdir
@


1.4
log
@Update to 1.3:

- ftp(1) in NetBSD 1.5.2 does not support using -R on files that do not
  exist yet.  Avoid using this option unless necessary.
- httpd(8) in NetBSD 1.5.2 does not support the -P option.  Skip the http
  test unless this option is present, as otherwise we cannot easily kill
  the spawned httpd instance on a test failure.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.3 2012/08/25 01:57:27 jmmv Exp $
d3 1
a3 1
DISTNAME=	sysupgrade-1.3
@


1.3
log
@Update to 1.2:

- Use netbsd-*.gz files to install the kernel rather than kern-*.tgz sets.
  This lets sysupgrade work in conjunction with the "releasekernel" target
  of build.sh, as this generates the former instead of the latter.

- Preserve timestamps of the kernel when backing it up as onetbsd.

- Fix some tests to not rely on the current state of the system (the cache
  directory and the autodetection of KERNEL).
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.2 2012/08/15 21:21:15 jmmv Exp $
d3 1
a3 1
DISTNAME=	sysupgrade-1.2
@


1.2
log
@Update to 1.1:

- Use shtk for the common utilities and configuration file parsing
  functionality.  The local copies of the "config" and "utils" modules
  are gone.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.1 2012/08/06 17:06:17 jmmv Exp $
d3 1
a3 1
DISTNAME=	sysupgrade-1.1
@


1.1
log
@Initial addition of sysupgrade, version 1.0:

sysupgrade is a script to automate NetBSD system upgrades.  sysupgrade
works by first fetching distribution sets from a specified site or local
directory, then by upgrading the system using such distribution sets and
later by ensuring that the system configuration is up to date.  All the
process is controlled by a configuration file, and the defaults should
suit the most common NetBSD upgrades.

sysupgrade can be used to perform upgrades across different system major
and/or minor versions, and it can also be used to track a stable or
development branch from the CVS repository.

sysbuild is the perfect companion to sysupgrade in those cases where you
want to roll your own binaries: both utilities share a very similar
command-line and configuration interface, and the default configuration
files provide examples on how to integrate one with the other.

A few notes about the import:

Right after I submitted sysbuild, I was pointed at etcmanage and its
scripts to build and upgrade NetBSD.  I am sending this anyway because
1) it matches sysbuild's behavior closely, 2) it has a detailed manual
page, 3) it has tests... and, well, 4) I had already written most of it
at that time and didn't want to throw it away!

The config and utils modules in this import are a duplicate of the code
in sysbuild, with a few tweaks.  This is really bad and the code should
be deduplicated somehow.  I'm not sure what the best way of doing so is
and can only think about introducing a common base package with the
shared code (which brings its own problems).

I have tested this to upgrade both -current and 6.0_BETA2 to newer
snapshots, both from local and remote release files.
@
text
@d1 1
a1 1
# $NetBSD$
d3 1
a3 1
DISTNAME=	sysupgrade-1.0
d18 2
a19 2
UPGRADE_SUBST+=		-e 's,@@SYSUPGRADE_CACHEDIR@@,${CACHEDIR},g'
UPGRADE_SUBST+=		-e 's,@@SYSUPGRADE_ETCDIR@@,${PKG_SYSCONFDIR},g'
a34 2
TEST_PROGS=	config_test sysupgrade_test utils_test

d38 2
d43 3
a45 7
.for file in ${TEST_PROGS}
	${ECHO} '#! ${BUILDLINK_PREFIX.atf-libs}/bin/atf-sh' \
	    >${WRKSRC}/${file}
	${CAT} ${FILESDIR}/*.subr ${FILESDIR}/${file}.sh \
	    | ${SED} ${UPGRADE_SUBST} >>${WRKSRC}/${file}
	${CHMOD} +x ${WRKSRC}/${file}
.endfor
d52 1
a52 2
.for file in ${TEST_PROGS}
	${INSTALL_SCRIPT} ${WRKSRC}/${file} \
a53 1
.endfor
d62 3
a64 6
	${ECHO} '#! ${SH}' >${WRKSRC}/sysupgrade
	${ECHO} 'set -e' >>${WRKSRC}/sysupgrade
	${CAT} ${FILESDIR}/*.subr ${FILESDIR}/sysupgrade.sh \
	    | ${SED} ${UPGRADE_SUBST} >>${WRKSRC}/sysupgrade
	${ECHO} 'sysupgrade_main "$${@@}"' >>${WRKSRC}/sysupgrade
	${CHMOD} +x ${WRKSRC}/sysupgrade
d66 1
a66 1
	sed ${UPGRADE_SUBST} <${FILESDIR}/${file} >${WRKSRC}/${file}
d80 1
@

