Name:apt-clear-sources-filetrigger-for-checkinstall
Version:1
Release:alt1
Summary:EnsurethatanyAPT'ssourcesaredeleted(ahelperpkgfor*-checkinstallpkgs)
Group:Development/Other
License:ALT-Public-Domain
# This dep simplifies how this package shall be used in order to avoid# the problem with the files in question not having been deleted yet# at the moment when this is needed, namely, at the moment of a transaction# when a *-checkinstall package with a test for apt is installed.## Normally, a *-checkinstall package with a test for apt would have a# dep on apt and cause the installation of apt in the same transaction# where its test scripts are run. But our "cleaning" filetrigger would# then only have an effect at the end of the transaction: that's a# problem, because the test wouldn't be run with clean APT's sources# (although we'd want this).Requires(post):apt
Requires:apt
BuildArch:noarch
Source1:apt-clear-sources-filetrigger-for-checkinstall.filetrigger
%description%summary.
Thispackageisnotintendedforinstallationinnormalsystems.
Itssolepurposeistohelptheautomatictestingofaptinhasher
withpackagerepositiorieswherethedefaultbuildenvcontains
uncommentedexternalsourcesforAPT(inaccessibleinhasher).
Forthispackagetohaveaneffectatthemomentwhena*-checkinstall
packagewithtestsforAPTisinstalled,apt(andfriendswithsources.list)
mustbeinstalledinaseparateprevioustransaction.(Otherwise
theeffectwouldonlyhappenattheendofthecurrenttransaction,
ratherthanbeforethetestingscriptsarerun.)
Asimplewaytoachievethisistoinstallthispackagesinaseparate
transaction(andthispackagehasadeponapt).
%installinstall-m0755-D%SOURCE1%buildroot%_rpmlibdir/%name.filetrigger
%files%_rpmlibdir/%name.filetrigger
%postset-x
{
echo'Clearing the files that have been present before this pkg is installed.'rm-fv/etc/apt/sources.list{,.d/*}||:
}>&2
%package checkinstall
Summary:Immediatelyinstallandchecktheeffectof%name
Group:Development/Other
Requires:apt
Requires:%name
%descriptioncheckinstall
%summary.
%files checkinstall
%post checkinstall
set-efuC-opipefail
set-x
find/etc/apt/sources.list.d/-not-typed|{!grep-Ee.>&2;}
![-e/etc/apt/sources.list]
# Should not signal an error.apt-getupdate
%changelog* Fri Oct 28 2022 Ivan Zakharyaschev <imz@altlinux.org> 1-alt1-Initialrelease(tohelpdoingapt-BuildPreReq-under-pkdirect-checkinstall
inrepositorieswherethedefaultbuildenvcontainsexternalAPTsources).