Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
ccan
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mirror
ccan
Commits
4905f6d4
Commit
4905f6d4
authored
Nov 10, 2008
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused create_dep_tar.
parent
015fe7cb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
107 deletions
+1
-107
tools/Makefile
tools/Makefile
+1
-4
tools/create_dep_tar.c
tools/create_dep_tar.c
+0
-103
No files found.
tools/Makefile
View file @
4905f6d4
ALL_TOOLS
=
tools/ccan_depends tools/run_tests tools/doc_extract tools/namespacize
tools/create_dep_tar
ALL_TOOLS
=
tools/ccan_depends tools/run_tests tools/doc_extract tools/namespacize
.PHONY
:
tools
.PHONY
:
tools
tools
:
$(ALL_TOOLS)
tools
:
$(ALL_TOOLS)
...
@@ -11,9 +11,6 @@ tools/doc_extract: tools/doc_extract.o ccan/str_talloc/str_talloc.o ccan/grab_fi
...
@@ -11,9 +11,6 @@ tools/doc_extract: tools/doc_extract.o ccan/str_talloc/str_talloc.o ccan/grab_fi
tools/namespacize
:
tools/namespacize.o tools/depends.o ccan/str_talloc/str_talloc.o ccan/grab_file/grab_file.o ccan/noerr/noerr.o ccan/talloc/talloc.o
tools/namespacize
:
tools/namespacize.o tools/depends.o ccan/str_talloc/str_talloc.o ccan/grab_file/grab_file.o ccan/noerr/noerr.o ccan/talloc/talloc.o
tools/create_dep_tar
:
tools/create_dep_tar.o tools/depends.o ccan/str_talloc/str_talloc.o ccan/grab_file/grab_file.o ccan/noerr/noerr.o ccan/talloc/talloc.o tools/_infotojson/sqlite3_database.o tools/_infotojson/utils.o
$(CC)
$(LDFLAGS)
-o
$@
$^
-lsqlite3
tools/run_tests.o tools/namespacize.o tools/depends.o
:
tools/tools.h
tools/run_tests.o tools/namespacize.o tools/depends.o
:
tools/tools.h
tools-clean
:
ccanlint-clean
tools-clean
:
ccanlint-clean
...
...
tools/create_dep_tar.c
deleted
100644 → 0
View file @
015fe7cb
#include "tools.h"
#include <err.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sqlite3.h>
#include "ccan/grab_file/grab_file.h"
#include "ccan/str_talloc/str_talloc.h"
#include "ccan/talloc/talloc.h"
#include "tools/_infotojson/database.h"
#define TAR_CMD "tar cvvf "
/* get dependents of the module from db */
static
char
**
get_dependents
(
const
char
*
dir
,
const
char
*
db
)
{
char
*
query
,
*
module
,
**
dependents
;
sqlite3
*
handle
;
int
i
;
struct
db_query
*
q
;
module
=
strrchr
(
dir
,
'/'
);
module
++
;
/* getting dependents from db */
handle
=
db_open
(
db
);
query
=
talloc_asprintf
(
NULL
,
"select module from search where depends LIKE
\"
%%%s%%
\"
;"
,
module
);
q
=
db_query
(
handle
,
query
);
db_close
(
handle
);
if
(
q
->
num_rows
==
0
)
return
0
;
else
{
/* getting query results and returning */
dependents
=
talloc_array
(
NULL
,
char
*
,
q
->
num_rows
+
1
);
for
(
i
=
0
;
i
<
q
->
num_rows
;
i
++
)
dependents
[
i
]
=
talloc_asprintf
(
dependents
,
"ccan/%s"
,
q
->
rows
[
i
][
0
]);
dependents
[
q
->
num_rows
]
=
NULL
;
return
dependents
;
}
}
/* create tar ball of dependencies */
static
void
create_tar
(
char
**
deps
,
const
char
*
dir
,
const
char
*
targetdir
)
{
FILE
*
p
;
char
*
cmd_args
,
*
cmd
,
*
module
,
*
buffer
;
/* getting module name*/
module
=
strrchr
(
dir
,
'/'
);
module
++
;
if
(
deps
!=
NULL
)
{
cmd_args
=
strjoin
(
NULL
,
deps
,
" "
);
cmd
=
talloc_asprintf
(
NULL
,
TAR_CMD
"%s/%s_with_deps.tar %s %s"
,
targetdir
,
module
,
cmd_args
,
dir
);
}
else
cmd
=
talloc_asprintf
(
NULL
,
TAR_CMD
"%s/%s.tar %s"
,
targetdir
,
module
,
dir
);
p
=
popen
(
cmd
,
"r"
);
if
(
!
p
)
err
(
1
,
"Executing '%s'"
,
cmd
);
buffer
=
grab_fd
(
NULL
,
fileno
(
p
),
NULL
);
if
(
!
buffer
)
err
(
1
,
"Reading from '%s'"
,
cmd
);
pclose
(
p
);
}
int
main
(
int
argc
,
char
*
argv
[])
{
char
**
deps
,
**
dependents
;
int
i
;
if
(
argc
!=
4
)
errx
(
1
,
"Usage: create_dep_tar <dir> <targetdir> <db>
\n
"
"Create tar of all the ccan dependencies"
);
/* creating tar of the module */
create_tar
(
NULL
,
argv
[
1
],
argv
[
2
]);
printf
(
"creating tar ball of
\"
%s
\"\n
"
,
argv
[
1
]);
/* creating tar of the module dependencies */
deps
=
get_deps
(
talloc_autofree_context
(),
argv
[
1
],
true
);
if
(
deps
!=
NULL
)
create_tar
(
deps
,
argv
[
1
],
argv
[
2
]);
talloc_free
(
deps
);
/* creating/updating tar of the module dependents */
dependents
=
get_dependents
(
argv
[
1
],
argv
[
3
]);
if
(
dependents
!=
NULL
)
for
(
i
=
0
;
dependents
[
i
];
i
++
)
{
printf
(
"creating tar ball of
\"
%s
\"\n
"
,
dependents
[
i
]);
deps
=
get_deps
(
NULL
,
dependents
[
i
],
true
);
if
(
deps
!=
NULL
)
create_tar
(
deps
,
dependents
[
i
],
argv
[
2
]);
talloc_free
(
deps
);
}
talloc_free
(
dependents
);
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment