OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Thomas Lotterer
Root: /v/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-tools Date: 19-Feb-2005 00:00:57
Branch: HEAD Handle: 2005021823005600
Modified files:
openpkg-tools/cmd bf-mk.pl src2make.pl
Log:
shift erase logic from Makefile into slave and make it more picky and
robust
Summary:
Revision Changes Path
1.24 +13 -13 openpkg-tools/cmd/bf-mk.pl
1.13 +0 -6 openpkg-tools/cmd/src2make.pl
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-tools/cmd/bf-mk.pl
============================================================================
$ cvs diff -u -r1.23 -r1.24 bf-mk.pl
--- openpkg-tools/cmd/bf-mk.pl 15 Feb 2005 15:34:54 -0000 1.23
+++ openpkg-tools/cmd/bf-mk.pl 18 Feb 2005 23:00:56 -0000 1.24
@@ -494,19 +494,19 @@
{
# erase packages from SLAVE OpenPKG instance
%{driver.shtool} echo -e "%B++ [EMAIL PROTECTED]:%{shared.prefix}: erase
packages from SLAVE OpenPKG instance%b"
- source="%{shared.prefix}/src/master"
- target="%{shared.prefix}/src/$HOST-$ARCH-$OS"
- %{driver.cp} $source/Makefile* $target/
- ( cd $target && %{driver.make} \
- LOG="%{shared.prefix}/log/$HOST-$ARCH-$OS" \
- SRC="%{shared.prefix}/src/$HOST-$ARCH-$OS" \
- DST="%{shared.prefix}/dst/$HOST-$ARCH-$OS" \
- TMP="%{slaves.ltmp}/$HOST-$ARCH-$OS" \
- EXEC_BFDB="%{slaves.bfdb}" \
- EXEC_ROOT="%{driver.sudo}" \
- EXEC_HOST="$HOST" \
- erase \
- )
+ surplus=`%{slaves.rpm} -qa | sed -e 's;^openpkg-[^-][^-]*-[^-][^-]*$;;'
-e 's;^gpg-pubkey-[^-][^-]*-[^-][^-]*$;;'`
+ if [ ".$surplus" = . ]; then
+ echo "instance already stripped to baseline, nothing to erase"
+ else
+ echo "erasing $surplus"
+ %{driver.sudo} %{slaves.rpm} -e $surplus
+ surplus=`%{slaves.rpm} -qa | sed -e
's;^openpkg-[^-][^-]*-[^-][^-]*$;;' -e 's;^gpg-pubkey-[^-][^-]*-[^-][^-]*$;;'`
+ if [ ".$surplus" = . ]; then
+ echo "instance successfully stripped to baseline"
+ else
+ die "some unwanted crap remains, need operator help"
+ fi
+ fi
}
cmd_oneshot ()
@@ .
patch -p0 <<'@@ .'
Index: openpkg-tools/cmd/src2make.pl
============================================================================
$ cvs diff -u -r1.12 -r1.13 src2make.pl
--- openpkg-tools/cmd/src2make.pl 18 Feb 2005 12:32:31 -0000 1.12
+++ openpkg-tools/cmd/src2make.pl 18 Feb 2005 23:00:56 -0000 1.13
@@ -929,12 +929,6 @@
"\trm -f Makefile.log.* >/dev/null 2>&1 || true\n" .
"\n";
-$MF .= "# erase\n" .
- "erase:\n" .
- "[EMAIL PROTECTED](PREFIX)/bin/openpkg rpm -qa | sed -e
'/^openpkg-[0-9].*/d' -e '/^gpg-pubkey-.*/d'`\\\n" .
- "\t [ \".\$\$surplus\" = . ] || \$(EXEC_ROOT)
\$(PREFIX)/bin/openpkg rpm -e \$\$surplus\n" .
- "\n";
-
&verbose("writing Makefile");
$mf = new IO::File ">$outdir/Makefile" || die "unable to create output
'$outdir/Makefile'";
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [email protected]