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

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

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

#1 Post 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
Find me on [url=https://www.minds.com/ns_tidder]minds[/url] and on [url=https://www.pearltrees.com/s243a/puppy-linux/id12399810]pearltrees[/url].

Burunduk
Posts: 80
Joined: Sun 21 Aug 2011, 21:44

cpio copy-pass mode

#2 Post 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.

Post Reply