diff --git a/package/import/cpan/hosted_cpan.pl b/package/import/cpan/hosted_cpan.pl index 35cf36681..859eae205 100644 --- a/package/import/cpan/hosted_cpan.pl +++ b/package/import/cpan/hosted_cpan.pl @@ -28,14 +28,18 @@ my $cpanbase="http://www.cpan.org/modules/by-authors/id"; my %hosted; +my %flags; open(F, "hosted_cpan.txt") || die $!; while () { chomp; next if /^#/ or /^\s*$/; - my ($p, $m) = split /\s+/; + die unless /^(\S+)\s+(\S+)(\s+.*\S|)/; + my ($p, $m, $f) = ($1, $2, $3); + $f =~ s/(\S+)/flag $1/g; $hosted{$m} = $p; + $flags{$m} = $f; } close F; @@ -96,9 +100,7 @@ matched: print S "\t\tsrctar=\"$f\"\n"; print S "\t\t;;\n"; - print C "bool 'Building package $mod (cpan-$xmod)' ROCKCFG_PKG_CPAN_$ymod 1\n"; - print C "if [ \"\$ROCKCFG_PKG_CPAN_$ymod\" = 1 ]; then pkgfork cpan cpan-$xmod ". - "status X priority $hosted{$key}; fi\n\n"; + print C "pkgfork cpan cpan-$xmod status X priority $hosted{$key}$flags{$key}\n"; delete $hosted{$key}; } diff --git a/package/import/cpan/config.in b/package/import/cpan/preconfig.in similarity index 90% rename from package/import/cpan/config.in rename to package/import/cpan/preconfig.in index a9c505eb1..1825550e5 100644 --- a/package/import/cpan/config.in +++ b/package/import/cpan/preconfig.in @@ -5,7 +5,7 @@ # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by # the ./scripts/Create-CopyPatch script. Do not edit this copyright text! # -# ROCK Linux: rock-src/package/import/cpan/config.in +# ROCK Linux: rock-src/package/import/cpan/preconfig.in # ROCK Linux is Copyright (C) 1998 - 2004 Clifford Wolf # # This program is free software; you can redistribute it and/or modify @@ -22,9 +22,7 @@ if pkgcheck cpan X then - menu_begin MENU_CPAN 'CPAN Packages' . package/import/cpan/hosted_cpan.cfg pkgremove cpan - menu_end fi diff --git a/scripts/config.func b/scripts/config.func index 723511573..64bdd855b 100644 --- a/scripts/config.func +++ b/scripts/config.func @@ -138,6 +138,8 @@ fi # priority 115.000 # version 0.9.26 # prefix /opt/foobar +# flag CORE +# unflag CORE # pkgfork() { local script="\$5==\"$1\" {print;\$5=\"$1=$2\";" @@ -159,6 +161,12 @@ pkgfork() { prefix) script="$script \$7=\"$2\";" ;; + flag) + script="$script sub(\" 0\$\", \" $2 0\");" + ;; + unflag) + script="$script sub(\" $2 \", \" \");" + ;; esac shift; shift; done