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: 26-Feb-2007 18:28:54 Branch: HEAD Handle: 2007022617285300 Modified files: openpkg-tools/cmd build.pl Log: download from URLs (including "file://"), direct access absolut path names (identified by leading "/") Summary: Revision Changes Path 1.42 +27 -14 openpkg-tools/cmd/build.pl ____________________________________________________________________________ patch -p0 <<'@@ .' Index: openpkg-tools/cmd/build.pl ============================================================================ $ cvs diff -u -r1.41 -r1.42 build.pl --- openpkg-tools/cmd/build.pl 20 Feb 2007 22:24:42 -0000 1.41 +++ openpkg-tools/cmd/build.pl 26 Feb 2007 17:28:53 -0000 1.42 @@ -2498,7 +2498,7 @@ # allbin -> usebin also for goals sub print_list1 ($$$$$$$) { my ($list, $c, $uncond, $with, $ignore, $usebin, $allbin) = @_; - my ($pkg, $spkg, $bpkg, $ppkg); + my ($pkg, $spkg, $bpkg, $uvhpkg, $ppkg); my ($opt); my ($cmd1, $cmd2, $mark); my ($cmd3, $srcpkg); @@ -2513,7 +2513,7 @@ unless ($spkg =~ m/\S/) { die "openpkg:build:FATAL: internal error, ",vsn($_)," without source URL\n"; } - $bpkg = target2rpm($_, $c); + $bpkg = target2rpm($_, $c); $uvhpkg = $bpkg; $srcpkg = target2srcrpm($_, $c); $cmd3 = ''; @@ -2547,22 +2547,34 @@ " )"; } elsif (defined $_->{prefix}) { $cmd1 = ''; - $cmd1 .= npriv($config->{"curl"} . " -# -o $bpkg $spkg $err\n"); - $cmd3 = npriv("rm -f $bpkg >/dev/null 2>&1 $err\n") unless ($opt_k); + if ($spkg =~ m |^/|) { + $uvhpkg = $spkg; + } + else { + $cmd1 .= npriv($config->{"curl"} . " -# -o $bpkg $spkg $err\n"); + $cmd3 = npriv("rm -f $bpkg >/dev/null 2>&1 $err\n") unless ($opt_k); + } } else { $cmd1 = ''; - $cmd1 .= "if test ! -f $srcpkg; then\n"; - $cmd1 .= indent(npriv($config->{"curl"} . " -# -o $srcpkg $spkg $err\n")); - $cmd1 .= "fi\n"; - $cmd1 .= npriv($config->{"rpm"} . "$opt --rebuild $srcpkg $err\n"); - $cmd1 .= npriv("rm -f $srcpkg >/dev/null 2>&1 $err\n") unless ($opt_k); + if ($spkg =~ m |^/|) { + $cmd1 .= npriv($config->{"rpm"} . "$opt --rebuild $spkg $err\n"); + } + else { + $cmd1 .= "if test ! -f $srcpkg; then\n"; + $cmd1 .= indent(npriv($config->{"curl"} . " -# -o $srcpkg $spkg $err\n")); + $cmd1 .= "fi\n"; + $cmd1 .= npriv($config->{"rpm"} . "$opt --rebuild $srcpkg $err\n"); + } + if (not $spkg =~ m |^/|) { + $cmd1 .= npriv("rm -f $srcpkg >/dev/null 2>&1 $err\n") unless ($opt_k); + } } } # wrap build command with build-time check for existing # binary target if (defined($cmd1) && ($allbin || ($usebin && !$_->{GOAL}))) { - $cmd1 = "if test ! -f $bpkg; then\n".indent($cmd1)."fi\n"; + $cmd1 = "if test ! -f $uvhpkg; then\n".indent($cmd1)."fi\n"; } # if package exist force rpm to copy over new files @@ -2570,9 +2582,9 @@ # files $opt = ($_->{REBUILD} || ($allbin || ($usebin && !$_->{GOAL}))) ? ' --force' : ''; $cmd2 = ''; - $cmd2 .= priv($config->{"rpm"} . "$opt -Uvh $bpkg $err\n"); + $cmd2 .= priv($config->{"rpm"} . "$opt -Uvh $uvhpkg $err\n"); if ($allbin || ($usebin && !$_->{GOAL})) { - $cmd2 = "if test \".`".$config->{"rpm"}." -q --qf '\%{SIGMD5}' $pkg`\" != \".`".$config->{"rpm"}." -qp --qf '\%{SIGMD5}' $bpkg`\"; then\n".indent($cmd2)."fi\n"; + $cmd2 = "if test \".`".$config->{"rpm"}." -q --qf '\%{SIGMD5}' $pkg`\" != \".`".$config->{"rpm"}." -qp --qf '\%{SIGMD5}' $uvhpkg`\"; then\n".indent($cmd2)."fi\n"; } $cmd2 = $cmd1.$cmd2 if ($cmd1); $cmd2 = $cmd2.$cmd3 if ($cmd3); @@ -2674,8 +2686,9 @@ =item B<-r> I<repository> -Specify the path to an OpenPKG RPM package repository. This can be a URL or a directory -path. The name of the package file is appended to this path. +Specify the path to an OpenPKG RPM package repository. This can be a URL (including "file://") +to download packages from or an absolute directory path to access packages directly. +The name of the package file is appended to this path. The default is to use a URL pointing to the B<OpenPKG> FTP server as determined by the "B<openpkg release>" command. @@ . ______________________________________________________________________ OpenPKG http://openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org