RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: j...@rpm5.org Module: rpm Date: 05-Oct-2009 00:46:21 Branch: HEAD Handle: 2009100422462100 Modified files: rpm/tools cp.c Log: - cp: add --xdev, stub-in addititional GNUish bits. Summary: Revision Changes Path 2.18 +16 -3 rpm/tools/cp.c ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/tools/cp.c ============================================================================ $ cvs diff -u -r2.17 -r2.18 cp.c --- rpm/tools/cp.c 15 Sep 2009 19:18:48 -0000 2.17 +++ rpm/tools/cp.c 4 Oct 2009 22:46:21 -0000 2.18 @@ -71,7 +71,13 @@ COPY_FLAGS_HARDLINK = _MFB( 6), /*!< -l,--link ... */ COPY_FLAGS_NOCLOBBER = _MFB( 7), /*!< -n,--noclobber ... */ COPY_FLAGS_PRESERVE = _MFB( 8), /*!< -p,--preserve ... */ - /* 9-31 unused */ + COPY_FLAGS_XDEV = _MFB( 9), /*!< -x,--xdev ... */ + + COPY_FLAGS_SYMLINK = _MFB(10), /*!< -s,--symlink ... */ + COPY_FLAGS_UPDATE = _MFB(11), /*!< -u,--update ... */ + COPY_FLAGS_SPARSE = _MFB(12), /*!< --sparse ... */ + + /* 13-31 unused */ }; #define CP_ISSET(_FLAG) ((ct->flags & ((COPY_FLAGS_##_FLAG) & ~0x40000000)) != COPY_FLAGS_NONE) @@ -781,6 +787,9 @@ ct->flags |= COPY_FLAGS_FOLLOW; ct->flags &= ~COPY_FLAGS_FOLLOWARGS; break; + case 'x': + ct->flags |= COPY_FLAGS_XDEV; + break; case '?': default: @@ -818,6 +827,8 @@ N_("Do not overwrite an existing file"), NULL }, { "preserve",'p', POPT_ARG_NONE, NULL, (int)'p', N_("Preserve mode/ownership/timestamps"), NULL }, + { "xdev",'x', POPT_ARG_NONE, NULL, (int)'x', + N_("Stay on thgis file system"), NULL }, #ifdef NOTYET { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioFtsPoptTable, 0, @@ -837,7 +848,7 @@ { NULL, (char)-1, POPT_ARG_INCLUDE_TABLE, NULL, 0, "\ Usage: cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpv] source_file target_file\n\ - cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpv] source_file ... target_directory\n\ + cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpv] source_file ... target_dir\n\ ", NULL }, POPT_TABLEEND @@ -861,6 +872,7 @@ ct->npath[0] = '\0'; ct->target_end = ""; ct->p_end = ct->npath; + ct->ftsoptions = FTS_NOCHDIR | FTS_PHYSICAL; optCon = rpmioInit(argc, argv, optionsTable); ct->av = poptGetArgs(optCon); @@ -870,7 +882,6 @@ goto exit; } - ct->ftsoptions = FTS_NOCHDIR | FTS_PHYSICAL; if (CP_ISSET(RECURSE)) { if (CP_ISSET(FOLLOWARGS)) ct->ftsoptions |= FTS_COMFOLLOW; @@ -882,6 +893,8 @@ ct->ftsoptions &= ~FTS_PHYSICAL; ct->ftsoptions |= FTS_LOGICAL | FTS_COMFOLLOW; } + if (CP_ISSET(XDEV)) + ct->ftsoptions |= FTS_XDEV; #if defined(SIGINFO) (void)signal(SIGINFO, siginfo); @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org