Page 1 of 1

Extract Specific Files from woof-code/rootfs-skeleton/

Posted: Wed 22 May 2019, 05:52
by s243a
So one criticism that me and wander have of rootfs-skeleton in woof-CE is that everything is mixed together rather than broken into packges. I had a minimal version of rootfs-skeleton that was from mistfire's buildkit for TazPup and that I later modified for TazPup64. What I wanted to to is take only the files from the rootfs-skeleton in woofCE that are in mine and mistfire's more minimal verison of the rootfs-skeleton.

So the basic outline of this scipt is that subversion is used to download the rootfs-skeleton from woof-CE, the find command is used to see which files that we want to extract from the rootfs-skeleton and then the cpio command is used to copy the files. As a warning, this won't work with the busybox version of cpio because it doesn't support the options "-pd".

Here is the code:

Code: Select all

#!/bin/sh
CURDIR="`realpath .`"
. ./build.conf

SVN_REPO_BASE="svn_repo_base"
mkdir -p "$SVN_REPO_BASE"
cd "$SVN_REPO_BASE"

#https://stackoverflow.com/questions/7106012/download-a-single-folder-or-directory-from-a-github-repo
BASE_URL=https://github.com
REPO=puppylinux-woof-CE/woof-CE
BRANCH=trunk #either "trunk" or "branches/branch"
#Checked out revision 1.
F_PATH=woof-code
FOLDER=rootfs-skeleton
mkdir -p "$REPO/$BRANCH/$F_PATH"
cd $REPO/$BRANCH/$F_PATH
#TODO add check that dir is empty then do svn command
if [ ! -d $FOLDER ]; then
  svn export $BASE_URL/$REPO/$BRANCH/$F_PATH/$FOLDER
fi
cd $FOLDER
F_NAME_DIR="$WOOFCE/woof-code/rootfs-packages/tazcore_noarch"
TARGET_DIR="$WOOFCE/woof-code/rootfs-packages/puppycore_noarch"
( cd $F_NAME_DIR; find . -name '*' ) | cpio -pd "$TARGET_DIR"
https://pastebin.com/q3J2eEVu

cpio copy-pass mode

Posted: Thu 23 May 2019, 19:59
by Burunduk
s243a wrote:cpio -pd "$TARGET_DIR"
This is an interesting alternative to xargs cp. Thanks.
this won't work with the busybox version of cpio because it doesn't support the options "-pd".
It does. But there is a special compile option for this cpio mode (FEATURE_CPIO_P) so not all busybox builds support it.