Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 17 Jul 2019, 03:15
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Extract Specific Files from woof-code/rootfs-skeleton/
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [2 Posts]  
Author Message
s243a

Joined: 02 Sep 2014
Posts: 1942

PostPosted: Wed 22 May 2019, 01:52    Post subject:  Extract Specific Files from woof-code/rootfs-skeleton/  

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:

#!/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 minds and on pearltrees.
Back to top
View user's profile Send private message Visit poster's website 
Burunduk

Joined: 21 Aug 2011
Posts: 74

PostPosted: Thu 23 May 2019, 15:59    Post subject: cpio copy-pass mode  

s243a wrote:
cpio -pd "$TARGET_DIR"


This is an interesting alternative to xargs cp. Thanks.

Quote:
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.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [2 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0309s ][ Queries: 11 (0.0077s) ][ GZIP on ]