The attached patch extents the ./scripts/feeds script by the possibility to 
handle copies and links to directories in addition to the svn repository access.
It allows access to ClearCase views by linking them to the feeds directory.

Following configuration should be used within the feeds.conf

src-link my_clearcase /var/vob/view/my_packages
src-cpy my_copy ~/private_packages

The command update and install <package_name> should work as usual.

Note:
The src-link command is creating a link with the absolute path to the source 
directory within the feeds directory.


Signed-off-by: ralph <[EMAIL PROTECTED]>

---

Index: scripts/feeds
===================================================================
--- scripts/feeds       (revision 10053)
+++ scripts/feeds       (working copy)
@@ -6,6 +6,7 @@
 use metadata;
 use warnings;
 use strict;
+use Cwd 'abs_path';

 chdir "$FindBin::Bin/..";
 $ENV{TOPDIR}=getcwd();
@@ -55,6 +56,36 @@
        return 0;
 }

+sub update_cpy($$) {
+       my $name = shift;
+       my $src = shift;
+
+       system("cp -Rf $src ./feeds/$name");
+       -d "./feeds/$name.tmp" or mkdir "./feeds/$name.tmp" or return 1;
+       -d "./feeds/$name.tmp/info" or mkdir "./feeds/$name.tmp/info" or return 
1;
+
+       system("make -s prepare-mk TMP_DIR=\"$ENV{TOPDIR}/feeds/$name.tmp\"");
+       system("make -s -f include/scan.mk IS_TTY=1 SCAN_TARGET=\"packageinfo\" 
SCAN_DIR=\"feeds/$name\" SCAN_NAME=\"package\" 
SCAN_DEPS=\"$ENV{TOPDIR}/include/package*.mk\" SCAN_DEPTH=4 SCAN_EXTRA=\"\" 
TMP_DIR=\"$ENV{TOPDIR}/feeds/$name.tmp\"");
+       system("ln -sf $name.tmp/.packageinfo ./feeds/$name.index");
+
+       return 0;
+}
+
+sub update_link($$) {
+       my $name = shift;
+       my $src = abs_path(shift);
+
+       system("ln -sf $src ./feeds/$name");
+       -d "./feeds/$name.tmp" or mkdir "./feeds/$name.tmp" or return 1;
+       -d "./feeds/$name.tmp/info" or mkdir "./feeds/$name.tmp/info" or return 
1;
+
+       system("make -s prepare-mk TMP_DIR=\"$ENV{TOPDIR}/feeds/$name.tmp\"");
+       system("make -s -f include/scan.mk IS_TTY=1 SCAN_TARGET=\"packageinfo\" 
SCAN_DIR=\"feeds/$name\" SCAN_NAME=\"package\" 
SCAN_DEPS=\"$ENV{TOPDIR}/include/package*.mk\" SCAN_DEPTH=4 SCAN_EXTRA=\"\" 
TMP_DIR=\"$ENV{TOPDIR}/feeds/$name.tmp\"");
+       system("ln -sf $name.tmp/.packageinfo ./feeds/$name.index");
+
+       return 0;
+}
+
 sub get_feed($) {
        my $feed = shift;

@@ -110,7 +141,7 @@
        }
 }

-sub install_svn() {
+sub install_generic() {
        my $feed = shift;
        my $pkg = shift;
        my $path = $pkg->{makefile};
@@ -124,7 +155,9 @@
 }

 my %install_method = (
-       'src-svn' => \&install_svn
+       'src-svn' => \&install_generic,
+       'src-cpy' => \&install_generic,
+       'src-link' => \&install_generic
 );

 my %feed;
@@ -279,7 +312,9 @@
 }

 my %update_method = (
-       'src-svn' => \&update_svn
+       'src-svn' => \&update_svn,
+       'src-cpy' => \&update_cpy,
+       'src-link' => \&update_link
 );

 my %commands = (

Attachment: feeds.patch
Description: feeds.patch

_______________________________________________
openwrt-devel mailing list
[email protected]
http://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to