catalinux / rgfs (public) (License: GPLv3) (since 2020-11-11) (hash sha1)
Allows mapping of RocketGit storage area into a local directory
List of commits:
Subject Hash Author Date (UTC)
added utimens b5c24acf3ff86a51a7a49fec1eaf8eb65ae77bbb Catalin(ux) M. BOIE 2020-11-14 16:09:29
Improved debug f9bdf71667d0c77d4fcb4fa6e7792fd2d4c60712 Catalin(ux) M. BOIE 2020-11-13 18:57:48
Allow pushing a name and a repo id 9b48c3ae2a059a1ecd84caf44cea6c551175dd46 Catalin(ux) M. BOIE 2020-11-12 16:14:02
Send also the pkg_repo_id parameter 866c8063866effdabe0aa76fcfb9cc2b3d61b67a Catalin(ux) M. BOIE 2020-11-12 07:54:07
Now we can pass parameters by env 8352d8d09714a3c2af7550ad55517bfa8590a309 Catalin(ux) M. BOIE 2020-11-12 04:48:19
Inistial commit e51779259596117c80f6e7961f4387fdd48f820a Catalin(ux) M. BOIE 2020-11-11 08:18:38
Commit b5c24acf3ff86a51a7a49fec1eaf8eb65ae77bbb - added utimens
Author: Catalin(ux) M. BOIE
Author date (UTC): 2020-11-14 16:09
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2020-11-14 16:09
Parent(s): f9bdf71667d0c77d4fcb4fa6e7792fd2d4c60712
Signing key:
Tree: 996ae2a482fccb923d98918afea8f8cbfe669340
File Lines added Lines deleted
rgfs.c 49 0
File rgfs.c changed (mode: 100644) (index cd9f1c4..1162fea)
... ... static int rgfs_fuse_rename(const char *old, const char *new)
922 922 return 0; return 0;
923 923 } }
924 924
925 static int rgfs_fuse_utimens(const char *path, const struct timespec tv[2])
926 {
927 int r, err = 0, i;
928 unsigned char buf[4 * 4096], cmd;
929 uint16_t u16, len;
930 uint64_t u64;
931
932 // sizeof(time_t) = 8; sizeof(long) = 8
933 xlog("utimens: path=%s atime=%lu.%lu mtime=%lu.%lu\n",
934 path, tv[0].tv_sec, tv[0].tv_nsec, tv[1].tv_sec, tv[1].tv_nsec);
935
936 len = strlen(path);
937 len = 1 + 2 + 2 + len + 4 * 8;
938 if (len > sizeof(buf)) {
939 xlog(" buffer too small\n");
940 return -EIO;
941 }
942
943 i = 0;
944 buf[i++] = 0x0a;
945 buf[i++] = (len - 1 - 2) >> 8;
946 buf[i++] = len - 1 - 2;
947 u16 = htobe16(len); memcpy(buf + i, &u16, 2); i += 2;
948 memcpy(buf + i, path, len); i += len;
949 u64 = htobe64(tv[0].tv_sec); memcpy(buf + i, &u64, 8); i += 8;
950 u64 = htobe64(tv[0].tv_nsec); memcpy(buf + i, &u64, 8); i += 8;
951 u64 = htobe64(tv[1].tv_sec); memcpy(buf + i, &u64, 8); i += 8;
952 u64 = htobe64(tv[1].tv_nsec); memcpy(buf + i, &u64, 8); i += 8;
953 r = rgfs_send_recv(buf, i, buf, sizeof(buf));
954
955 i = 4;
956 while (i < r) {
957 cmd = buf[i++];
958 //xlog(" cmd=0x%02hhx\n", cmd);
959 switch (cmd) {
960 case 0x00: err = - be32toh(*(uint32_t *) (buf + i)); i += 4; break;
961 default: xlog("Unexpected subcode 0x%02hhx!\n", cmd); exit(EXIT_FAILURE);
962 }
963 }
964
965 if (err != 0) {
966 xlog(" server returned error %d!\n", err);
967 return err;
968 }
969
970 return 0;
971 }
972
925 973 static const struct fuse_operations fuse_rgfs = { static const struct fuse_operations fuse_rgfs = {
926 974 .getattr = rgfs_fuse_getattr, .getattr = rgfs_fuse_getattr,
927 975 .readdir = rgfs_fuse_readdir, .readdir = rgfs_fuse_readdir,
 
... ... static const struct fuse_operations fuse_rgfs = {
934 982 .read = rgfs_fuse_read, .read = rgfs_fuse_read,
935 983 .write = rgfs_fuse_write, .write = rgfs_fuse_write,
936 984 .rename = rgfs_fuse_rename, .rename = rgfs_fuse_rename,
985 .utimens = rgfs_fuse_utimens
937 986 }; };
938 987
939 988 int main(int argc, char *argv[]) int main(int argc, char *argv[])
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/catalinux/rgfs

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/catalinux/rgfs

Clone this repository using git:
git clone git://git.rocketgit.com/user/catalinux/rgfs

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main